Bitcoin Forum
May 25, 2024, 01:44:38 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: n00by development question: "key amount should be a decimal string"  (Read 1307 times)
esillen (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
June 28, 2014, 10:38:36 AM
 #1

I started writing for the Bitfinex api yesterday and I've been struggling quite hard with this.
I am using jndok's python implementation at http://jndok.net/bitfinexapi.html

I added my pyblic and secret keys and wrote this line of code at the end:

rep = place_order(0.001, 589.0, 'sell', 'limit', exchange='bitfinex')

And I thought that would do it but the reply I get 'Key amount should be a decimal string' and the order is not placed.
I also tried to print the reply code I get from the server and it is 400.

What does this mean?

Thankful for help!



I have python 2.7, Windows 8.
Dare
Hero Member
*****
Offline Offline

Activity: 508
Merit: 500


Techwolf on #bitcoin and Reddit


View Profile WWW
June 29, 2014, 09:52:11 PM
 #2

I've never used that API, but from the error it sounds like you're sending a float instead of decimal string (e.g. 0.001 instead of "0.001"). Try quoting the numbers in your API call, or use Python's float-to-string function if the value is dynamic, and see if that helps.

BTC: 1M8oUcBnkRDEhWWgV8ZXLTB6p1mgnejVbX
How Forum Activity Works
Bitcointalk Forum Rules
|
|
|
Firstbits (lucky vanitygen): 1WoLfRUGDx1
How Forum Trust Works
Bitcoin Source Code
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!