import type { Asset } from './asset.js'; import type { ActionType, ActivityType, FillClassification, FillStatus, LiquidityRole, MarginMode, OrderSide, OrderType, PositionSide } from './enums.js'; import type { MarketDisplay, PerpsMarketDisplay } from './market.js'; import type { Address } from './primitives.js'; export interface FeeTier { maker: string; taker: string; } export interface Position { market: PerpsMarketDisplay; side: PositionSide; size: string; entryPrice: string; markPrice: string; liquidationPrice: string; unrealizedPnl: string; leverage: number; marginUsed: string; initialMarginRequirement: string; marginMode: MarginMode; } export interface PositionMarginConstraints { minimumMarginRequirement: string; amountIncrement: string; } export interface OpenOrder { orderId: string; market: MarketDisplay; side: OrderSide; type: OrderType; size: string; price: string; filledSize: string; reduceOnly: boolean; label?: string; createdAt: string; } export interface Balance { categoryId: string; asset: Asset; units: string; valueUsd: string; collateralWeight?: number; } export interface AccountResponse { provider: string; address: Address; balances: Balance[]; collateralBalances: Balance[]; positions: Position[]; marginUsed: string; unrealizedPnl: string; feeTier: FeeTier; config: AccountConfig; } export interface AccountSummary { portfolioValue: string; availableMargin: string; marginUsed: string; unrealizedPnl: string; } export interface MarketSettings { marginMode: MarginMode; leverage: number; } export interface TriggerOrder { orderId: string; market: MarketDisplay; type: OrderType; size: string; triggerPrice: string; limitPrice?: string; label?: string; createdAt: string; } export interface PositionsResponse { provider: string; positions: Position[]; pagination: Pagination; } export interface OrdersResponse { provider: string; openOrders: OpenOrder[]; triggerOrders: TriggerOrder[]; pagination: Pagination; } export interface Fill { id: string; orderId: string; market: MarketDisplay; side: OrderSide; type?: OrderType; size: string; price: string; status: FillStatus; liquidity: LiquidityRole; filledSize?: string; fee?: string; realizedPnl?: string | null; startPosition?: string; classification: FillClassification; createdAt: string; explorerLink?: string; } export interface Pagination { limit: number; hasMore: boolean; cursor?: string; nextUrl?: string; } export interface FillsResponse { provider: string; items: Fill[]; pagination: Pagination; } export interface BaseActivity { id: string; provider: string; timestamp: string; } export interface DepositActivity extends BaseActivity { type: ActivityType.DEPOSIT; amount: string; explorerLink?: string; } export interface WithdrawalActivity extends BaseActivity { type: ActivityType.WITHDRAWAL; amount: string; fee: string; explorerLink?: string; } export interface LiquidatedPosition { market: MarketDisplay; size: string; } export interface LiquidationActivity extends BaseActivity { type: ActivityType.LIQUIDATION; liquidatedNotionalPosition: string; accountValue: string; leverageType: string; liquidatedPositions: LiquidatedPosition[]; } export interface FundingActivity extends BaseActivity { type: ActivityType.FUNDING; market: MarketDisplay; amount: string; positionSize: string; fundingRate: string; } export type TransferActivity = BaseActivity & { type: ActivityType.TRANSFER; direction: 'IN' | 'OUT'; asset: string; amount: string; meta?: Record; explorerLink?: string; } & ({ counterpartyAccountIndex: number; counterpartyAddress?: string; } | { counterpartyAccountIndex?: number; counterpartyAddress: string; }); export type ActivityItem = DepositActivity | WithdrawalActivity | LiquidationActivity | FundingActivity | TransferActivity; export interface ActivitiesResponse { provider: string; items: ActivityItem[]; pagination: Pagination; } export type HyperliquidAgent = Record; export interface HyperliquidBuilderFeeApproval { builderAddress: string; maxFeeRate: string; approved: boolean; } export interface HyperliquidAccountConfig { provider: 'hyperliquid'; abstractionMode: string | null; agents: HyperliquidAgent[]; builderFeeApproval?: HyperliquidBuilderFeeApproval; } export interface LighterAssetCollateral { assetId: string; enabled: boolean; } export type LighterProviderKey = 'lighter' | 'lighter-rh'; export interface LighterAccountConfig { provider: LighterProviderKey; accountIndex: number; apiKeyIndex?: number; apiKeyRegistered: boolean; accountType: number; accountTradingMode: number; assetCollateral: LighterAssetCollateral[]; readOnlyTokenApproved: boolean; readOnlyTokenExpiry?: number; readOnlyTokenScope?: 'single' | 'all'; referralPresent: boolean; } export interface OndoAccountConfig { provider: 'ondo'; loggedIn: boolean; authTokenExpiry?: number; termsAccepted: boolean; apiKeyRegistered: boolean; referralSet: boolean; depositAddress: string | null; } export type AccountConfig = HyperliquidAccountConfig | LighterAccountConfig | OndoAccountConfig; export interface AccountConfigValue { name: string; value: string | number | boolean | null; } export interface AccountConfigSetting { type: ActionType; values: AccountConfigValue[]; satisfied?: boolean; } //# sourceMappingURL=account.d.ts.map