Web sockets
This page contains the documentation about the web sockets as a part of white label solution offered by Chintai.
Balances websocket
Base Path: /api/balances/socket.io
The endpoint allows clients to receive real-time updates of user balances. Whenever a user connects to the socket, they will start receiving the latest balance updates.
Purpose
- To provide real-time updates of user balances.
- Automatically push updates when the user's balance changes on the server.
Connection Method
- Clients connect to the endpoint using Socket.IO.
- Authentication is required.
Balance Update
Event balances
-
Description: Sent by the server whenever the user’s balance is changed on the blockchain.
-
Example Payload:
{
"frozen": "0.00 USD",
"liquid": "1.00 USD",
"releasing": "0.00 USD",
"in_order": "0.00 USD",
"secured": "0.00 USD",
"dividendpayment": "0.00 USD",
"vesting": "0.00 USD",
"total": "1.00 USD"
}
Exchange websocket
Base Path: /api/exchange/socket.io
Pairs
Subscribing to getPairs event will provide real-time updates whenever there are changes or additions to the list of pairs in the advanced exchange.
Candles
Subscribing to getCandles event will provide real-time updates whenever there are changes or additions to the list of candles in the advanced exchange.
Request Data:
- pairId: Uniquely identifies a pair.
- granularity: Specifies the time span of a candlestick in milliseconds.
- timeRange: Specifies the range of time for the candles to be returned. It is expressed in milliseconds and determines the oldest candle that should be returned in the output. Candles older than (current time - timeRange) are not returned.
Example:
{
pairId: "pairid",
granularity: 60000, // 1 minute in milliseconds
timeRange: 3600000 // 1 hour in milliseconds
}
Orderbook
Subscribing to getOrderBook event will provide real-time updates whenever there are changes or additions to the orderbook in the advanced exchange.
Request Data:
- pairId: Uniquely identifies a pair.
- precision: Precision of a pair.
Example:
{
pairId: "pairId",
precision: 2,
}
Recent Trades
Subscribing to getRecentTrades event will provide real-time updates whenever there are changes or additions to the list of recentTrades in the advanced exchange.
Request Data:
- pairId: Uniquely identifies a pair.
Personal Orders
Subscribing to getPersonalOrders event will provide real-time updates whenever there are changes or additions to the list of personalOrders in the advanced exchange.
Personal Trades
Subscribing to getPersonalTrades event will provide real-time updates whenever there are changes or additions to the list of personalTrades in the advanced exchange.