Receive a snapshot and updates for any wallet events on your account.
Subscribe to the account information channel to keep track of your wallets. The account information channel provides a snapshot and updates on the wallet events in your account. The snapshot is delivered upon subscribing and any changes to your wallets will be provided as updates for as long as the channel remains open. Any authenticated connection is automatically subscribed to the account information channel.
Example code to open an authenticated connection can be found on our Authenticated Channels Page.
Wallet events are sent with CHAN_ID = 0 and can be identified by looking at the TYPE stream field. Wallet events will use one of the following abbreviations: 'ws' (wallet snapshot) and 'wu' (wallet update).
[
0, //CHAN_ID
"ws", //MSG_TYPE
[
[
"exchange", //WALLET_TYPE
"SAN", //CURRENCY
19.76, //BALANCE
0, //UNSETTLED_INTEREST
null, //BALANCE_AVAILABLE
null, //Used for DESCRIPTION on 'wu' events
null //Used for META on 'wu' events
] //WALLET_ARRAY
] //WALLET_SNAPSHOT
]
[
0, //CHAN_ID
"wu", //MSG_TYPE
[
"exchange", //WALLET_TYPE
"BTC", //CURRENCY
1.61169184, //BALANCE
0, //UNSETTLED_INTEREST
null, //BALANCE_AVAILABLE
"Exchange 0.01 BTC for USD @ 7804.6", //DESCRIPTION
{
"reason":"TRADE",
"order_id":34988418651,
"order_id_oppo":34990541044,
"trade_price":"7804.6",
"trade_amount":"0.01"
} //META
] //WALLET_ARRAY
]
Wallet snapshot data
Index | Field | Type | Description |
---|---|---|---|
[0] | CHANNEL_ID | Int | Identification number assigned to the channel for the duration of this connection. |
[1] | MSG_TYPE | String | 'ws' (wallet snapshot) |
[2] | WALLET_SNAPSHOT | Array | Array with an array of wallet arrays(Indices [0...n] will be wallet arrays) |
[2][0...n] | WALLET_ARRAY | Array | Wallet array |
Wallet update data
Index | Field | Type | Description |
---|---|---|---|
[0] | CHANNEL_ID | Int | Identification number assigned to the channel for the duration of this connection. |
[1] | MSG_TYPE | String | 'wu' (wallet update) |
[2] | WALLET_ARRAY | Array | Wallet array |
Wallet array
Index | Field | Type | Description |
---|---|---|---|
[0] | WALLET_TYPE | String | Wallet name (exchange, margin, funding) |
[1] | CURRENCY | String | Currency (USD, etc) |
[2] | BALANCE | Float | Wallet balance |
[3] | UNSETTLED_INTEREST | Float | Unsettled interest |
[4] | BALANCE_AVAILABLE | Float / Null | Amount not tied up in active orders, positions or funding (null if the value has not yet been calculated). |
[5] | DESCRIPTION | String | Description of the ledger entry (can be null) |
[6] | META | Json | Provides info on the reason for the wallet update (can be null) |
Important
Certain calculated values (available balance) are only updated periodically. If the value reads 'null', this means that the calculated value is not yet available.
A 'calc' request can be used to to receive an updated value. See calc input dedicated section for more details.