IlanFrumer / BitMEX-nodejs

An unofficial BitMEX API connector written with typescript
31 stars 15 forks source link

Authentication: Invalid signature #3

Open lazzrov opened 5 years ago

lazzrov commented 5 years ago

I'm getting the error message:

{
  "message": "Signature not valid.",
  "name": "HTTPError"
}

for the following code:

const r = require('bitmex-node');

const BITMEX_API_KEY = .....
const BITMEX_API_SECRET = .....

const bitmex = new r.BitmexAPI({
    "apiKeyID": BITMEX_API_KEY,
    "apiKeySecret": BITMEX_API_SECRET
});

!async function () {

    const position = await bitmex.Position
        .get({message: 'messageIncoming' })
        .catch(err => {console.log(err);
        });

}();
Gblumentals commented 4 years ago

Are you using testnet credentials?

Position takes different parameters: { "currency": "XBTUSD" , "columns": ... , "count": ... }