nothingisdead / npm-kraken-api

[DEPRECATED] NodeJS Client Library for the Kraken (kraken.com) API
Other
412 stars 188 forks source link

Yet another nonce problem #20

Closed georgiosd closed 8 years ago

georgiosd commented 8 years ago

Hi all,

I'm not developing on Node but hoping you guys can give a hand, having trouble with nonce like so many others before me lol.

I use a semaphore to make sure only one nonce is generated and the response is received before trying another one but still getting a nonce error.

From fiddler capture, the requests in order (added nonce header for debugging):

POST https://api.kraken.com/0/public/AssetPairs HTTP/1.1
nonce: 108622843

POST https://api.kraken.com/0/public/Depth HTTP/1.1
nonce: 146190498

POST https://api.kraken.com/0/public/Trades HTTP/1.1
nonce: 156578556

POST https://api.kraken.com/0/private/AddOrder HTTP/1.1
nonce: 171383828

Response to AddOrder:

{"error":["EAPI:Invalid nonce"]}

What else could be wrong??

georgiosd commented 8 years ago

Solved it after chatting to Kraken chat (only discovered after coming here)...

For anyone passing by this issue, two notes:

brentechols commented 7 years ago

For posterity, and those looking for answers, I fixed my nonce issues by bumping the tolerance setting on my api key. Its not posted very well in the docs, but you can specify a threshold that will not trigger a nonce exception. I set mine to 15000000 (15s) since this library signs requests in nano seconds.

vnistor commented 7 years ago

I just use multiple API keys.

On Sat, 2 Sep 2017, 00:18 brentechols notifications@github.com wrote:

For posterity, and those looking for answers, I fixed my nonce issues by bumping the tolerance setting on my api key. Its not posted very well in the docs, but you can specify a threshold that will not trigger a nonce exception. I set mine to 15000000 (15s) since this library signs requests in nano seconds.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nothingisdead/npm-kraken-api/issues/20#issuecomment-326685934, or mute the thread https://github.com/notifications/unsubscribe-auth/AF2d_kxdLjeysN9uKfyPps0g7VHrcot0ks5seHSvgaJpZM4KyTWo .

--

Vlad Nistor

+40721278740 vladnistor@gmail.com