Skip to content

Commit d53f88b

Browse files
committed
increase futures order book limit; add offset to position close history
1 parent 3351330 commit d53f88b

18 files changed

Lines changed: 167 additions & 38 deletions

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.18.4
7-
- Package version: 4.18.4
6+
- API version: 4.19.1
7+
- Package version: 4.19.1
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/BatchOrder.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Name | Type | Description | Notes
1919
**amount** | **str** | Trade amount | [optional]
2020
**price** | **str** | Order price | [optional]
2121
**time_in_force** | **str** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee | [optional] [default to 'gtc']
22-
**iceberg** | **str** | Amount to display for the iceberg order. Null or 0 for normal orders | [optional]
22+
**iceberg** | **str** | Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the amount totally | [optional]
2323
**auto_borrow** | **bool** | Used in margin trading(i.e. `account` is `margin`) to allow automatic loan of insufficient part if balance is not enough. | [optional]
2424
**left** | **str** | Amount left to fill | [optional] [readonly]
2525
**fill_price** | **str** | Total filled in quote currency. Deprecated in favor of `filled_total` | [optional] [readonly]

docs/DeliveryApi.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ No authorization required
153153
[[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)
154154

155155
# **list_delivery_order_book**
156-
> FuturesOrderBook list_delivery_order_book(settle, contract, interval=interval, limit=limit)
156+
> FuturesOrderBook list_delivery_order_book(settle, contract, interval=interval, limit=limit, with_id=with_id)
157157
158158
Futures order book
159159

@@ -178,10 +178,11 @@ settle = 'usdt' # str | Settle currency
178178
contract = 'BTC_USDT_20200814' # str | Futures contract
179179
interval = '0' # str | Order depth. 0 means no aggregation is applied. default to 0 (optional) (default to '0')
180180
limit = 10 # int | Maximum number of order depth data in asks or bids (optional) (default to 10)
181+
with_id = False # bool | Whether order book update ID would be returned. This ID increments by 1 on every order book update (optional) (default to False)
181182

182183
try:
183184
# Futures order book
184-
api_response = api_instance.list_delivery_order_book(settle, contract, interval=interval, limit=limit)
185+
api_response = api_instance.list_delivery_order_book(settle, contract, interval=interval, limit=limit, with_id=with_id)
185186
print(api_response)
186187
except GateApiException as ex:
187188
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
@@ -197,6 +198,7 @@ Name | Type | Description | Notes
197198
**contract** | **str**| Futures contract |
198199
**interval** | **str**| Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to '0']
199200
**limit** | **int**| Maximum number of order depth data in asks or bids | [optional] [default to 10]
201+
**with_id** | **bool**| Whether order book update ID would be returned. This ID increments by 1 on every order book update | [optional] [default to False]
200202

201203
### Return type
202204

docs/FuturesApi.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ No authorization required
160160
[[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)
161161

162162
# **list_futures_order_book**
163-
> FuturesOrderBook list_futures_order_book(settle, contract, interval=interval, limit=limit)
163+
> FuturesOrderBook list_futures_order_book(settle, contract, interval=interval, limit=limit, with_id=with_id)
164164
165165
Futures order book
166166

@@ -185,10 +185,11 @@ settle = 'btc' # str | Settle currency (default to 'btc')
185185
contract = 'BTC_USDT' # str | Futures contract
186186
interval = '0' # str | Order depth. 0 means no aggregation is applied. default to 0 (optional) (default to '0')
187187
limit = 10 # int | Maximum number of order depth data in asks or bids (optional) (default to 10)
188+
with_id = False # bool | Whether order book update ID would be returned. This ID increments by 1 on every order book update (optional) (default to False)
188189

189190
try:
190191
# Futures order book
191-
api_response = api_instance.list_futures_order_book(settle, contract, interval=interval, limit=limit)
192+
api_response = api_instance.list_futures_order_book(settle, contract, interval=interval, limit=limit, with_id=with_id)
192193
print(api_response)
193194
except GateApiException as ex:
194195
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
@@ -204,6 +205,7 @@ Name | Type | Description | Notes
204205
**contract** | **str**| Futures contract |
205206
**interval** | **str**| Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to '0']
206207
**limit** | **int**| Maximum number of order depth data in asks or bids | [optional] [default to 10]
208+
**with_id** | **bool**| Whether order book update ID would be returned. This ID increments by 1 on every order book update | [optional] [default to False]
207209

208210
### Return type
209211

@@ -1968,7 +1970,7 @@ Name | Type | Description | Notes
19681970
[[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)
19691971

19701972
# **list_position_close**
1971-
> list[PositionClose] list_position_close(settle, contract=contract, limit=limit)
1973+
> list[PositionClose] list_position_close(settle, contract=contract, limit=limit, offset=offset)
19721974
19731975
List position close history
19741976

@@ -1999,10 +2001,11 @@ api_instance = gate_api.FuturesApi(api_client)
19992001
settle = 'btc' # str | Settle currency (default to 'btc')
20002002
contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional)
20012003
limit = 100 # int | Maximum number of records returned in one list (optional) (default to 100)
2004+
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)
20022005

