Public channel
Realtime API

Public Channel

Data
Channel
Event
Event trigger
マーケット情報
product_cash_${currencypair_code}_${product_id}
updated
最終取引価格が更新された
板情報
price_ladders_cash_${currencypair_code}_${side}
updated
板の情報が更新された
約定情報
executions_cash_${currency_pair_code}
updated
最新の約定リストが更新された
約定情報(詳細)
execution_details_cash_${currency_pair_code}
updated
最新の約定リストが更新された
Javascript sample
1
const { TapClient } = require("liquid-tap");
2
const tap = new TapClient();
3
const public_channel = tap.subscribe("product_cash_btcsgd_7");
4
public_channel.bind("updated", function(data) {
5
console.log("product_cash_btcsgd_7 has been updated", data);
6
});
7
8
const product_channel = tap.subscribe("product_cash_btcusd_1");
9
const orderbook_channel = tap.subscribe("price_ladders_cash_btcjpy_sell");
10
const executions_channel = tap.subscribe("executions_cash_btcjpy");
11
const executions_detail_channel = tap.subscribe("execution_details_cash_btcusd");
12
13
/* javascript - using raw websockets */
14
const ws = new WebSocket('wss://tap.liquid.com/app/LiquidTapClient');
15
ws.onmessage = (message) => {
16
const wsEvent = JSON.parse(message.data);
17
switch(wsEvent.event){
18
case 'pusher:connection_established':
19
console.log('Connected!');
20
ws.send(JSON.stringify({"event":"pusher:subscribe","data":{"channel":"some_public_channel"}}));
21
break;
22
case 'pusher_internal:subscription_succeeded':
23
console.log('Subscribed: ' + wsEvent.channel);
24
case 'updated':
25
console.log('Updated: ' + wsEvent.data);
26
}
27
}
Copied!
リンクのコピー