Skip to content

Commit 3853f2a

Browse files
committed
add offset parameter in futures orders and trades
1 parent 8f748ba commit 3853f2a

File tree

8 files changed

+43
-15
lines changed

8 files changed

+43
-15
lines changed

docs/BatchOrder.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Name | Type | Description | Notes
1717
**side** | **str** | Order side | [optional]
1818
**amount** | **str** | Trade amount | [optional]
1919
**price** | **str** | Order price | [optional]
20-
**time_in_force** | **str** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce only | [optional] [default to 'gtc']
20+
**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']
2121
**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]
2222
**left** | **str** | Amount left to fill | [optional]
2323
**fill_price** | **str** | Total filled in quote currency. Deprecated in favor of `filled_total` | [optional]

docs/DepositAddress.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**currency** | **str** | Currency detail |
7-
**address** | **str** | 充值地址 |
7+
**address** | **str** | Deposit address |
88

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

docs/FuturesApi.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ Authentication with API key and secret is required
447447
[[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)
448448

449449
# **get_my_trades**
450-
> list[MyFuturesTrade] get_my_trades(settle, contract=contract, order=order, limit=limit, last_id=last_id)
450+
> list[MyFuturesTrade] get_my_trades(settle, contract=contract, order=order, limit=limit, offset=offset, last_id=last_id, count_total=count_total)
451451
452452
List personal trading history
453453

@@ -468,11 +468,13 @@ 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+
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)
471472
last_id = '12345' # str | Specify list staring point using the `id` of last record in previous list-query results (optional)
473+
count_total = 0 # int | Whether to return total number matched. Default to 0(no return) (optional) (default to 0)
472474

473475
try:
474476
# List personal trading history
475-
api_response = api_instance.get_my_trades(settle, contract=contract, order=order, limit=limit, last_id=last_id)
477+
api_response = api_instance.get_my_trades(settle, contract=contract, order=order, limit=limit, offset=offset, last_id=last_id, count_total=count_total)
476478
print(api_response)
477479
except ApiException as e:
478480
print("Exception when calling FuturesApi->get_my_trades: %s\n" % e)
@@ -486,7 +488,9 @@ Name | Type | Description | Notes
486488
**contract** | **str**| Futures contract, return related data only if specified | [optional]
487489
**order** | **int**| Futures order ID, return related data only if specified | [optional]
488490
**limit** | **int**| Maximum number of record returned in one list | [optional] [default to 100]
491+
**offset** | **int**| List offset, starting from 0 | [optional] [default to 0]
489492
**last_id** | **str**| Specify list staring point using the `id` of last record in previous list-query results | [optional]
493+
**count_total** | **int**| Whether to return total number matched. Default to 0(no return) | [optional] [default to 0]
490494

491495
### Return type
492496

@@ -963,7 +967,7 @@ No authorization required
963967
[[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)
964968

965969
# **list_futures_orders**
966-
> list[FuturesOrder] list_futures_orders(settle, contract, status, limit=limit, last_id=last_id)
970+
> list[FuturesOrder] list_futures_orders(settle, contract, status, limit=limit, offset=offset, last_id=last_id, count_total=count_total)
967971
968972
List futures orders
969973

@@ -986,11 +990,13 @@ settle = 'btc' # str | Settle currency (default to 'btc')
986990
contract = 'BTC_USD' # str | Futures contract
987991
status = 'open' # str | List orders based on status
988992
limit = 100 # int | Maximum number of record returned in one list (optional) (default to 100)
993+
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)
989994
last_id = '12345' # str | Specify list staring point using the `id` of last record in previous list-query results (optional)
995+
count_total = 0 # int | Whether to return total number matched. Default to 0(no return) (optional) (default to 0)
990996

991997
try:
992998
# List futures orders
993-
api_response = api_instance.list_futures_orders(settle, contract, status, limit=limit, last_id=last_id)
999+
api_response = api_instance.list_futures_orders(settle, contract, status, limit=limit, offset=offset, last_id=last_id, count_total=count_total)
9941000
print(api_response)
9951001
except ApiException as e:
9961002
print("Exception when calling FuturesApi->list_futures_orders: %s\n" % e)
@@ -1004,7 +1010,9 @@ Name | Type | Description | Notes
10041010
**contract** | **str**| Futures contract |
10051011
**status** | **str**| List orders based on status |
10061012
**limit** | **int**| Maximum number of record returned in one list | [optional] [default to 100]
1013+
**offset** | **int**| List offset, starting from 0 | [optional] [default to 0]
10071014
**last_id** | **str**| Specify list staring point using the `id` of last record in previous list-query results | [optional]
1015+
**count_total** | **int**| Whether to return total number matched. Default to 0(no return) | [optional] [default to 0]
10081016

