我正在查看有关 GDAX API 的 Coinbase 的 Github 文档并尝试订阅心跳通道,但是当我使用此代码时,会不断返回以下错误:
var websocket = new Gdax.WebsocketClient(
['BTC-USD'],
'wss://ws-feed.gdax.com',
{
key: API_KEY,
secret: API_SECRET,
passphrase: API_PASSPHRASE,
},
{ heartbeat: true }
)
webSocket.on('message', data => {
console.log(data);
});
错误:
{
type: 'error',
message: 'Failed to subscribe',
reason: 'You need to specify at least one product ID for channel heartbeat'
}