Skip to content

Commit be3c452

Browse files
committed
deprecate last_id in futures trading history
1 parent 3565e5c commit be3c452

9 files changed

Lines changed: 38 additions & 26 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API
33

44
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
55

6-
- API version: 4.8.2
7-
- Package version: 4.8.2
6+
- API version: 4.9.0
7+
- Package version: 4.9.0
88
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
99
For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts)
1010

docs/FuturesApi.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ settle = 'btc' # str | Settle currency (default to 'btc')
468468
contract = 'BTC_USD' # str | Futures contract, return related data only if specified (optional)
469469
order = 12345 # int | Futures order ID, return related data only if specified (optional)
470470
limit = 100 # int | Maximum number of record returned in one list (optional) (default to 100)
471-
last_id = '12345' # str | Specify list staring point using the last record of `id` in previous list-query results (optional)
471+
last_id = '12345' # str | Specify list staring point using the `id` of last record in previous list-query results (optional)
472472

473473
try:
474474
# List personal trading history
@@ -486,7 +486,7 @@ Name | Type | Description | Notes
486486
**contract** | **str**| Futures contract, return related data only if specified | [optional]
487487
**order** | **int**| Futures order ID, return related data only if specified | [optional]
488488
**limit** | **int**| Maximum number of record returned in one list | [optional] [default to 100]
489-
**last_id** | **str**| Specify list staring point using the last record of `id` in previous list-query results | [optional]
489+
**last_id** | **str**| Specify list staring point using the `id` of last record in previous list-query results | [optional]
490490

491491
### Return type
492492

@@ -986,7 +986,7 @@ settle = 'btc' # str | Settle currency (default to 'btc')
986986
contract = 'BTC_USD' # str | Futures contract
987987
status = 'open' # str | List orders based on status
988988
limit = 100 # int | Maximum number of record returned in one list (optional) (default to 100)
989-
last_id = '12345' # str | Specify list staring point using the last record of `id` in previous list-query results (optional)
989+
last_id = '12345' # str | Specify list staring point using the `id` of last record in previous list-query results (optional)
990990

991991
try:
992992
# List futures orders
@@ -1004,7 +1004,7 @@ Name | Type | Description | Notes
10041004
**contract** | **str**| Futures contract |
10051005
**status** | **str**| List orders based on status |
10061006
**limit** | **int**| Maximum number of record returned in one list | [optional] [default to 100]
1007-
**last_id** | **str**| Specify list staring point using the last record of `id` in previous list-query results | [optional]
1007+
**last_id** | **str**| Specify list staring point using the `id` of last record in previous list-query results | [optional]
10081008

10091009
### Return type
10101010

@@ -1069,7 +1069,7 @@ No authorization required
10691069
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
10701070

10711071
# **list_futures_trades**
1072-
> list[FuturesTrade] list_futures_trades(settle, contract, limit=limit, last_id=last_id)
1072+
> list[FuturesTrade] list_futures_trades(settle, contract, limit=limit, last_id=last_id, _from=_from, to=to)
10731073
10741074
Futures trading history
10751075

@@ -1085,11 +1085,13 @@ api_instance = gate_api.FuturesApi()
10851085
settle = 'btc' # str | Settle currency (default to 'btc')
10861086
contract = 'BTC_USD' # str | Futures contract
10871087
limit = 100 # int | Maximum number of record returned in one list (optional) (default to 100)
1088-
last_id = '12345' # str | Specify list staring point using the last record of `id` in previous list-query results (optional)
1088+
last_id = '12345' # str | Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range (optional)
1089+
_from = 1546905600 # float | Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional)
1090+
to = 1546935600 # float | Specify end time in Unix seconds, default to current time (optional)
10891091

10901092
try:
10911093
# Futures trading history
1092-
api_response = api_instance.list_futures_trades(settle, contract, limit=limit, last_id=last_id)
1094+
api_response = api_instance.list_futures_trades(settle, contract, limit=limit, last_id=last_id, _from=_from, to=to)
10931095
print(api_response)
10941096
except ApiException as e:
10951097
print("Exception when calling FuturesApi->list_futures_trades: %s\n" % e)
@@ -1102,7 +1104,9 @@ Name | Type | Description | Notes
11021104
**settle** | **str**| Settle currency | [default to 'btc']
11031105
**contract** | **str**| Futures contract |
11041106
**limit** | **int**| Maximum number of record returned in one list | [optional] [default to 100]
1105-
**last_id** | **str**| Specify list staring point using the last record of `id` in previous list-query results | [optional]
1107+
**last_id** | **str**| Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range | [optional]
1108+
**_from** | **float**| Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. | [optional]
1109+
**to** | **float**| Specify end time in Unix seconds, default to current time | [optional]
11061110

