Skip to content

Commit 44d7bcf

Browse files
committed
release 4.21.5
1. You can set currency_pair as empty string for finished orders or trades query 2. Add margin and cross margin max transferable API support 3. Add futures position closes history query with time range support 4. Add withdraw fees on multiple chains
1 parent c5da8b0 commit 44d7bcf

20 files changed

Lines changed: 791 additions & 24 deletions

README.md

Lines changed: 6 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.21.4
9-
- Package version: 4.21.4
8+
- API version: 4.21.5
9+
- Package version: 4.21.5
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

@@ -189,6 +189,7 @@ Class | Method | HTTP request | Description
189189
*MarginApi* | [**update_loan_record**](docs/MarginApi.md#update_loan_record) | **PATCH** /margin/loan_records/{loan_record_id} | Modify a loan record
190190
*MarginApi* | [**get_auto_repay_status**](docs/MarginApi.md#get_auto_repay_status) | **GET** /margin/auto_repay | Retrieve user auto repayment setting
191191
*MarginApi* | [**set_auto_repay**](docs/MarginApi.md#set_auto_repay) | **POST** /margin/auto_repay | Update user's auto repayment setting
192+
*MarginApi* | [**get_margin_transferable**](docs/MarginApi.md#get_margin_transferable) | **GET** /margin/transferable | Max transferable amount for specified margin currency
192193
*MarginApi* | [**list_cross_margin_currencies**](docs/MarginApi.md#list_cross_margin_currencies) | **GET** /margin/cross/currencies | Currencies supported by cross margin.
193194
*MarginApi* | [**get_cross_margin_currency**](docs/MarginApi.md#get_cross_margin_currency) | **GET** /margin/cross/currencies/{currency} | Retrieve detail of one single currency supported by cross margin
194195
*MarginApi* | [**get_cross_margin_account**](docs/MarginApi.md#get_cross_margin_account) | **GET** /margin/cross/accounts | Retrieve cross margin account
@@ -198,6 +199,7 @@ Class | Method | HTTP request | Description
198199
*MarginApi* | [**get_cross_margin_loan**](docs/MarginApi.md#get_cross_margin_loan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail
199200
*MarginApi* | [**list_cross_margin_repayments**](docs/MarginApi.md#list_cross_margin_repayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments
200201
*MarginApi* | [**repay_cross_margin_loan**](docs/MarginApi.md#repay_cross_margin_loan) | **POST** /margin/cross/repayments | Repay cross margin loan
202+
*MarginApi* | [**get_cross_margin_transferable**](docs/MarginApi.md#get_cross_margin_transferable) | **GET** /margin/cross/transferable | Max transferable amount for specified cross margin currency
201203
*SpotApi* | [**list_currencies**](docs/SpotApi.md#list_currencies) | **GET** /spot/currencies | List all currencies' detail
202204
*SpotApi* | [**get_currency**](docs/SpotApi.md#get_currency) | **GET** /spot/currencies/{currency} | Get detail of one particular currency
203205
*SpotApi* | [**list_currency_pairs**](docs/SpotApi.md#list_currency_pairs) | **GET** /spot/currency_pairs | List all currency pairs supported
@@ -250,6 +252,7 @@ Class | Method | HTTP request | Description
250252
- [CrossMarginLoan](docs/CrossMarginLoan.md)
251253
- [CrossMarginRepayRequest](docs/CrossMarginRepayRequest.md)
252254
- [CrossMarginRepayment](docs/CrossMarginRepayment.md)
255+
- [CrossMarginTransferable](docs/CrossMarginTransferable.md)
253256
- [Currency](docs/Currency.md)
254257
- [CurrencyPair](docs/CurrencyPair.md)
255258
- [DeliveryContract](docs/DeliveryContract.md)
@@ -279,6 +282,7 @@ Class | Method | HTTP request | Description
279282
- [MarginAccountBook](docs/MarginAccountBook.md)
280283
- [MarginAccountCurrency](docs/MarginAccountCurrency.md)
281284
- [MarginCurrencyPair](docs/MarginCurrencyPair.md)
285+
- [MarginTransferable](docs/MarginTransferable.md)
282286
- [MultiChainAddressItem](docs/MultiChainAddressItem.md)
283287
- [MyFuturesTrade](docs/MyFuturesTrade.md)
284288
- [OpenOrders](docs/OpenOrders.md)

docs/CrossMarginTransferable.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# CrossMarginTransferable
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**currency** | **str** | Currency detail | [optional]
7+
**amount** | **str** | Max transferable amount | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

docs/FuturesApi.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,7 +1974,7 @@ Name | Type | Description | Notes
19741974
[[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)
19751975

19761976
# **list_position_close**
1977-
> list[PositionClose] list_position_close(settle, contract=contract, limit=limit, offset=offset)
1977+
> list[PositionClose] list_position_close(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to)
19781978
19791979
List position close history
19801980

@@ -2006,10 +2006,12 @@ settle = 'usdt' # str | Settle currency
20062006
contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional)
20072007
limit = 100 # int | Maximum number of records returned in one list (optional) (default to 100)
20082008
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)
2009+
_from = 1547706332 # int | Start timestamp (optional)
2010+
to = 1547706332 # int | End timestamp (optional)
20092011

20102012
try:
20112013
# List position close history
2012-
api_response = api_instance.list_position_close(settle, contract=contract, limit=limit, offset=offset)
2014+
api_response = api_instance.list_position_close(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to)
20132015
print(api_response)
20142016
except GateApiException as ex:
20152017
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
@@ -2025,6 +2027,8 @@ Name | Type | Description | Notes
20252027
**contract** | **str**| Futures contract, return related data only if specified | [optional]
20262028
**limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100]
20272029
**offset** | **int**| List offset, starting from 0 | [optional] [default to 0]
2030+
**_from** | **int**| Start timestamp | [optional]
2031+
**to** | **int**| End timestamp | [optional]
20282032

20292033
### Return type
20302034

docs/MarginApi.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Method | HTTP request | Description
2323
[**update_loan_record**](MarginApi.md#update_loan_record) | **PATCH** /margin/loan_records/{loan_record_id} | Modify a loan record
2424
[**get_auto_repay_status**](MarginApi.md#get_auto_repay_status) | **GET** /margin/auto_repay | Retrieve user auto repayment setting
2525
[**set_auto_repay**](MarginApi.md#set_auto_repay) | **POST** /margin/auto_repay | Update user's auto repayment setting
26+
[**get_margin_transferable**](MarginApi.md#get_margin_transferable) | **GET** /margin/transferable | Max transferable amount for specified margin currency
2627
[**list_cross_margin_currencies**](MarginApi.md#list_cross_margin_currencies) | **GET** /margin/cross/currencies | Currencies supported by cross margin.
2728
[**get_cross_margin_currency**](MarginApi.md#get_cross_margin_currency) | **GET** /margin/cross/currencies/{currency} | Retrieve detail of one single currency supported by cross margin
2829
[**get_cross_margin_account**](MarginApi.md#get_cross_margin_account) | **GET** /margin/cross/accounts | Retrieve cross margin account
@@ -32,6 +33,7 @@ Method | HTTP request | Description
3233
[**get_cross_margin_loan**](MarginApi.md#get_cross_margin_loan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail
3334
[**list_cross_margin_repayments**](MarginApi.md#list_cross_margin_repayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments
3435
[**repay_cross_margin_loan**](MarginApi.md#repay_cross_margin_loan) | **POST** /margin/cross/repayments | Repay cross margin loan
36+
[**get_cross_margin_transferable**](MarginApi.md#get_cross_margin_transferable) | **GET** /margin/cross/transferable | Max transferable amount for specified cross margin currency
3537

3638

3739
# **list_margin_currency_pairs**
@@ -1324,6 +1326,75 @@ Name | Type | Description | Notes
13241326

13251327
[[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)
13261328

1329+
# **get_margin_transferable**
1330+
> MarginTransferable get_margin_transferable(currency, currency_pair=currency_pair)
1331+
1332+
Max transferable amount for specified margin currency
1333+
1334+
### Example
1335+
1336+
* Api Key Authentication (apiv4):
1337+
```python
1338+
from __future__ import print_function
1339+
import gate_api
1340+
from gate_api.exceptions import ApiException, GateApiException
1341+
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
1342+
# See configuration.py for a list of all supported configuration parameters.
1343+
# The client must configure the authentication and authorization parameters
1344+
# in accordance with the API server security policy.
1345+
# Examples for each auth method are provided below, use the example that
1346+
# satisfies your auth use case.
1347+
1348+
# Configure APIv4 key authorization
1349+
configuration = gate_api.Configuration(
1350+
host = "https://api.gateio.ws/api/v4",
1351+
key = "YOU_API_KEY",
1352+
secret = "YOUR_API_SECRET"
1353+
)
1354+
1355+
api_client = gate_api.ApiClient(configuration)
1356+
# Create an instance of the API class
1357+
api_instance = gate_api.MarginApi(api_client)
1358+
currency = 'BTC' # str | Retrieved specified currency related data
1359+
currency_pair = 'BTC_USDT' # str | Currency pair (optional)
1360+
1361+
try:
1362+
# Max transferable amount for specified margin currency
1363+
api_response = api_instance.get_margin_transferable(currency, currency_pair=currency_pair)
1364+
print(api_response)
1365+
except GateApiException as ex:
1366+
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
1367+
except ApiException as e:
1368+
print("Exception when calling MarginApi->get_margin_transferable: %s\n" % e)
1369+
```
1370+
1371+
### Parameters
1372+
1373+
Name | Type | Description | Notes
1374+
------------- | ------------- | ------------- | -------------
1375+
**currency** | **str**| Retrieved specified currency related data |
1376+
**currency_pair** | **str**| Currency pair | [optional]
1377+
1378+
### Return type
1379+
1380+
[**MarginTransferable**](MarginTransferable.md)
1381+
1382+
### Authorization
1383+
1384+
[apiv4](../README.md#apiv4)
1385+
1386+
### HTTP request headers
1387+
1388+
- **Content-Type**: Not defined
1389+
- **Accept**: application/json
1390+
1391+
### HTTP response details
1392+
| Status code | Description | Response headers |
1393+
|-------------|-------------|------------------|
1394+
**200** | Successfully retrieved | - |
1395+
1396+
[[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)
1397+
13271398
# **list_cross_margin_currencies**
13281399
> list[CrossMarginCurrency] list_cross_margin_currencies()
13291400
@@ -1935,3 +2006,70 @@ Name | Type | Description | Notes
19352006

19362007
[[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)
19372008

2009+
# **get_cross_margin_transferable**
2010+
> CrossMarginTransferable get_cross_margin_transferable(currency)
2011+
2012+
Max transferable amount for specified cross margin currency
2013+
2014+
### Example
2015+
2016+
* Api Key Authentication (apiv4):
2017+
```python
2018+
from __future__ import print_function
2019+
import gate_api
2020+
from gate_api.exceptions import ApiException, GateApiException
2021+
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
2022+
# See configuration.py for a list of all supported configuration parameters.
2023+
# The client must configure the authentication and authorization parameters
2024+
# in accordance with the API server security policy.
2025+
# Examples for each auth method are provided below, use the example that
2026+
# satisfies your auth use case.
2027+
2028+
# Configure APIv4 key authorization
2029+
configuration = gate_api.Configuration(
2030+
host = "https://api.gateio.ws/api/v4",
2031+
key = "YOU_API_KEY",
2032+
secret = "YOUR_API_SECRET"
2033+
)
2034+
2035+
api_client = gate_api.ApiClient(configuration)
2036+
# Create an instance of the API class
2037+
api_instance = gate_api.MarginApi(api_client)
2038+
currency = 'BTC' # str | Retrieved specified currency related data
2039+
2040+
try:
2041+
# Max transferable amount for specified cross margin currency
2042+
api_response = api_instance.get_cross_margin_transferable(currency)
2043+
print(api_response)
2044+
except GateApiException as ex:
2045+
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
2046+
except ApiException as e:
2047+
print("Exception when calling MarginApi->get_cross_margin_transferable: %s\n" % e)
2048+
```
2049+
2050+
### Parameters
2051+
2052+
Name | Type | Description | Notes
2053+
------------- | ------------- | ------------- | -------------
2054+
**currency** | **str**| Retrieved specified currency related data |
2055+
2056+
### Return type
2057+
2058+
[**CrossMarginTransferable**](CrossMarginTransferable.md)
2059+
2060+
### Authorization
2061+
2062+
[apiv4](../README.md#apiv4)
2063+
2064+
### HTTP request headers
2065+
2066+
- **Content-Type**: Not defined
2067+
- **Accept**: application/json
2068+
2069+
### HTTP response details
2070+
| Status code | Description | Response headers |
2071+
|-------------|-------------|------------------|
2072+
**200** | Successfully retrieved | - |
2073+
2074+
[[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)
2075+

docs/MarginTransferable.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# MarginTransferable
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**currency** | **str** | Currency detail | [optional]
7+
**currency_pair** | **str** | Currency pair | [optional]
8+
**amount** | **str** | Max transferable amount | [optional]
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+

docs/SpotApi.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ configuration = gate_api.Configuration(
821821
api_client = gate_api.ApiClient(configuration)
822822
# Create an instance of the API class
823823
api_instance = gate_api.SpotApi(api_client)
824-
currency_pair = 'BTC_USDT' # str | Currency pair
824+
currency_pair = 'BTC_USDT' # str | Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones.
825825
status = 'open' # str | List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled
826826
page = 1 # int | Page number (optional) (default to 1)
827827
limit = 100 # int | Maximum number of records returned. If `status` is `open`, maximum of `limit` is 100 (optional) (default to 100)
@@ -841,7 +841,7 @@ except ApiException as e:
841841

842842
Name | Type | Description | Notes
843843
------------- | ------------- | ------------- | -------------
844-
**currency_pair** | **str**| Currency pair |
844+
**currency_pair** | **str**| Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. |
845845
**status** | **str**| List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled |
846846
**page** | **int**| Page number | [optional] [default to 1]
847847
**limit** | **int**| Maximum number of records returned. If `status` is `open`, maximum of `limit` is 100 | [optional] [default to 100]
@@ -1255,10 +1255,10 @@ configuration = gate_api.Configuration(
12551255
api_client = gate_api.ApiClient(configuration)
12561256
# Create an instance of the API class
12571257
api_instance = gate_api.SpotApi(api_client)
1258-
currency_pair = 'BTC_USDT' # str | Currency pair
1258+
currency_pair = 'BTC_USDT' # str | Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones.
12591259
limit = 100 # int | Maximum number of records returned in one list (optional) (default to 100)
12601260
page = 1 # int | Page number (optional) (default to 1)
1261-
order_id = '12345' # str | List all trades of specified order (optional)
1261+
order_id = '12345' # str | Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional)
12621262
account = 'cross_margin' # str | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional)
12631263

12641264
try:
@@ -1275,10 +1275,10 @@ except ApiException as e:
12751275

12761276
Name | Type | Description | Notes
12771277
------------- | ------------- | ------------- | -------------
1278-
**currency_pair** | **str**| Currency pair |
1278+
**currency_pair** | **str**| Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. |
12791279
**limit** | **int**| Maximum number of records returned in one list | [optional] [default to 100]
12801280
**page** | **int**| Page number | [optional] [default to 1]
1281-
**order_id** | **str**| List all trades of specified order | [optional]
1281+
**order_id** | **str**| Filter trades with specified order ID. `currency_pair` is also required if this field is present | [optional]
12821282
**account** | **str**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional]
12831283

12841284
### Return type

docs/Trade.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Name | Type | Description | Notes
66
**id** | **str** | Trade ID | [optional]
77
**create_time** | **str** | Trading time | [optional]
88
**create_time_ms** | **str** | Trading time, with millisecond precision | [optional]
9+
**currency_pair** | **str** | Currency pair | [optional]
910
**side** | **str** | Order side | [optional]
1011
**role** | **str** | Trade role | [optional]
1112
**amount** | **str** | Trade amount | [optional]

docs/WithdrawStatus.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Name | Type | Description | Notes
1313
**withdraw_amount_mini** | **str** | Minimum withdrawal amount | [optional]
1414
**withdraw_day_limit_remain** | **str** | Daily withdrawal amount left | [optional]
1515
**withdraw_eachtime_limit** | **str** | Maximum amount for each withdrawal | [optional]
16+
**withdraw_fix_on_chains** | **dict(str, str)** | Fixed withdrawal fee on multiple chains | [optional]
1617

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

gate_api/__init__.py

Lines changed: 3 additions & 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.21.4"
17+
__version__ = "4.21.5"
1818

1919
# import apis into sdk package
2020
from gate_api.api.delivery_api import DeliveryApi
@@ -47,6 +47,7 @@
4747
from gate_api.models.cross_margin_loan import CrossMarginLoan
4848
from gate_api.models.cross_margin_repay_request import CrossMarginRepayRequest
4949
from gate_api.models.cross_margin_repayment import CrossMarginRepayment
50+
from gate_api.models.cross_margin_transferable import CrossMarginTransferable
5051
from gate_api.models.currency import Currency
5152
from gate_api.models.currency_pair import CurrencyPair
5253
from gate_api.models.delivery_contract import DeliveryContract
@@ -76,6 +77,7 @@
7677
from gate_api.models.margin_account_book import MarginAccountBook
7778
from gate_api.models.margin_account_currency import MarginAccountCurrency
7879
from gate_api.models.margin_currency_pair import MarginCurrencyPair
80+
from gate_api.models.margin_transferable import MarginTransferable
7981
from gate_api.models.multi_chain_address_item import MultiChainAddressItem
8082
from gate_api.models.my_futures_trade import MyFuturesTrade
8183
from gate_api.models.open_orders import OpenOrders

0 commit comments

Comments
 (0)