mariodian / bitfinex-api-php

Bitfinex PHP API - Access all features of https://www.bitfinex.com trading platform
Creative Commons Zero v1.0 Universal
31 stars 33 forks source link

Nonce is too small #3

Open jerome-shiftleft opened 6 years ago

jerome-shiftleft commented 6 years ago

Hi, When I tried this code

$bfx = new Bitfinex($api_key, $api_secret);

//var_dump($bfx->get_symbols());

$account_summary = $bfx->get_summary();

var_dump($account_summary);

It results to this array(2) { ["message"]=> string(19) "Nonce is too small." ["error"]=> bool(true) }

mariodian commented 6 years ago

Hi, can you please echo (string) number_format(round(microtime(true) * 100000), 0, '.', ''); on your system? What are you getting?

Also, are you getting the same error for more methods or just get_summary()?

lukasbesch commented 6 years ago

Same issue here. But multiplicating by 1000 works. JS timestamps include milliseconds

$data['nonce'] = (string) number_format(round(microtime(true) * 100000000), 0, '.', '');
tugudush commented 6 years ago

I haven't applied your solution but it's ok now just by changing my API key.

ramilS commented 6 years ago

@tugudush, api key reset - also resets nonce