Closed tuloski closed 6 years ago
And the ws keeps closing and reopening as in https://github.com/bitfinexcom/bitfinex-api-node/issues/404
Maybe linked with https://github.com/bitfinexcom/bitfinex-api-node/pull/405
Probably, auth() returns an error because you are already authenticated. Did you try to listen for auth
message?
ws.on('open' => ws.auth.bind(ws));
ws.on('message', (data) => {
if(data.event === 'auth') {
this.authChannel = data.chanId;
} else if(data[0] === this.authChannel) {
console.log('Received a message on auth channel', data);
};
});
I had the same problem with reopening. You can try packetWDDelay: 50 * 1000
. It worked for me.
Yeah, see my attached snippet. I'm listening to 'auth' but I'm not receiving it.
But there is not this problem on 2.0.0. It's there only on master.
I just switched to master
branch and received the same error:
{ event: 'auth',
status: 'FAILED',
chanId: 0,
code: 10114,
msg: 'nonce: small' }
It happened because of this commit So, I changed the line
let now = new Date().getTime()
to
let now = 1000 * new Date().getTime()
in the nonce.js file and authenticated successfully. So, you can modify nonce.js
by yourself to keep using the same API key or generate a new one.
@tuloski @vansergen is correct, you need to generate a new API key since the nonce size has been reduced (it was needlessly multiplied by 1000 before). This is the last time the nonce will be reduced in size, we apologize for the inconvenience.
Using the master (not tag 2.0.0). When doing the auth via ws I'm getting the error: auth failed: nonce: small (FAILED)
The following is the used snippet