weiliuv / fcoin-python-sdk

fcoin api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

list_orders 函数返回异常

echo-ray opened this issue · comments

commented

您好~ 很抱歉开了个 issue 打扰了
您写的这个库对帮助巨大,非常感谢您封装的这个库,谢谢!

在使用过程中,我也遇到了一点小问题,因此冒昧请教下,
就是 list_orders 这个函数, 我希望获取ltcusdt交易对下的所有未成交订单
当我不添加参数时,会返回

400 Client Error:  for url: https://api.fcoin.com/v2/orders
{"status":400,"msg":"Required String parameter 'symbol' is not present"}

当添加一个symbol参数,如 ltcusdt 时 ,则返回list_orders() takes 1 positional argument but 2 were given

请问是我添加参数的方式不对吗?要怎么样给这个函数添加参数呢?

(我使用的是python3版本,环境是osx和python3.6)

出了symbol参数,states参数也是需要的吧,我是这么写的
fcoin.list_orders(states=states, symbol=symbol)

commented

Thx,我问了下官方的,然后才知道states也是必须传的参数。
感谢您给我们提供了这么棒一个接口库~!

commented

请问挂单请求时一直出现400 Bad Request是什么原因?
如下是我的请求Body:
{"amount":"1","price":"1","side":"buy","symbol":"zipeth","type":"limit"}

commented

请问一下,我使用list_orders也得到和echo-ray同样的问题。我要向获得所有的order list应该怎么送参数? 我目前就是用您的Fcoin().list_order(),就出现上述同样的问题。谢谢!!!
400 Client Error: for url: https://api.fcoin.com/v2/orders
{"status":400,"msg":"Required String parameter 'symbol' is not present"}