Account Notification

Subscribe to this topic to receive notifications about user balance update.

Rules

  • Topic name: account

  • ApiKey requred: Yes

Parameters

This topic has an optional flag: v3, which indicates the response is for v3 which has also include NFT info. if the flag is false or absent, the response is just like before.

ParameterNote

accountId

(Optional) not required as apiKey also link to an account

v3

(Optional) If it's a v3 sub which contains NFT info, default is false for compatible with previous sub topic

Notification example

{
    "topic": {
        "topic:": "account"
    },
    "ts":1584717910000,
    "data": {
        "accountId":1,
        "totalAmount": "24439253519655",
        "tokenId": 2,
        "amountLocked": "0"
    }
}

Data Model

Notification

If v3 is true:

FieldTypeNote

topic

JSON

Topic and parameters

ts

integer

Notification timestamp (milliseconds)

data

User's new balances (NFT info included)

Otherwise:

FieldTypeNote

topic

JSON

Topic and parameters

ts

integer

Notification timestamp (milliseconds)

data

User's new balances

BalanceV3

FieldTypeNote

accountId

integer

Account ID

tokenId

integer

Token ID

total

string

Total token balance

locked

string

Token balance locked by orders

nftId

string

(Optional)NFT ID if it's NFT token

nftData

string

(Optional)NFT hash data if it's NFT token

tokenAddress

string

(Optional)NFT token address if it's NFT token

Balance

FieldTypeNote

accountId

integer

Account ID

tokenId

integer

Token ID

totalAmount

string

Total token balance

amountLocked

string

Token balance locked by orders

Last updated