Closed patwhite closed 4 years ago
It corresponds to the created_at
property of the first/last element https://github.com/coinbase/coinbase-pro-node/issues/326
You can test it like this (which is equivalent to the request with no after
parameter):
authClient.getAccountTransfers(
'account-id',
{ after: new Date().toISOString() },
cb
);
I am getting this error 'Invalid positive integer value for parameter - after' any other suggestions? thanks in advance
@Nicholas-t I couldn't reproduce this error. Can you provide code you used? This works fine for me:
let limit = 10;
let accound_id = 'your-account-id';
authClient.getAccountTransfers(accound_id, { limit }, (error, response, data) => {
if (error) {
console.error(error);
} else {
let after = response.headers['cb-after'];
let before = response.headers['cb-before'];
console.log(before === data[0].created_at);
console.log(after === data[data.length - 1].created_at);
authClient.getAccountTransfers(
accound_id,
{ limit, after },
(error, response, data) => {
if (error) {
console.error(error);
} else {
console.log(response.headers['cb-before'] === data[0].created_at);
console.log(
response.headers['cb-after'] === data[data.length - 1].created_at
);
}
}
);
}
});
Hi, we are closing out PRs + Issues as this project is being archived.
Hi, I'm trying to paginate through results and can't seem to figure out an issue. The header response for a call to getAccountTransfers returns cb-after as a ISO time stamp, see here: "2019-09-03 18:04:35.655243+00".
However, the api library only accepts a number for the before / after parameters. Should I be converting that to epoch time? Any advice on how to page items?