Subscription Interface

Events

Kline Data Subscription

socket.emit('subscribe_kline', poolId, interval);

socket.emit('subscribe_kline', 1, '1m');

Depth Data Subscription

socket.emit('subscribe_depth', poolId, precision);

socket.emit('subscribe_depth', 1, '0.000000001');

Trades Data Subscription

socket.emit('subscribe_trades', poolId);

socket.emit('subscribe_trades', 1);

Pool Stats Data Subscription

socket.emit('subscribe_pool_stats', poolId);

socket.emit('subscribe_pool_stats', 1);

All Pools Stats Data Subscription

socket.emit('subscribe_all_pool_stats');

Unsubscribe

socket.emit('unsubscribe', subscriptionType, poolId, interval, precision);

socket.emit('unsubscribe', 'kline', 1, '1m');

socket.emit('unsubscribe', 'depth', 1, '0.000000001');

socket.emit('unsubscribe', 'trades', 1);

socket.emit('unsubscribe', 'pool_stats', 1);

Unsubscribe All

socket.emit('unsubscribe_all');

Unsubscribe All Kline

socket.emit('unsubscribe_all_kline');

Unsubscribe All Depth

socket.emit('unsubscribe_all_depth');

Unsubscribe All Pool Stats

socket.emit('unsubscribe_all_pool_stats');

Subscription Response

When successfully subscribing to a topic, the subscribed event is received:

socket.on('subscribed', (response) => {
    console.log(response);
});

Last updated