10091017
### Return type
10101018

docs/Order.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Name | Type | Description | Notes
1414
**side** | **str** | Order side |
1515
**amount** | **str** | Trade amount |
1616
**price** | **str** | Order price |
17-
**time_in_force** | **str** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce only | [optional] [default to 'gtc']
17+
**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']
1818
**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]
1919
**left** | **str** | Amount left to fill | [optional]
2020
**fill_price** | **str** | Total filled in quote currency. Deprecated in favor of `filled_total` | [optional]

gate_api/api/futures_api.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,9 @@ 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 int offset: List offset, starting from 0
882883
:param str last_id: Specify list staring point using the `id` of last record in previous list-query results
884+
:param int count_total: Whether to return total number matched. Default to 0(no return)
883885
:return: list[MyFuturesTrade]
884886
If the method is called asynchronously,
885887
returns the request thread.
@@ -904,15 +906,17 @@ def get_my_trades_with_http_info(self, settle, **kwargs): # noqa: E501
904906
:param str contract: Futures contract, return related data only if specified
905907
:param int order: Futures order ID, return related data only if specified
906908
:param int limit: Maximum number of record returned in one list
909+
:param int offset: List offset, starting from 0
907910
:param str last_id: Specify list staring point using the `id` of last record in previous list-query results
911+
:param int count_total: Whether to return total number matched. Default to 0(no return)
908912
:return: list[MyFuturesTrade]
909913
If the method is called asynchronously,
910914
returns the request thread.
911915
"""
912916

913917
local_var_params = locals()
914918

915-
all_params = ['settle', 'contract', 'order', 'limit', 'last_id'] # noqa: E501
919+
all_params = ['settle', 'contract', 'order', 'limit', 'offset', 'last_id', 'count_total'] # noqa: E501
916920
all_params.append('async_req')
917921
all_params.append('_return_http_data_only')
918922
all_params.append('_preload_content')
@@ -935,6 +939,8 @@ def get_my_trades_with_http_info(self, settle, **kwargs): # noqa: E501
935939
raise ValueError("Invalid value for parameter `limit` when calling `get_my_trades`, must be a value less than or equal to `1000`") # noqa: E501
936940
if 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501
937941
raise ValueError("Invalid value for parameter `limit` when calling `get_my_trades`, must be a value greater than or equal to `1`") # noqa: E501
942+
if 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501
943+
raise ValueError("Invalid value for parameter `offset` when calling `get_my_trades`, must be a value greater than or equal to `0`") # noqa: E501
938944
collection_formats = {}
939945

940946
path_params = {}
@@ -948,8 +954,12 @@ def get_my_trades_with_http_info(self, settle, **kwargs): # noqa: E501
948954
query_params.append(('order', local_var_params['order'])) # noqa: E501
949955
if 'limit' in local_var_params:
950956
query_params.append(('limit', local_var_params['limit'])) # noqa: E501
957+
if 'offset' in local_var_params:
958+
query_params.append(('offset', local_var_params['offset'])) # noqa: E501
951959
if 'last_id' in local_var_params:
952960
query_params.append(('last_id', local_var_params['last_id'])) # noqa: E501
961+
if 'count_total' in local_var_params:
962+
query_params.append(('count_total', local_var_params['count_total'])) # noqa: E501
953963

954964
header_params = {}
955965

@@ -1950,7 +1960,9 @@ def list_futures_orders(self, settle, contract, status, **kwargs): # noqa: E501
19501960
:param str contract: Futures contract (required)
19511961
:param str status: List orders based on status (required)
19521962
:param int limit: Maximum number of record returned in one list
1963+
:param int offset: List offset, starting from 0
19531964
:param str last_id: Specify list staring point using the `id` of last record in previous list-query results
1965+
:param int count_total: Whether to return total number matched. Default to 0(no return)
19541966
:return: list[FuturesOrder]
19551967
If the method is called asynchronously,
19561968
returns the request thread.
@@ -1976,15 +1988,17 @@ def list_futures_orders_with_http_info(self, settle, contract, status, **kwargs)
19761988
:param str contract: Futures contract (required)
19771989
:param str status: List orders based on status (required)
19781990
:param int limit: Maximum number of record returned in one list
1991+
:param int offset: List offset, starting from 0
19791992
:param str last_id: Specify list staring point using the `id` of last record in previous list-query results
1993+
:param int count_total: Whether to return total number matched. Default to 0(no return)
19801994
:return: list[FuturesOrder]
19811995
If the method is called asynchronously,
19821996
returns the request thread.
19831997
"""
19841998

