gdax nodejs authenticated client timeout
I get "{ message: 'request timestamp expired' }" every time I request something from the authenticated client. My api key is set up for just viewing. I've tried changing my computer to San Francisco time and also moving the clock back and forward a couple minutes, but I still get the same error.
This is my code:
const Gdax = require('gdax');
const key = 'mykey';
const secret = 'mysecret';
const passphrase = 'mypassphrase';
const apiURI = 'https://api.gdax.com';
const authedClient = new Gdax.AuthenticatedClient(key, secret, passphrase, apiURI);
authedClient
.getCoinbaseAccounts()
.then(data => console.log(data));
What am I doing wrong? Public api calls work just fine.
Posted Dec 28, 2017, 7:10 PM UTC
16
Your timestamp needs to be synced to GDAX's. Authentication relies on that.
How do I figure out what time to sync to?
GDAX returns server time. https://api.gdax.com/time
Get that, get the diff. between your time and that, and apply that when generating timestamps for authentication.
Ok. I don't see a way to specify a timestamp in the nodejs project. I'll try to figure it out later tonight. Thanks.
Thank you! I know what I need to do now. request_signer.js uses Date.now() and manually adjusting that value works. I'll add some functionality to synchronize with the server.
Glad I could help :) This stuff is tricky. I just encountered an exchange where sending a signature in upper case broke things. Had to be lower case.
We (Medved Trader) connect to a lot of exchanges so by necessity becoming experts in their API and their quirks. So many quirks...