11071111
### Return type
11081112

docs/SpotApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ from gate_api.rest import ApiException
685685
api_instance = gate_api.SpotApi()
686686
currency_pair = 'BTC_USDT' # str | Currency pair
687687
limit = 100 # int | Maximum number of record returned in one list (optional) (default to 100)
688-
last_id = '12345' # str | Specify list staring point using the last record of `id` in previous list-query results (optional)
688+
last_id = '12345' # str | Specify list staring point using the `id` of last record in previous list-query results (optional)
689689

690690
try:
691691
# Retrieve market trades
@@ -701,7 +701,7 @@ Name | Type | Description | Notes
701701
------------- | ------------- | ------------- | -------------
702702
**currency_pair** | **str**| Currency pair |
703703
**limit** | **int**| Maximum number of record returned in one list | [optional] [default to 100]
704-
**last_id** | **str**| Specify list staring point using the last record of `id` in previous list-query results | [optional]
704+
**last_id** | **str**| Specify list staring point using the `id` of last record in previous list-query results | [optional]
705705

706706
### Return type
707707

gate_api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from __future__ import absolute_import
1616

17-
__version__ = "4.8.2"
17+
__version__ = "4.9.0"
1818

1919
# import apis into sdk package
2020
from gate_api.api.futures_api import FuturesApi

