簡體   English   中英

GDAX心跳通道

[英]GDAX Heartbeat Channel

我正在尋找有關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'
}

確保在Json請求中將"product_ids" : ["BTC-GBP"]包括在內。

所以這樣的事情應該可以工作(來自他們的API文檔)

{
    "type": "subscriptions",
    "channels": [        
        {
            "name": "heartbeat",
            "product_ids": [
                "ETH-USD",
                "ETH-EUR"
            ],
        }
    ]
}

看到這里https://docs.gdax.com/#subscribe

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM