Skip to content

Commit 5ac972c

Browse files
committed
futures delivery candlesticks support more intervals
1 parent 057de74 commit 5ac972c

19 files changed

Lines changed: 183 additions & 66 deletions

README.md

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

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

8-
- API version: 4.23.2
9-
- Package version: 4.23.2
8+
- API version: 4.23.3
9+
- Package version: 4.23.3
1010
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
1111
For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts)
1212

docs/Currency.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
1010
**deposit_disabled** | **bool** | Whether currency's deposit is disabled | [optional]
1111
**trade_disabled** | **bool** | Whether currency's trading is disabled | [optional]
1212
**fixed_rate** | **str** | Fixed fee rate. Only for fixed rate currencies, not valid for normal currencies | [optional]
13+
**chain** | **str** | Chain of currency | [optional]
1314

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

docs/CurrencyChain.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Name | Type | Description | Notes
77
**name_cn** | **str** | Chain name in Chinese | [optional]
88
**name_en** | **str** | Chain name in English | [optional]
99
**is_disabled** | **int** | If it is disabled. 0 means NOT being disabled | [optional]
10+
**is_deposit_disabled** | **int** | Is deposit disabled. 0 means not | [optional]
11+
**is_withdraw_disabled** | **int** | Is withdrawal disabled. 0 means not | [optional]
1012

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

docs/DeliveryApi.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ contract = 'BTC_USDT_20200814' # str | Futures contract
315315
_from = 1546905600 # int | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional)
316316
to = 1546935600 # int | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional)
317317
limit = 100 # int | Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional) (default to 100)
318-
interval = '5m' # str | Interval time between data points (optional) (default to '5m')
318+
interval = '5m' # str | Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 (optional) (default to '5m')
319319

320320
try:
321321
# Get futures candlesticks
@@ -336,7 +336,7 @@ Name | Type | Description | Notes
336336
**_from** | **int**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional]
337337
**to** | **int**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional]
338338
**limit** | **int**| Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100]
339-
**interval** | **str**| Interval time between data points | [optional] [default to '5m']
339+
**interval** | **str**| Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 | [optional] [default to '5m']
340340

341341
### Return type
342342

@@ -974,7 +974,7 @@ Name | Type | Description | Notes
974974
975975
List futures orders
976976

977-
Zero-fill order cannot be retrieved for 60 seconds after cancellation
977+
Zero-filled order cannot be retrieved 10 minutes after order cancellation
978978

979979
### Example
980980

@@ -1055,7 +1055,7 @@ Name | Type | Description | Notes
10551055
10561056
Create a futures order
10571057

1058-
Zero-fill order cannot be retrieved for 60 seconds after cancellation
1058+
Zero-filled order cannot be retrieved 10 minutes after order cancellation
10591059

10601060
### Example
10611061

@@ -1126,7 +1126,7 @@ Name | Type | Description | Notes
11261126
11271127
Cancel all `open` orders matched
11281128

1129-
Zero-fill order cannot be retrieved for 60 seconds after cancellation
1129+
Zero-filled order cannot be retrieved 10 minutes after order cancellation
11301130

11311131
### Example
11321132

@@ -1199,7 +1199,7 @@ Name | Type | Description | Notes
11991199
12001200
Get a single order
12011201

1202-
Zero-fill order cannot be retrieved for 60 seconds after cancellation
1202+
Zero-filled order cannot be retrieved 10 minutes after order cancellation
12031203

12041204
### Example
12051205

docs/FuturesApi.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ contract = 'BTC_USDT' # str | Futures contract
322322
_from = 1546905600 # int | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional)
323323
to = 1546935600 # int | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional)
324324
limit = 100 # int | Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional) (default to 100)
325-
interval = '5m' # str | Interval time between data points (optional) (default to '5m')
325+
interval = '5m' # str | Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 (optional) (default to '5m')
326326

327327
try:
328328
# Get futures candlesticks
@@ -343,7 +343,7 @@ Name | Type | Description | Notes
343343
**_from** | **int**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional]
344344
**to** | **int**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional]
345345
**limit** | **int**| Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100]
346-
**interval** | **str**| Interval time between data points | [optional] [default to '5m']
346+
**interval** | **str**| Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 | [optional] [default to '5m']
347347