gate_api/api/futures_api.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ def get_my_trades(self, settle, **kwargs): # noqa: E501
879879
:param str contract: Futures contract, return related data only if specified
880880
:param int order: Futures order ID, return related data only if specified
881881
:param int limit: Maximum number of record returned in one list
882-
:param str last_id: Specify list staring point using the last record of `id` in previous list-query results
882+
:param str last_id: Specify list staring point using the `id` of last record in previous list-query results
883883
:return: list[MyFuturesTrade]
884884
If the method is called asynchronously,
885885
returns the request thread.
@@ -904,7 +904,7 @@ def get_my_trades_with_http_info(self, settle, **kwargs): # noqa: E501
904904
:param str contract: Futures contract, return related data only if specified
905905
:param int order: Futures order ID, return related data only if specified
906906
:param int limit: Maximum number of record returned in one list
907-
:param str last_id: Specify list staring point using the last record of `id` in previous list-query results
907+
:param str last_id: Specify list staring point using the `id` of last record in previous list-query results
908908
:return: list[MyFuturesTrade]
909909
If the method is called asynchronously,
910910
returns the request thread.
@@ -1950,7 +1950,7 @@ def list_futures_orders(self, settle, contract, status, **kwargs): # noqa: E501
19501950
:param str contract: Futures contract (required)
19511951
:param str status: List orders based on status (required)
19521952
:param int limit: Maximum number of record returned in one list
1953-
:param str last_id: Specify list staring point using the last record of `id` in previous list-query results
1953+
:param str last_id: Specify list staring point using the `id` of last record in previous list-query results
19541954
:return: list[FuturesOrder]
19551955
If the method is called asynchronously,
19561956
returns the request thread.
@@ -1976,7 +1976,7 @@ def list_futures_orders_with_http_info(self, settle, contract, status, **kwargs)
19761976
:param str contract: Futures contract (required)
19771977
:param str status: List orders based on status (required)
19781978
:param int limit: Maximum number of record returned in one list
1979-
:param str last_id: Specify list staring point using the last record of `id` in previous list-query results
1979+
:param str last_id: Specify list staring point using the `id` of last record in previous list-query results
19801980
:return: list[FuturesOrder]
19811981
If the method is called asynchronously,
19821982
returns the request thread.
@@ -2170,7 +2170,9 @@ def list_futures_trades(self, settle, contract, **kwargs): # noqa: E501
21702170
:param str settle: Settle currency (required)
21712171
:param str contract: Futures contract (required)
21722172
:param int limit: Maximum number of record returned in one list
2173-
:param str last_id: Specify list staring point using the last record of `id` in previous list-query results
2173+
:param str last_id: Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range
2174+
:param float _from: Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned.
2175+
:param float to: Specify end time in Unix seconds, default to current time
21742176
:return: list[FuturesTrade]
21752177
If the method is called asynchronously,
21762178
returns the request thread.
@@ -2194,15 +2196,17 @@ def list_futures_trades_with_http_info(self, settle, contract, **kwargs): # noq
21942196
:param str settle: Settle currency (required)
21952197
:param str contract: Futures contract (required)
21962198
:param int limit: Maximum number of record returned in one list
2197-
:param str last_id: Specify list staring point using the last record of `id` in previous list-query results
2199+
:param str last_id: Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range
2200+
:param float _from: Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned.
2201+
:param float to: Specify end time in Unix seconds, default to current time
21982202
:return: list[FuturesTrade]
21992203
If the method is called asynchronously,
22002204
returns the request thread.
22012205
"""
22022206

22032207
local_var_params = locals()
22042208

2205-
all_params = ['settle', 'contract', 'limit', 'last_id'] # noqa: E501
2209+
all_params = ['settle', 'contract', 'limit', 'last_id', '_from', 'to'] # noqa: E501
22062210
all_params.append('async_req')
22072211
all_params.append('_return_http_data_only')
22082212
all_params.append('_preload_content')
@@ -2242,6 +2246,10 @@ def list_futures_trades_with_http_info(self, settle, contract, **kwargs): # noq
22422246
query_params.append(('limit', local_var_params['limit'])) # noqa: E501
22432247
if 'last_id' in local_var_params:
22442248
query_params.append(('last_id', local_var_params['last_id'])) # noqa: E501
2249+
if '_from' in local_var_params:
2250+
query_params.append(('from', local_var_params['_from'])) # noqa: E501
2251+
if 'to' in local_var_params:
2252+
query_params.append(('to', local_var_params['to'])) # noqa: E501
22452253

22462254
header_params = {}
22472255

gate_api/api/spot_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ def list_trades(self, currency_pair, **kwargs): # noqa: E501
13531353
:param async_req bool
13541354
:param str currency_pair: Currency pair (required)
13551355
:param int limit: Maximum number of record returned in one list
1356-
:param str last_id: Specify list staring point using the last record of `id` in previous list-query results
1356+
:param str last_id: Specify list staring point using the `id` of last record in previous list-query results
13571357
:return: list[Trade]
13581358
If the method is called asynchronously,
13591359
returns the request thread.
@@ -1376,7 +1376,7 @@ def list_trades_with_http_info(self, currency_pair, **kwargs): # noqa: E501
13761376
:param async_req bool
13771377
:param str currency_pair: Currency pair (required)
13781378
:param int limit: Maximum number of record returned in one list
1379-
:param str last_id: Specify list staring point using the last record of `id` in previous list-query results
1379+
:param str last_id: Specify list staring point using the `id` of last record in previous list-query results
13801380
:return: list[Trade]
13811381
If the method is called asynchronously,
13821382
returns the request thread.

gate_api/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
7575
self.default_headers[header_name] = header_value
7676
self.cookie = cookie
7777
# Set default User-Agent.
78-
self.user_agent = 'OpenAPI-Generator/4.8.2/python'
78+
self.user_agent = 'OpenAPI-Generator/4.9.0/python'
7979

8080
def __del__(self):
8181
if self._pool:

gate_api/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,6 @@ def to_debug_report(self):
248248
return "Python SDK Debug Report:\n"\
249249
"OS: {env}\n"\
250250
"Python Version: {pyversion}\n"\
251-
"Version of the API: 4.8.2\n"\
252-
"SDK Package Version: 4.8.2".\
251+
"Version of the API: 4.9.0\n"\
252+
"SDK Package Version: 4.9.0".\
253253
format(env=sys.platform, pyversion=sys.version)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from setuptools import setup, find_packages # noqa: H301
1414

1515
NAME = "gate-api"
16-
VERSION = "4.8.2"
16+
VERSION = "4.9.0"
1717
# To install the library, run the following
1818
#
1919
# python setup.py install

0 commit comments

Comments
 (0)