tiagosiebler / bybit-api

Node.js SDK for the Bybit APIs and WebSockets, with TypeScript & browser support.
https://www.npmjs.com/package/bybit-api
MIT License
247 stars 81 forks source link

Demo Trading Api Key Error #341

Closed welteles closed 5 months ago

welteles commented 5 months ago

I recently generated an API key and secret for my Demo Trading account. However, upon attempting to use them, I encountered the following error message:

image

I'm currently using the latest version of the software. Could you please assist me in resolving this issue?

My Code.

import { RestClientV5 } from 'bybit-api'; const client = new RestClientV5({testnet: false, key, secret});

tiagosiebler commented 5 months ago

You need to include demoTrading: true else the SDK doesn't know to use the dedicated demo trading API (different URL from the live environment): https://github.com/tiagosiebler/bybit-api/blob/master/examples/demo-trading.ts#L19-L37

welteles commented 5 months ago

Thank you so Much!