tiagosiebler / bybit-api

Node.js SDK for the Bybit APIs and WebSockets, with TypeScript & browser support.

Home Page:https://www.npmjs.com/package/bybit-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

failed to subscribe

Knaackee opened this issue · comments

At first, thanks for the great work.

I am getting the following error. Any idea ?

[
  'Websocket connected',
  {
    category: 'bybit-ws',
    wsKey: 'v5Private',
    testnet: true,
    market: 'v5'
  }
]
connection opened open: v5Private
[ 'Sending auth request...' ]
[
  "Getting auth'd request params",
  { category: 'bybit-ws', wsKey: 'v5Private' }
]
[
  'Subscribing to topics',
  { category: 'bybit-ws', wsKey: 'v5Private', topics: [ 'position' ] }
]
"(position) failed to subscribe"

Hi @Knaackee - you have testnet set to true, are your API keys for testnet?

Most of the time it's something wrong with your API keys. The WS client also emits error events for something like this, there might be more information there on the failure. Recommend adding an error event listener if you haven't already:

 wsClient.on('error', (data) => {
   console.error('ws exception: ', data);
 });

I had the wrong keys. Thank you!