gateio / gateapi-python

247 stars 92 forks source link

the example code cannot run, help #108

Closed alexander8402 closed 2 years ago

alexander8402 commented 2 years ago

2022-04-14 01:16:20,612: run futures API demo Traceback (most recent call last): File "/root/.local/lib/python3.8/site-packages/gate_api/api_client.py", line 190, in __call_api response_data = self.request( File "/root/.local/lib/python3.8/site-packages/gate_api/api_client.py", line 471, in request return self.rest_client.POST( File "/root/.local/lib/python3.8/site-packages/gate_api/rest.py", line 298, in POST return self.request( File "/root/.local/lib/python3.8/site-packages/gate_api/rest.py", line 232, in request raise ApiException(http_resp=r) gate_api.exceptions.ApiException: (400) Reason: Bad Request HTTP response headers: HTTPHeaderDict({'Date': 'Wed, 13 Apr 2022 17:16:20 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Server': 'openresty'}) HTTP response body: {"label":"INSUFFICIENT_AVAILABLE"}

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "app.py", line 46, in main() File "app.py", line 40, in main futures_demo(run_config) File "/root/gateio/gateapi-python/example/futures.py", line 27, in futures_demo futures_api.update_position_leverage(settle, contract, leverage) File "/root/.local/lib/python3.8/site-packages/gate_api/api/futures_api.py", line 1914, in update_position_leverage return self.update_position_leverage_with_http_info(settle, contract, leverage, **kwargs) # noqa: E501 File "/root/.local/lib/python3.8/site-packages/gate_api/api/futures_api.py", line 2003, in update_position_leverage_with_http_info return self.api_client.call_api( File "/root/.local/lib/python3.8/site-packages/gate_api/api_client.py", line 395, in call_api return self.__call_api( File "/root/.local/lib/python3.8/site-packages/gate_api/api_client.py", line 209, in __call_api raise GateApiException(err.get('label'), err.get('message'), err.get('detail'), e) gate_api.exceptions.GateApiException: (400) Reason: Bad Request HTTP response headers: HTTPHeaderDict({'Date': 'Wed, 13 Apr 2022 17:16:20 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Server': 'openresty'}) HTTP response body: {"label":"INSUFFICIENT_AVAILABLE"}

revilwang commented 2 years ago

The error messages tells you don't have enough balance in your futures account INSUFFICIENT_AVAILABLE

alexander8402 commented 2 years ago

INSUFFICIENT_AVAILABLE

thank you! I should read docs more