19851999
local_var_params = locals()
19862000

1987-
all_params = ['settle', 'contract', 'status', 'limit', 'last_id'] # noqa: E501
2001+
all_params = ['settle', 'contract', 'status', 'limit', 'offset', 'last_id', 'count_total'] # noqa: E501
19882002
all_params.append('async_req')
19892003
all_params.append('_return_http_data_only')
19902004
all_params.append('_preload_content')
@@ -2015,6 +2029,8 @@ def list_futures_orders_with_http_info(self, settle, contract, status, **kwargs)
20152029
raise ValueError("Invalid value for parameter `limit` when calling `list_futures_orders`, must be a value less than or equal to `1000`") # noqa: E501
20162030
if 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501
20172031
raise ValueError("Invalid value for parameter `limit` when calling `list_futures_orders`, must be a value greater than or equal to `1`") # noqa: E501
2032+
if 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501
2033+
raise ValueError("Invalid value for parameter `offset` when calling `list_futures_orders`, must be a value greater than or equal to `0`") # noqa: E501
20182034
collection_formats = {}
20192035

20202036
path_params = {}
@@ -2028,8 +2044,12 @@ def list_futures_orders_with_http_info(self, settle, contract, status, **kwargs)
20282044
query_params.append(('status', local_var_params['status'])) # noqa: E501
20292045
if 'limit' in local_var_params:
20302046
query_params.append(('limit', local_var_params['limit'])) # noqa: E501
2047+
if 'offset' in local_var_params:
2048+
query_params.append(('offset', local_var_params['offset'])) # noqa: E501
20312049
if 'last_id' in local_var_params:
20322050
query_params.append(('last_id', local_var_params['last_id'])) # noqa: E501
2051+
if 'count_total' in local_var_params:
2052+
query_params.append(('count_total', local_var_params['count_total'])) # noqa: E501
20332053

20342054
header_params = {}
20352055

gate_api/models/batch_order.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ def price(self, price):
522522
def time_in_force(self):
523523
"""Gets the time_in_force of this BatchOrder. # noqa: E501
524524
525-
Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce only # noqa: E501
525+
Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee # noqa: E501
526526
527527
:return: The time_in_force of this BatchOrder. # noqa: E501
528528
:rtype: str
@@ -533,7 +533,7 @@ def time_in_force(self):
533533
def time_in_force(self, time_in_force):
534534
"""Sets the time_in_force of this BatchOrder.
535535
536-
Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce only # noqa: E501
536+
Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee # noqa: E501
537537
538538
:param time_in_force: The time_in_force of this BatchOrder. # noqa: E501
539539
:type: str

gate_api/models/deposit_address.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def currency(self, currency):
7979
def address(self):
8080
"""Gets the address of this DepositAddress. # noqa: E501
8181
82-
充值地址 # noqa: E501
82+
Deposit address # noqa: E501
8383
8484
:return: The address of this DepositAddress. # noqa: E501
8585
:rtype: str
@@ -90,7 +90,7 @@ def address(self):
9090
def address(self, address):
9191
"""Sets the address of this DepositAddress.
9292
93-
充值地址 # noqa: E501
93+
Deposit address # noqa: E501
9494
9595
:param address: The address of this DepositAddress. # noqa: E501
9696
:type: str

gate_api/models/order.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def price(self, price):
442442
def time_in_force(self):
443443
"""Gets the time_in_force of this Order. # noqa: E501
444444
445-
Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce only # noqa: E501
445+
Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee # noqa: E501
446446
447447
:return: The time_in_force of this Order. # noqa: E501
448448
:rtype: str
@@ -453,7 +453,7 @@ def time_in_force(self):
453453
def time_in_force(self, time_in_force):
454454
"""Sets the time_in_force of this Order.
455455
456-
Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce only # noqa: E501
456+
Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee # noqa: E501
457457
458458
:param time_in_force: The time_in_force of this Order. # noqa: E501
459459
:type: str

0 commit comments

Comments
 (0)