bitfinex-py icon indicating copy to clipboard operation
bitfinex-py copied to clipboard

return nonce error

Open arshpreetsingh opened this issue 8 years ago • 6 comments

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."}

arshpreetsingh avatar Aug 24 '16 11:08 arshpreetsingh

Did anyone from bitfinex respond to this?

kgosier avatar Oct 22 '16 20:10 kgosier

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

Dishant15 avatar Jan 04 '17 09:01 Dishant15

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

zsyh avatar Oct 01 '17 13:10 zsyh

Change: return str(time.time() * 100000) To: return str(long(time.time() * 100000))

Good Luck!

zuntah avatar Oct 04 '17 10:10 zuntah

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"

cliff0412 avatar Jan 12 '18 06:01 cliff0412

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}'

duker33 avatar Feb 26 '18 11:02 duker33