fix: convert string to int when buy/sell
This commit is contained in:
parent
f88909cb2d
commit
ad90cba1fb
@ -280,7 +280,7 @@ def buy():
|
|||||||
raise ValueError("Missing required parameters")
|
raise ValueError("Missing required parameters")
|
||||||
|
|
||||||
price = float(price_str)
|
price = float(price_str)
|
||||||
amount = int(amount_str)
|
amount = int(float(amount_str))
|
||||||
|
|
||||||
if order_type == ORDER_TYPE_LIMIT and (price <= 0 or amount <= 0):
|
if order_type == ORDER_TYPE_LIMIT and (price <= 0 or amount <= 0):
|
||||||
raise ValueError("Price and amount must be positive")
|
raise ValueError("Price and amount must be positive")
|
||||||
@ -351,7 +351,7 @@ def sell():
|
|||||||
raise ValueError("Missing required parameters")
|
raise ValueError("Missing required parameters")
|
||||||
|
|
||||||
price = float(price_str)
|
price = float(price_str)
|
||||||
amount = int(amount_str)
|
amount = int(float(amount_str))
|
||||||
|
|
||||||
if order_type == ORDER_TYPE_LIMIT and (price <= 0 or amount <= 0):
|
if order_type == ORDER_TYPE_LIMIT and (price <= 0 or amount <= 0):
|
||||||
raise ValueError("Price and amount must be positive")
|
raise ValueError("Price and amount must be positive")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user