20032006
try:
20042007
# List position close history
2005-
api_response = api_instance.list_position_close(settle, contract=contract, limit=limit)
2008+
api_response = api_instance.list_position_close(settle, contract=contract, limit=limit, offset=offset)
20062009
print(api_response)
20072010
except GateApiException as ex:
20082011
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
@@ -2017,6 +2020,7 @@ Name | Type | Description | Notes
20172020
**settle** | **str**| Settle currency | [default to 'btc']
20182021
**contract** | **str**| Futures contract, return related data only if specified | [optional]
20192022
**limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100]
2023+
**offset** | **int**| List offset, starting from 0 | [optional] [default to 0]
20202024

20212025
### Return type
20222026

docs/FuturesTrade.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**id** | **int** | Trade ID | [optional]
77
**create_time** | **float** | Trading time | [optional]
8+
**create_time_ms** | **float** | Trading time, with milliseconds set to 3 decimal places. | [optional]
89
**contract** | **str** | Futures contract | [optional]
910
**size** | **int** | Trading size | [optional]
1011
**price** | **str** | Trading price | [optional]

docs/Order.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Name | Type | Description | Notes
1616
**amount** | **str** | Trade amount |
1717
**price** | **str** | Order price |
1818
**time_in_force** | **str** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee | [optional] [default to 'gtc']
19-
**iceberg** | **str** | Amount to display for the iceberg order. Null or 0 for normal orders | [optional]
19+
**iceberg** | **str** | Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the amount totally | [optional]
2020
**auto_borrow** | **bool** | Used in margin trading(i.e. `account` is `margin`) to allow automatic loan of insufficient part if balance is not enough. | [optional]
2121
**left** | **str** | Amount left to fill | [optional] [readonly]
2222
**fill_price** | **str** | Total filled in quote currency. Deprecated in favor of `filled_total` | [optional] [readonly]

docs/TradeFee.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Name | Type | Description | Notes
1111
**gt_maker_fee** | **str** | Maker fee rate if using GT deduction. It will be 0 if GT deduction is disabled | [optional]
1212
**loan_fee** | **str** | Loan fee rate of margin lending | [optional]
1313
**point_type** | **str** | Point type. 0 - Initial version. 1 - new version since 202009 | [optional]
14+
**futures_taker_fee** | **str** | Futures trading taker fee | [optional]
15+
**futures_maker_fee** | **str** | Future trading maker fee | [optional]
1416

1517
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1618

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.18.4"
17+
__version__ = "4.19.1"
1818

1919
# import apis into sdk package
2020
from gate_api.api.delivery_api import DeliveryApi

gate_api/api/delivery_api.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ def list_delivery_order_book(self, settle, contract, **kwargs): # noqa: E501
266266
:param str contract: Futures contract (required)
267267
:param str interval: Order depth. 0 means no aggregation is applied. default to 0
268268
:param int limit: Maximum number of order depth data in asks or bids
269+
:param bool with_id: Whether order book update ID would be returned. This ID increments by 1 on every order book update
269270
:param _preload_content: if False, the urllib3.HTTPResponse object will
270271
be returned without reading/decoding response
271272
data. Default is True.
@@ -294,6 +295,7 @@ def list_delivery_order_book_with_http_info(self, settle, contract, **kwargs):
294295
:param str contract: Futures contract (required)
295296
:param str interval: Order depth. 0 means no aggregation is applied. default to 0
296297
:param int limit: Maximum number of order depth data in asks or bids
298+
:param bool with_id: Whether order book update ID would be returned. This ID increments by 1 on every order book update
297299
:param _return_http_data_only: response data without head status code
298300
and headers
299301
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -310,7 +312,7 @@ def list_delivery_order_book_with_http_info(self, settle, contract, **kwargs):
310312

311313
local_var_params = locals()
312314

313-
all_params = ['settle', 'contract', 'interval', 'limit']
315+
all_params = ['settle', 'contract', 'interval', 'limit', 'with_id']
314316
all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
315317

316318
for k, v in six.iteritems(local_var_params['kwargs']):
@@ -334,10 +336,10 @@ def list_delivery_order_book_with_http_info(self, settle, contract, **kwargs):
334336
) # noqa: E501
335337

336338
if (
337-
self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 20
339+
self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 50
338340
): # noqa: E501
339341
raise ApiValueError(
340-
"Invalid value for parameter `limit` when calling `list_delivery_order_book`, must be a value less than or equal to `20`"
342+
"Invalid value for parameter `limit` when calling `list_delivery_order_book`, must be a value less than or equal to `50`"
341343
) # noqa: E501
342344
if (
343345
self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1
@@ -358,6 +360,8 @@ def list_delivery_order_book_with_http_info(self, settle, contract, **kwargs):
358360
query_params.append(('interval', local_var_params['interval'])) # noqa: E501
359361
if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501
360362
query_params.append(('limit', local_var_params['limit'])) # noqa: E501
363+
if 'with_id' in local_var_params and local_var_params['with_id'] is not None: # noqa: E501
364+
query_params.append(('with_id', local_var_params['with_id'])) # noqa: E501
361365

362366
header_params = {}
363367

gate_api/api/futures_api.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ def list_futures_order_book(self, settle, contract, **kwargs): # noqa: E501
266266
:param str contract: Futures contract (required)
267267
:param str interval: Order depth. 0 means no aggregation is applied. default to 0
268268
:param int limit: Maximum number of order depth data in asks or bids
269+
:param bool with_id: Whether order book update ID would be returned. This ID increments by 1 on every order book update
269270
:param _preload_content: if False, the urllib3.HTTPResponse object will
270271
be returned without reading/decoding response
271272
data. Default is True.
@@ -294,6 +295,7 @@ def list_futures_order_book_with_http_info(self, settle, contract, **kwargs): #
294295
:param str contract: Futures contract (required)
295296
:param str interval: Order depth. 0 means no aggregation is applied. default to 0
296297
:param int limit: Maximum number of order depth data in asks or bids
298+
:param bool with_id: Whether order book update ID would be returned. This ID increments by 1 on every order book update
297299
:param _return_http_data_only: response data without head status code
298300
and headers
299301
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -310,7 +312,7 @@ def list_futures_order_book_with_http_info(self, settle, contract, **kwargs): #
310312

311313
local_var_params = locals()
312314

313-
all_params = ['settle', 'contract', 'interval', 'limit']
315+
all_params = ['settle', 'contract', 'interval', 'limit', 'with_id']
314316
all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
315317

316318
for k, v in six.iteritems(local_var_params['kwargs']):
@@ -334,10 +336,10 @@ def list_futures_order_book_with_http_info(self, settle, contract, **kwargs): #
334336
) # noqa: E501
335337

336338
if (
337-
self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 20
339+
self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 50
338340
): # noqa: E501
339341
raise ApiValueError(
340-
"Invalid value for parameter `limit` when calling `list_futures_order_book`, must be a value less than or equal to `20`"
342+
"Invalid value for parameter `limit` when calling `list_futures_order_book`, must be a value less than or equal to `50`"
341343
) # noqa: E501
342344
if (
343345
self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1
@@ -358,6 +360,8 @@ def list_futures_order_book_with_http_info(self, settle, contract, **kwargs): #
358360
query_params.append(('interval', local_var_params['interval'])) # noqa: E501
359361
if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501
360362
query_params.append(('limit', local_var_params['limit'])) # noqa: E501
363+
if 'with_id' in local_var_params and local_var_params['with_id'] is not None: # noqa: E501
364+
query_params.append(('with_id', local_var_params['with_id'])) # noqa: E501
361365

362366
header_params = {}
363367

@@ -3545,6 +3549,7 @@ def list_position_close(self, settle, **kwargs): # noqa: E501
35453549
:param str settle: Settle currency (required)
35463550
:param str contract: Futures contract, return related data only if specified
35473551
:param int limit: Maximum number of records returned in one list
3552+
:param int offset: List offset, starting from 0
35483553
:param _preload_content: if False, the urllib3.HTTPResponse object will
35493554
be returned without reading/decoding response
35503555
data. Default is True.
@@ -3571,6 +3576,7 @@ def list_position_close_with_http_info(self, settle, **kwargs): # noqa: E501
35713576
:param str settle: Settle currency (required)
35723577
:param str contract: Futures contract, return related data only if specified
35733578
:param int limit: Maximum number of records returned in one list
3579+
:param int offset: List offset, starting from 0
35743580
:param _return_http_data_only: response data without head status code
35753581
and headers
35763582
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -3587,7 +3593,7 @@ def list_position_close_with_http_info(self, settle, **kwargs): # noqa: E501
35873593

35883594
local_var_params = locals()
35893595

3590-
all_params = ['settle', 'contract', 'limit']
3596+
all_params = ['settle', 'contract', 'limit', 'offset']
35913597
all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
35923598

35933599
for k, v in six.iteritems(local_var_params['kwargs']):
@@ -3615,6 +3621,12 @@ def list_position_close_with_http_info(self, settle, **kwargs): # noqa: E501
36153621
raise ApiValueError(
36163622
"Invalid value for parameter `limit` when calling `list_position_close`, must be a value greater than or equal to `1`"
36173623
) # noqa: E501
3624+
if (
3625+
self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0
3626+
): # noqa: E501
3627+
raise ApiValueError(
3628+
"Invalid value for parameter `offset` when calling `list_position_close`, must be a value greater than or equal to `0`"
3629+
) # noqa: E501
36183630
collection_formats = {}
36193631

36203632
path_params = {}
@@ -3626,6 +3638,8 @@ def list_position_close_with_http_info(self, settle, **kwargs): # noqa: E501
36263638
query_params.append(('contract', local_var_params['contract'])) # noqa: E501
36273639
if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501
36283640
query_params.append(('limit', local_var_params['limit'])) # noqa: E501
3641+
if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501
3642+
query_params.append(('offset', local_var_params['offset'])) # noqa: E501
36293643

36303644
header_params = {}
36313645

0 commit comments

Comments
 (0)