bitfinex-py
bitfinex-py copied to clipboard
return nonce error
As Bitfinex is up after somedays so I think it will be nice to create issues again. As I try to run history() it returns following error:
trade = TradeClient('BITFINEX_KEY','BITFINEX_SECRET')
print trade.account_summary()
{u'message': u"Must specify a 'nonce' field that is a numeric string (e.g '42.3'). The nonce should always be bigger than last time."}
Did anyone from bitfinex respond to this?
If some one is looking at this issue than i will point them to a solution on: https://bitcointalk.org/index.php?topic=323628.0
This post shows example code to use rest API with bitfinex
change
@property def _nonce(self): """ Returns a nonce Used in authentication """ return str(time.time() * 100000)
to
@property def _nonce(self): """ Returns a nonce Used in authentication """ return str(int(time.time() * 100000))
can solve this problem
Change:
return str(time.time() * 100000)
To:
return str(long(time.time() * 100000))
Good Luck!
change to return str(long(time.time() * 100000)) still not work error is as below Key timestamp should be a decimal number, e.g. "123.456"
tried this code: str(time.time() * 100000)
.
Bitfinex replied: {'message': 'Nonce is too small.'}
.
But this code str(time.time() * 10**7)
works fine. But maybe it's not correct way to calc time
UPD:
this one works more stable: f'{time.time()*1e7:0.0f}'