A WebSocket balance update message.

Received when balances change for a subscribed account.

interface BalanceUpdate {
    action: string;
    balance: {
        asset_id: AssetId;
        identity: Identity;
        order_books: Record<string, OrderBookBalance>;
        total_locked: bigint;
        total_unlocked: bigint;
        trading_account_balance: bigint;
    }[];
    onchain_timestamp?: string;
    seen_timestamp?: string;
}

Properties

action: string

The subscription action type.

balance: {
    asset_id: AssetId;
    identity: Identity;
    order_books: Record<string, OrderBookBalance>;
    total_locked: bigint;
    total_unlocked: bigint;
    trading_account_balance: bigint;
}[]

Updated balance entries (one per affected asset).

Type declaration

  • asset_id: AssetId

    The asset identifier.

  • identity: Identity

    The account identity.

  • order_books: Record<string, OrderBookBalance>

    Per-order-book balance breakdown.

  • total_locked: bigint

    Total locked across all order books (chain integer).

  • total_unlocked: bigint

    Total unlocked across all order books (chain integer).

  • trading_account_balance: bigint

    Total balance in the trading account (chain integer).

onchain_timestamp?: string

On-chain timestamp.

seen_timestamp?: string

Server-observed timestamp.