348348
### Return type
349349

@@ -1388,7 +1388,7 @@ Name | Type | Description | Notes
13881388
[[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)
13891389

13901390
# **update_dual_mode_position_leverage**
1391-
> list[Position] update_dual_mode_position_leverage(settle, contract, leverage)
1391+
> list[Position] update_dual_mode_position_leverage(settle, contract, leverage, cross_leverage_limit=cross_leverage_limit)
13921392
13931393
Update position leverage in dual mode
13941394

@@ -1419,10 +1419,11 @@ api_instance = gate_api.FuturesApi(api_client)
14191419
settle = 'usdt' # str | Settle currency
14201420
contract = 'BTC_USDT' # str | Futures contract
14211421
leverage = '10' # str | New position leverage
1422+
cross_leverage_limit = '10' # str | Cross margin leverage(valid only when `leverage` is 0) (optional)
14221423

14231424
try:
14241425
# Update position leverage in dual mode
1425-
api_response = api_instance.update_dual_mode_position_leverage(settle, contract, leverage)
1426+
api_response = api_instance.update_dual_mode_position_leverage(settle, contract, leverage, cross_leverage_limit=cross_leverage_limit)
14261427
print(api_response)
14271428
except GateApiException as ex:
14281429
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
@@ -1437,6 +1438,7 @@ Name | Type | Description | Notes
14371438
**settle** | **str**| Settle currency |
14381439
**contract** | **str**| Futures contract |
14391440
**leverage** | **str**| New position leverage |
1441+
**cross_leverage_limit** | **str**| Cross margin leverage(valid only when `leverage` is 0) | [optional]
14401442

14411443
### Return type
14421444

@@ -1534,7 +1536,7 @@ Name | Type | Description | Notes
15341536
15351537
List futures orders
15361538

1537-
Zero-fill order cannot be retrieved for 60 seconds after cancellation
1539+
Zero-filled order cannot be retrieved 10 minutes after order cancellation
15381540

15391541
### Example
15401542

@@ -1615,7 +1617,7 @@ Name | Type | Description | Notes
16151617
16161618
Create a futures order
16171619

1618-
Zero-fill order cannot be retrieved for 60 seconds after cancellation
1620+
- Creating futures orders requires `size`, which is number of contracts instead of currency amount. You can use `quanto_multiplier` in contract detail response to know how much currency 1 size contract represents - Zero-filled order cannot be retrieved 10 minutes after order cancellation. You will get a 404 not found for such orders - Set `reduce_only` to `true` can keep the position from changing side when reducing position size - In single position mode, to close a position, you need to set `size` to 0 and `close` to `true` - In dual position mode, to close one side position, you need to set `auto_size` side, `reduce_only` to true and `size` to 0
16191621

16201622
### Example
16211623

@@ -1686,7 +1688,7 @@ Name | Type | Description | Notes
16861688
16871689
Cancel all `open` orders matched
16881690

1689-
Zero-fill order cannot be retrieved for 60 seconds after cancellation
1691+
Zero-filled order cannot be retrieved 10 minutes after order cancellation
16901692

16911693
### Example
16921694

@@ -1759,7 +1761,7 @@ Name | Type | Description | Notes
17591761
17601762
Get a single order
17611763

1762-
Zero-fill order cannot be retrieved for 60 seconds after cancellation
1764+
Zero-filled order cannot be retrieved 10 minutes after order cancellation
17631765

17641766
### Example
17651767

docs/SpotApi.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Method | HTTP request | Description
3535
3636
List all currencies' details
3737

38+
Currency has two forms: 1. Only currency name, e.g., BTC, USDT 2. `<currency>_<chain>`, e.g., `HT_ETH` The latter one occurs when one currency has multiple chains. Currency detail contains a `chain` field whatever the form is. To retrieve all chains of one currency, you can use use all the details which has the name of the currency or name starting with `<currency>_`.
39+
3840
### Example
3941

4042
```python

docs/Ticker.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**currency_pair** | **str** | Currency pair | [optional]
77
**last** | **str** | Last trading price | [optional]
8-
**lowest_ask** | **str** | Lowest ask | [optional]
9-
**highest_bid** | **str** | Highest bid | [optional]
10-
**change_percentage** | **str** | Change percentage. | [optional]
11-
**base_volume** | **str** | Base currency trade volume | [optional]
12-
**quote_volume** | **str** | Quote currency trade volume | [optional]
8+
**lowest_ask** | **str** | Recent lowest ask | [optional]
9+
**highest_bid** | **str** | Recent highest bid | [optional]
10+
**change_percentage** | **str** | Change percentage in the last 24h | [optional]
11+
**base_volume** | **str** | Base currency trade volume in the last 24h | [optional]
12+
**quote_volume** | **str** | Quote currency trade volume in the last 24h | [optional]
1313
**high_24h** | **str** | Highest price in 24h | [optional]
1414
**low_24h** | **str** | Lowest price in 24h | [optional]
1515
**etf_net_value** | **str** | ETF net value | [optional]

docs/Transfer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Name | Type | Description | Notes
99
**to** | **str** | Account to transfer to |
1010
**amount** | **str** | Transfer amount |
1111
**currency_pair** | **str** | Margin currency pair. Required if transfer from or to margin account | [optional]
12-
**settle** | **str** | Futures settle currency. Required if &#x60;currency&#x60; is &#x60;POINT&#x60; | [optional]
12+
**settle** | **str** | Futures settle currency. Required if transferring from or to futures account | [optional]
1313

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

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.23.2"
17+
__version__ = "4.23.3"
1818

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

gate_api/api/delivery_api.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ def list_delivery_candlesticks(self, settle, contract, **kwargs): # noqa: E501
551551
:param int _from: Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified
552552
:param int to: End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time
553553
:param int limit: Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected.
554-
:param str interval: Interval time between data points
554+
:param str interval: Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0
555555
:param _preload_content: if False, the urllib3.HTTPResponse object will
556556
be returned without reading/decoding response
557557
data. Default is True.
@@ -581,7 +581,7 @@ def list_delivery_candlesticks_with_http_info(self, settle, contract, **kwargs):
581581
:param int _from: Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified
582582
:param int to: End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time
583583
:param int limit: Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected.
584-
:param str interval: Interval time between data points
584+
:param str interval: Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0
585585
:param _return_http_data_only: response data without head status code
586586
and headers
587587
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -1753,7 +1753,7 @@ def update_delivery_position_risk_limit_with_http_info(self, settle, contract, r
17531753
def list_delivery_orders(self, settle, status, **kwargs): # noqa: E501
17541754
"""List futures orders # noqa: E501
17551755
1756-
Zero-fill order cannot be retrieved for 60 seconds after cancellation # noqa: E501
1756+
Zero-filled order cannot be retrieved 10 minutes after order cancellation # noqa: E501
17571757
This method makes a synchronous HTTP request by default. To make an
17581758
asynchronous HTTP request, please pass async_req=True
17591759
>>> thread = api.list_delivery_orders(settle, status, async_req=True)
@@ -1784,7 +1784,7 @@ def list_delivery_orders(self, settle, status, **kwargs): # noqa: E501
17841784
def list_delivery_orders_with_http_info(self, settle, status, **kwargs): # noqa: E501
17851785
"""List futures orders # noqa: E501
17861786
1787-
Zero-fill order cannot be retrieved for 60 seconds after cancellation # noqa: E501
1787+
Zero-filled order cannot be retrieved 10 minutes after order cancellation # noqa: E501
17881788
This method makes a synchronous HTTP request by default. To make an
17891789
asynchronous HTTP request, please pass async_req=True
17901790
>>> thread = api.list_delivery_orders_with_http_info(settle, status, async_req=True)
@@ -1908,7 +1908,7 @@ def list_delivery_orders_with_http_info(self, settle, status, **kwargs): # noqa
19081908
def create_delivery_order(self, settle, futures_order, **kwargs): # noqa: E501
19091909
"""Create a futures order # noqa: E501
19101910
1911-
Zero-fill order cannot be retrieved for 60 seconds after cancellation # noqa: E501
1911+
Zero-filled order cannot be retrieved 10 minutes after order cancellation # noqa: E501
19121912
This method makes a synchronous HTTP request by default. To make an
19131913
asynchronous HTTP request, please pass async_req=True
19141914
>>> thread = api.create_delivery_order(settle, futures_order, async_req=True)
@@ -1934,7 +1934,7 @@ def create_delivery_order(self, settle, futures_order, **kwargs): # noqa: E501
19341934
def create_delivery_order_with_http_info(self, settle, futures_order, **kwargs): # noqa: E501
19351935
"""Create a futures order # noqa: E501
19361936
1937-
Zero-fill order cannot be retrieved for 60 seconds after cancellation # noqa: E501
1937+
Zero-filled order cannot be retrieved 10 minutes after order cancellation # noqa: E501
19381938
This method makes a synchronous HTTP request by default. To make an
19391939
asynchronous HTTP request, please pass async_req=True
19401940
>>> thread = api.create_delivery_order_with_http_info(settle, futures_order, async_req=True)
@@ -2030,7 +2030,7 @@ def create_delivery_order_with_http_info(self, settle, futures_order, **kwargs):
20302030
def cancel_delivery_orders(self, settle, contract, **kwargs): # noqa: E501
20312031
"""Cancel all `open` orders matched # noqa: E501
20322032
2033-
Zero-fill order cannot be retrieved for 60 seconds after cancellation # noqa: E501
2033+
Zero-filled order cannot be retrieved 10 minutes after order cancellation # noqa: E501
20342034
This method makes a synchronous HTTP request by default. To make an
20352035
asynchronous HTTP request, please pass async_req=True
20362036
>>> thread = api.cancel_delivery_orders(settle, contract, async_req=True)
@@ -2057,7 +2057,7 @@ def cancel_delivery_orders(self, settle, contract, **kwargs): # noqa: E501
20572057
def cancel_delivery_orders_with_http_info(self, settle, contract, **kwargs): # noqa: E501
20582058
"""Cancel all `open` orders matched # noqa: E501
20592059
2060-
Zero-fill order cannot be retrieved for 60 seconds after cancellation # noqa: E501
2060+
Zero-filled order cannot be retrieved 10 minutes after order cancellation # noqa: E501
20612061
This method makes a synchronous HTTP request by default. To make an
20622062
asynchronous HTTP request, please pass async_req=True
20632063
>>> thread = api.cancel_delivery_orders_with_http_info(settle, contract, async_req=True)
@@ -2151,7 +2151,7 @@ def cancel_delivery_orders_with_http_info(self, settle, contract, **kwargs): #
21512151
def get_delivery_order(self, settle, order_id, **kwargs): # noqa: E501
21522152
"""Get a single order # noqa: E501
21532153
2154-
Zero-fill order cannot be retrieved for 60 seconds after cancellation # noqa: E501
2154+
Zero-filled order cannot be retrieved 10 minutes after order cancellation # noqa: E501
21552155
This method makes a synchronous HTTP request by default. To make an
21562156
asynchronous HTTP request, please pass async_req=True
21572157
>>> thread = api.get_delivery_order(settle, order_id, async_req=True)
@@ -2177,7 +2177,7 @@ def get_delivery_order(self, settle, order_id, **kwargs): # noqa: E501
21772177
def get_delivery_order_with_http_info(self, settle, order_id, **kwargs): # noqa: E501
21782178
"""Get a single order # noqa: E501
21792179
2180-
Zero-fill order cannot be retrieved for 60 seconds after cancellation # noqa: E501
2180+
Zero-filled order cannot be retrieved 10 minutes after order cancellation # noqa: E501
21812181
This method makes a synchronous HTTP request by default. To make an
21822182
asynchronous HTTP request, please pass async_req=True
21832183
>>> thread = api.get_delivery_order_with_http_info(settle, order_id, async_req=True)

0 commit comments

Comments
 (0)