Skip to main content

State

UserProfile | undefined
Core profile metadata (id, address, username, account type, withdrawal status). Undefined until fetched. Does not include balances, movements, or orders.
AccountBalance[]
User’s token balances. Populated by fetchProfile() (first 20) or getUserBalances(). Empty array until fetched.
GetPaginatedUserMovementsResponse | undefined
User’s ledger movements. Populated by fetchProfile() (first cursor page, pageSize 20) or getPaginatedUserMovements(). Undefined until fetched.
GetPaginatedOrdersResponse | undefined
User’s orders. Populated by fetchProfile() (first cursor page, pageSize 20) or getPaginatedOrders(). Undefined until fetched.
boolean
True while fetchProfile() is in flight. Does not reflect individual fetch method calls.

Actions

() => Promise<UserProfile>
Fetches the core profile and the first page of balances, movements, and orders in parallel. Updates all state fields. Throws if the profile fetch fails; balance/movement/order fetch failures are silent (state remains unchanged for those fields).
(params?) => Promise<GetUserBalancesResponse>
Fetch a cursor page of token balances. Updates balances state.Parameters:
  • pageSize (optional): Number of items per page, 1 to 1000 (default: 20). A larger value is rejected, not clamped
  • pageToken (optional): cursor — omit or send "" for the first page, then pass the previous response’s nextPageToken. The walk seeks on (token, assetId) over the set the server overlays with the matching engine’s authoritative amounts, so a balance the engine adds mid-walk no longer appears only at the end of the last page
There is no page: the SDK rejects one with a ValidationError before sending, and a raw REST request carrying it gets 400.Returns: balances plus nextPageToken — pass it back as pageToken and keep going until it comes back empty.
(assetId: string) => Promise<AccountBalance>
Get the balance for a specific asset by its UUID. Does not update balances state.
(params?) => Promise<GetPaginatedUserMovementsResponse>
Fetch paginated transaction history. Updates movements state.Parameters:
  • pageSize (optional): Number of items per page, 1 to 1000 (default: 20). A larger value is rejected, not clamped
  • pageToken (optional): cursor — omit or send "" for the first page, then pass the previous response’s nextPageToken. The walk seeks on (createdAt, id), both immutable, so a movement written mid-walk cannot make the walk repeat or drop a row
  • entryType (optional): Filter by entry type (LedgerEntryType, upper-case)
  • transactionType (optional): Filter by transaction type (TransactionType, upper-case)
  • assetId (optional): Filter by asset UUID
  • orderBy (optional): "ASC" or "DESC" (default "DESC"); a pageToken resumes only under the same orderBy
There is no page: the SDK rejects one with a ValidationError before sending, and a raw REST request carrying it gets 400. The filters must match the request that minted the token.Returns: movements plus nextPageToken — pass it back as pageToken and keep going until it comes back empty.
(params?) => Promise<GetPaginatedOrdersResponse>
Fetch paginated orders. Updates orders state.Parameters:
  • status, tradingPairId, tradingMode, marginAccountId (optional): filters
  • pageSize (optional): Items per page, up to 1000 (default: 10)
  • pageToken (optional): cursor — omit or send "" for the first page, then pass the previous response’s nextPageToken. See Order queries