Skip to content

Commit 7fc5a51

Browse files
committed
add position close pagination, futures order book id, /wallet/fee and withdrawal chain support
1 parent d53f88b commit 7fc5a51

14 files changed

Lines changed: 241 additions & 22 deletions

README.md

Lines changed: 3 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.19.1
7-
- Package version: 4.19.1
6+
- API version: 4.19.2
7+
- Package version: 4.19.2
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

@@ -213,6 +213,7 @@ Class | Method | HTTP request | Description
213213
*WalletApi* | [**transfer_with_sub_account**](docs/WalletApi.md#transfer_with_sub_account) | **POST** /wallet/sub_account_transfers | Transfer between main and sub accounts
214214
*WalletApi* | [**list_withdraw_status**](docs/WalletApi.md#list_withdraw_status) | **GET** /wallet/withdraw_status | Retrieve withdrawal status
215215
*WalletApi* | [**list_sub_account_balances**](docs/WalletApi.md#list_sub_account_balances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances
216+
*WalletApi* | [**get_trade_fee**](docs/WalletApi.md#get_trade_fee) | **GET** /wallet/fee | Retrieve personal trading fee
216217
*WithdrawalApi* | [**withdraw**](docs/WithdrawalApi.md#withdraw) | **POST** /withdrawals | Withdraw
217218

218219

docs/Contract.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contract
22

3-
Futures contract details
3+
Contract detail. USD value per contract: - USDT settled contracts: `quanto_multiplier x token price` - BTC settled contracts:`quanto_multiplier x BTC price x token price`
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------

docs/FuturesOrderBook.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6+
**id** | **int** | Order Book ID. Increase by 1 on every order book change. Set `with_id=true` to include this field in response | [optional]
67
**asks** | [**list[FuturesOrderBookItem]**](FuturesOrderBookItem.md) | Asks order depth |
78
**bids** | [**list[FuturesOrderBookItem]**](FuturesOrderBookItem.md) | Bids order depth |
89

docs/LedgerRecord.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**id** | **str** | Record ID | [optional] [readonly]
77
**txid** | **str** | Hash record of the withdrawal | [optional] [readonly]
8-
**timestamp** | **str** | Record time | [optional] [readonly]
9-
**amount** | **str** | Trade amount |
10-
**currency** | **str** | Record currency |
8+
**timestamp** | **str** | Operation time | [optional] [readonly]
9+
**amount** | **str** | Currency amount |
10+
**currency** | **str** | Currency name |
1111
**address** | **str** | Withdrawal address. Required for withdrawals | [optional]
1212
**memo** | **str** | Extra withdrawal memo | [optional]
1313
**status** | **str** | Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: waiting for manual approval - BCODE: GateCode operation | [optional] [readonly]
14+
**chain** | **str** | Name of the chain used in withdrawals | [optional]
1415

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

docs/SpotApi.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@ No authorization required
512512
513513
Query user trading fee rates
514514

515+
This API is deprecated in favour of new fee retrieving API `/wallet/fee`.
516+
515517
### Example
516518

517519
* Api Key Authentication (apiv4):

docs/WalletApi.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Method | HTTP request | Description
1212
[**transfer_with_sub_account**](WalletApi.md#transfer_with_sub_account) | **POST** /wallet/sub_account_transfers | Transfer between main and sub accounts
1313
[**list_withdraw_status**](WalletApi.md#list_withdraw_status) | **GET** /wallet/withdraw_status | Retrieve withdrawal status
1414
[**list_sub_account_balances**](WalletApi.md#list_sub_account_balances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances
15+
[**get_trade_fee**](WalletApi.md#get_trade_fee) | **GET** /wallet/fee | Retrieve personal trading fee
1516

1617

1718
# **get_deposit_address**
@@ -580,3 +581,66 @@ Name | Type | Description | Notes
580581

581582
[[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)
582583

584+
# **get_trade_fee**
585+
> TradeFee get_trade_fee()
586+
587+
Retrieve personal trading fee
588+
589+
### Example
590+
591+
* Api Key Authentication (apiv4):
592+
```python
593+
from __future__ import print_function
594+
import gate_api
595+
from gate_api.exceptions import ApiException, GateApiException
596+
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
597+
# See configuration.py for a list of all supported configuration parameters.
598+
# The client must configure the authentication and authorization parameters
599+
# in accordance with the API server security policy.
600+
# Examples for each auth method are provided below, use the example that
601+
# satisfies your auth use case.
602+
603+
# Configure APIv4 key authorization
604+
configuration = gate_api.Configuration(
605+
host = "https://api.gateio.ws/api/v4",
606+
key = "YOU_API_KEY",
607+
secret = "YOUR_API_SECRET"
608+
)
609+
610+
api_client = gate_api.ApiClient(configuration)
611+
# Create an instance of the API class
612+
api_instance = gate_api.WalletApi(api_client)
613+
614+
try:
615+
# Retrieve personal trading fee
616+
api_response = api_instance.get_trade_fee()
617+
print(api_response)
618+
except GateApiException as ex:
619+
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
620+
except ApiException as e:
621+
print("Exception when calling WalletApi->get_trade_fee: %s\n" % e)
622+
```
623+
624+
### Parameters
625+
This endpoint does not need any parameter.
626+
627+
### Return type
628+
629+
[**TradeFee**](TradeFee.md)
630+
631+
### Authorization
632+
633+
[apiv4](../README.md#apiv4)
634+
635+
### HTTP request headers
636+
637+
- **Content-Type**: Not defined
638+
- **Accept**: application/json
639+
640+
### HTTP response details
641+
| Status code | Description | Response headers |
642+
|-------------|-------------|------------------|
643+
**200** | Successfully retrieved | - |
644+
645+
[[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)
646+

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.19.1"
17+
__version__ = "4.19.2"
1818

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

gate_api/api/spot_api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,7 @@ def list_candlesticks_with_http_info(self, currency_pair, **kwargs): # noqa: E5
913913
def get_fee(self, **kwargs): # noqa: E501
914914
"""Query user trading fee rates # noqa: E501
915915
916+
This API is deprecated in favour of new fee retrieving API `/wallet/fee`. # noqa: E501
916917
This method makes a synchronous HTTP request by default. To make an
917918
asynchronous HTTP request, please pass async_req=True
918919
>>> thread = api.get_fee(async_req=True)
@@ -937,6 +938,7 @@ def get_fee(self, **kwargs): # noqa: E501
937938
def get_fee_with_http_info(self, **kwargs): # noqa: E501
938939
"""Query user trading fee rates # noqa: E501
939940
941+
This API is deprecated in favour of new fee retrieving API `/wallet/fee`. # noqa: E501
940942
This method makes a synchronous HTTP request by default. To make an
941943
asynchronous HTTP request, please pass async_req=True
942944
>>> thread = api.get_fee_with_http_info(async_req=True)

gate_api/api/wallet_api.py

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,3 +944,96 @@ def list_sub_account_balances_with_http_info(self, **kwargs): # noqa: E501
944944
_request_timeout=local_var_params.get('_request_timeout'),
945945
collection_formats=collection_formats,
946946
)
947+
948+
def get_trade_fee(self, **kwargs): # noqa: E501
949+
"""Retrieve personal trading fee # noqa: E501
950+
951+
This method makes a synchronous HTTP request by default. To make an
952+
asynchronous HTTP request, please pass async_req=True
953+
>>> thread = api.get_trade_fee(async_req=True)
954+
>>> result = thread.get()
955+
956+
:param bool async_req: execute request asynchronously
957+
:param _preload_content: if False, the urllib3.HTTPResponse object will
958+
be returned without reading/decoding response
959+
data. Default is True.
960+
:param _request_timeout: timeout setting for this request. If one
961+
number provided, it will be total request
962+
timeout. It can also be a pair (tuple) of
963+
(connection, read) timeouts.
964+
:rtype: gate_api.TradeFee
965+
:return: If the method is called asynchronously,
966+
returns the request thread.
967+
"""
968+
kwargs['_return_http_data_only'] = True
969+
return self.get_trade_fee_with_http_info(**kwargs) # noqa: E501
970+
971+
def get_trade_fee_with_http_info(self, **kwargs): # noqa: E501
972+
"""Retrieve personal trading fee # noqa: E501
973+
974+
This method makes a synchronous HTTP request by default. To make an
975+
asynchronous HTTP request, please pass async_req=True
976+
>>> thread = api.get_trade_fee_with_http_info(async_req=True)
977+
>>> result = thread.get()
978+
979+
:param bool async_req: execute request asynchronously
980+
:param _return_http_data_only: response data without head status code
981+
and headers
982+
:param _preload_content: if False, the urllib3.HTTPResponse object will
983+
be returned without reading/decoding response
984+
data. Default is True.
985+
:param _request_timeout: timeout setting for this request. If one
986+
number provided, it will be total request
987+
timeout. It can also be a pair (tuple) of
988+
(connection, read) timeouts.
989+
:rtype: tuple(gate_api.TradeFee, status_code(int), headers(HTTPHeaderDict))
990+
:return: If the method is called asynchronously,
991+
returns the request thread.
992+
"""
993+
994+
local_var_params = locals()
995+
996+
all_params = []
997+
all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
998+
999+
for k, v in six.iteritems(local_var_params['kwargs']):
1000+
if k not in all_params:
1001+
raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_trade_fee" % k)
1002+
local_var_params[k] = v
1003+
del local_var_params['kwargs']
1004+
1005+
collection_formats = {}
1006+
1007+
path_params = {}
1008+
1009+
query_params = []
1010+
1011+
header_params = {}
1012+
1013+
form_params = []
1014+
local_var_files = {}
1015+
1016+
body_params = None
1017+
# HTTP header `Accept`
1018+
header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
1019+
1020+
# Authentication setting
1021+
auth_settings = ['apiv4'] # noqa: E501
1022+
1023+
return self.api_client.call_api(
1024+
'/wallet/fee',
1025+
'GET',
1026+
path_params,
1027+
query_params,
1028+
header_params,
1029+
body=body_params,
1030+
post_params=form_params,
1031+
files=local_var_files,
1032+
response_type='TradeFee', # noqa: E501
1033+
auth_settings=auth_settings,
1034+
async_req=local_var_params.get('async_req'),
1035+
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
1036+
_preload_content=local_var_params.get('_preload_content', True),
1037+
_request_timeout=local_var_params.get('_request_timeout'),
1038+
collection_formats=collection_formats,
1039+
)

gate_api/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, cook
8282
self.default_headers[header_name] = header_value
8383
self.cookie = cookie
8484
# Set default User-Agent.
85-
self.user_agent = 'OpenAPI-Generator/4.19.1/python'
85+
self.user_agent = 'OpenAPI-Generator/4.19.2/python'
8686
self.client_side_validation = configuration.client_side_validation
8787

8888
def __enter__(self):

0 commit comments

Comments
 (0)