Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

  • new ZoUser(margin: Margin, realm?: any, realmConnected?: boolean): ZoUser

Properties

balanceHistory: {} = {}

Type declaration

eventEmitter: null | EventEmitter<UpdateEvents, ChangeEvent<any>> = null
fundingHistory: {} = {}

Type declaration

  • [key: string]: any[]
fundingPagesParsed: {} = {}

Type declaration

  • [key: string]: number
fundingParsed: {} = {}

Type declaration

  • [key: string]: boolean
margin: Margin

internal info

perpLiqCurrentPage: {} = {}

Type declaration

  • [key: string]: number
perpLiqHistory: {} = {}

Type declaration

perpLiqPagesParsed: {} = {}

Type declaration

  • [key: string]: number
pnlCurrentPage: {} = {}

Type declaration

  • [key: string]: number
pnlHistory: {} = {}

Type declaration

pnlPagesParsed: {} = {}

Type declaration

  • [key: string]: number
positionsArr: PositionInfo[] = []
realm: any
realmConnected: boolean
spotLiqCurrentPage: number = 0
spotLiqHistory: SpotLiqHistoryEntry[] = []
spotLiqPagesParsed: number = 0
subLock: AsyncLock = ...
swapCurrentPage: number = 0
swapHistory: SwapHistoryEntry[] = []
swapPagesParsed: number = 0
tradesCurrentPage: {} = {}

Type declaration

  • [key: string]: number
tradesPagesParsed: {} = {}

Type declaration

  • [key: string]: number
tradesParsed: {} = {}

Type declaration

  • [key: string]: boolean
transferCurrentPage: number = 0
transferHistory: TransferHistoryEntry[] = []
transferPagesParsed: number = 0

Accessors

  • get assets(): {}
  • get balances(): {}
  • get connection(): Connection
  • get cumulativeUnrealizedPnL(): Decimal
  • get freeCollateralValue(): Decimal
  • get funding(): Decimal
  • get maintenanceMarginFraction(): Decimal
  • get marginFraction(): Decimal
  • get markets(): {}
  • get openMarginFraction(): Decimal
  • get program(): Program<Zo>
  • get provider(): default
  • get tiedCollateral(): Decimal
  • get totalOpenPositionNotional(): Decimal
  • get totalPositionNotional(): Decimal
  • get unweightedAccountValue(): Decimal
  • get unweightedCollateralValue(): Decimal

Methods

  • _getPerpLiqs(page: number, marketKey: string): Promise<any>
  • _getPnls(page: number, marketKey: string): Promise<any>
  • _getSpotLiqs(page: number): Promise<any>
  • _getSwaps(page: number): Promise<any>
  • _getTrades(page: number, marketKey: string): Promise<any>
  • _getTransfers(page: number): Promise<any>
  • _insertPerpLiqs(marketsDecoder: (string: any) => MarketInfo, marketKey: any): Promise<void>
  • _insertPnls(marketKey: string, assetDecimalsDecoder: (sym: any) => number): Promise<void>
  • _insertSpotLiqs(assets: {}): Promise<void>
  • _insertSwaps(assets: {}): Promise<void>
  • _insertTrades(marketKey: string): Promise<void>
  • _insertTransfers(assets: {}): Promise<void>
  • collateralWithdrawable(marketKey: string): Decimal
  • collateralWithdrawableWithBorrow(marketKey: string): Decimal
  • getBestAsk(marketKey: string): number
  • getBestBid(marketKey: string): number
  • getFunding(marketKey: string): Promise<undefined | any[]>
  • getFundingByPage(marketKey: string, page: number): Promise<any>
  • getOrderByOrderId(orderId: any): null | OrderInfo
  • getOrderbook(marketKey: string): Promise<{ asks: number[][]; bids: number[][] }>
  • Parameters

    • marketKey: string

    Returns Promise<{ asks: number[][]; bids: number[][] }>

  • getPerpLiqHistory(page: number, marketsDecoder: (string: any) => MarketInfo, allMarkets: boolean, currentMarketKey: string): Promise<any[]>
  • getPnlHistory(page: number, currentMarketKey: string, assetDecimalsDecoder: (sym: any) => number, allMarkets: boolean, allHistory?: boolean): Promise<any[]>
  • Parameters

    • page: number
    • currentMarketKey: string
    • assetDecimalsDecoder: (sym: any) => number
        • (sym: any): number
        • Parameters

          • sym: any

          Returns number

    • allMarkets: boolean
    • Optional allHistory: boolean

    Returns Promise<any[]>

  • getSpotLiqHistory(page: number, assets: {}): Promise<any>
  • getSwapHistory(page: number, assets: {}): Promise<any>
  • getTradesAndFunding(page: number, currentMarketKey: string, fundingOnly: boolean, allTrades: boolean): Promise<any[]>
  • getTransferHistory(page: number, assets: {}, entriesPerPage?: number): Promise<TransferHistoryEntry[]>
  • loadPositionsArr(markets: {}, indexToMarketKey: {}): PositionInfo[]
  • longOrderSize(marketKey: string): Decimal
  • openSize(marketKey: string): Decimal
  • positionFunding(positionOrMarketKey: string | PositionInfo): Decimal
  • positionPnL(positionOrMarketKey: string | PositionInfo): Decimal
  • positionPnLBasedOnMarkPrice(positionOrMarketKey: string | PositionInfo): Decimal
  • shortOrderSize(marketKey: string): Decimal
  • subscribe(withBackup?: boolean, stateLimit?: number, cacheLimit?: number): Promise<void>
  • Parameters

    • withBackup: boolean = false
    • stateLimit: number = 1000
    • cacheLimit: number = 5000

    Returns Promise<void>

  • unsubscribe(): Promise<void>
  • load(account: Keypair | Wallet, cluster: Cluster, opts: { commitment?: Commitment; rpcUrl: string; skipPreflight?: boolean; withRealm: boolean }): Promise<ZoUser>
  • Parameters

    • account: Keypair | Wallet
    • cluster: Cluster
    • opts: { commitment?: Commitment; rpcUrl: string; skipPreflight?: boolean; withRealm: boolean }
      • Optional commitment?: Commitment
      • rpcUrl: string
      • Optional skipPreflight?: boolean
      • withRealm: boolean

    Returns Promise<ZoUser>

Generated using TypeDoc