gateio / gateapi-python

243 stars 91 forks source link

FuturesOrder fails while being created from API response #151

Closed gezabohus closed 1 year ago

gezabohus commented 1 year ago

Try the following code:

order = FuturesOrder(contract="ARB_USDT", size=10, price="1.6")
api_response = self.futures_api.create_futures_order("usdt", order)

The API call succeeds as far as getting an OK response. Since there were no stp_id and stp_act specified, the response contains stp_id = "-" which then makes creating the response FuturesOrder fail, since the str_act setter only accepts values in ["co", "cn", "cb"].

revilwang commented 1 year ago

Which version are you using? It's caused by an incomplete API spec(which misses the - field). The problem has been resolved in the newest 4.45.0 version

gezabohus commented 1 year ago

Apologies for wasting your time. I was on 4.42. It is indeed working now.