Skip to content

Commit 92e2d84

Browse files
committed
add transfer id and sub account cross margin balances
1 parent 4e7bd82 commit 92e2d84

22 files changed

Lines changed: 1569 additions & 28 deletions

README.md

Lines changed: 8 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.25.1
9-
- Package version: 4.25.1
8+
- API version: 4.26.0
9+
- Package version: 4.26.0
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

@@ -270,6 +270,8 @@ Class | Method | HTTP request | Description
270270
*WalletApi* | [**list_sub_account_balances**](docs/WalletApi.md#list_sub_account_balances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances
271271
*WalletApi* | [**list_sub_account_margin_balances**](docs/WalletApi.md#list_sub_account_margin_balances) | **GET** /wallet/sub_account_margin_balances | Query sub accounts' margin balances
272272
*WalletApi* | [**list_sub_account_futures_balances**](docs/WalletApi.md#list_sub_account_futures_balances) | **GET** /wallet/sub_account_futures_balances | Query sub accounts' futures account balances
273+
*WalletApi* | [**list_sub_account_cross_margin_balances**](docs/WalletApi.md#list_sub_account_cross_margin_balances) | **GET** /wallet/sub_account_cross_margin_balances | Query subaccount's cross_margin account info
274+
*WalletApi* | [**list_saved_address**](docs/WalletApi.md#list_saved_address) | **GET** /wallet/saved_address | Query saved address
273275
*WalletApi* | [**get_trade_fee**](docs/WalletApi.md#get_trade_fee) | **GET** /wallet/fee | Retrieve personal trading fee
274276
*WalletApi* | [**get_total_balance**](docs/WalletApi.md#get_total_balance) | **GET** /wallet/total_balance | Retrieve user's total balances
275277
*WithdrawalApi* | [**withdraw**](docs/WithdrawalApi.md#withdraw) | **POST** /withdrawals | Withdraw
@@ -357,19 +359,23 @@ Class | Method | HTTP request | Description
357359
- [PositionCloseOrder](docs/PositionCloseOrder.md)
358360
- [RepayRequest](docs/RepayRequest.md)
359361
- [Repayment](docs/Repayment.md)
362+
- [SavedAddress](docs/SavedAddress.md)
360363
- [SpotAccount](docs/SpotAccount.md)
361364
- [SpotPricePutOrder](docs/SpotPricePutOrder.md)
362365
- [SpotPriceTrigger](docs/SpotPriceTrigger.md)
363366
- [SpotPriceTriggeredOrder](docs/SpotPriceTriggeredOrder.md)
364367
- [SubAccountBalance](docs/SubAccountBalance.md)
368+
- [SubAccountCrossMarginBalance](docs/SubAccountCrossMarginBalance.md)
365369
- [SubAccountFuturesBalance](docs/SubAccountFuturesBalance.md)
366370
- [SubAccountMarginBalance](docs/SubAccountMarginBalance.md)
367371
- [SubAccountTransfer](docs/SubAccountTransfer.md)
372+
- [SubCrossMarginAccount](docs/SubCrossMarginAccount.md)
368373
- [SystemTime](docs/SystemTime.md)
369374
- [Ticker](docs/Ticker.md)
370375
- [TotalBalance](docs/TotalBalance.md)
371376
- [Trade](docs/Trade.md)
372377
- [TradeFee](docs/TradeFee.md)
378+
- [TransactionID](docs/TransactionID.md)
373379
- [Transfer](docs/Transfer.md)
374380
- [TriggerOrderResponse](docs/TriggerOrderResponse.md)
375381
- [WithdrawStatus](docs/WithdrawStatus.md)

docs/MarginCurrencyPair.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
1010
**min_base_amount** | **str** | Minimum base currency to loan, `null` means no limit | [optional]
1111
**min_quote_amount** | **str** | Minimum quote currency to loan, `null` means no limit | [optional]
1212
**max_quote_amount** | **str** | Maximum borrowable amount for quote currency. Base currency limit is calculated by quote maximum and market price. `null` means no limit | [optional]
13+
**status** | **int** | Currency pair status - `0`: disabled - `1`: enabled | [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/SavedAddress.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SavedAddress
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**currency** | **str** | Currency | [optional]
7+
**chain** | **str** | Chain name | [optional]
8+
**address** | **str** | Address | [optional]
9+
**name** | **str** | Name | [optional]
10+
**tag** | **str** | Tag | [optional]
11+
**verified** | **str** | Whether to pass the verification 0-unverified, 1-verified | [optional]
12+
13+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
14+
15+

docs/SpotApi.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@ api_client = gate_api.ApiClient(configuration)
14791479
api_instance = gate_api.SpotApi(api_client)
14801480
status = 'status_example' # str | Only list the orders with this status
14811481
market = 'BTC_USDT' # str | Currency pair (optional)
1482-
account = 'account_example' # str | Trading account (optional)
1482+
account = 'account_example' # str | Trading account type. Portfolio margin account must set to `cross_margin` (optional)
14831483
limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100)
14841484
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)
14851485

@@ -1499,7 +1499,7 @@ Name | Type | Description | Notes
14991499
------------- | ------------- | ------------- | -------------
15001500
**status** | **str**| Only list the orders with this status |
15011501
**market** | **str**| Currency pair | [optional]
1502-
**account** | **str**| Trading account | [optional]
1502+
**account** | **str**| Trading account type. Portfolio margin account must set to `cross_margin` | [optional]
15031503
**limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100]
15041504
**offset** | **int**| List offset, starting from 0 | [optional] [default to 0]
15051505

@@ -1620,7 +1620,7 @@ api_client = gate_api.ApiClient(configuration)
16201620
# Create an instance of the API class
16211621
api_instance = gate_api.SpotApi(api_client)
16221622
market = 'BTC_USDT' # str | Currency pair (optional)
1623-
account = 'account_example' # str | Trading account (optional)
1623+
account = 'account_example' # str | Trading account type. Portfolio margin account must set to `cross_margin` (optional)
16241624

16251625
try:
16261626
# Cancel all open orders
@@ -1637,7 +1637,7 @@ except ApiException as e:
16371637
Name | Type | Description | Notes
16381638
------------- | ------------- | ------------- | -------------
16391639
**market** | **str**| Currency pair | [optional]
1640-
**account** | **str**| Trading account | [optional]
1640+
**account** | **str**| Trading account type. Portfolio margin account must set to `cross_margin` | [optional]
16411641

16421642
### Return type
16431643

docs/SpotPricePutOrder.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
77
**side** | **str** | Order side - buy: buy side - sell: sell side |
88
**price** | **str** | Order price |
99
**amount** | **str** | Order amount |
10-
**account** | **str** | Trading type - normal: spot trading - margin: margin trading | [default to 'normal']
10+
**account** | **str** | Trading account type. Portfolio margin account must set to `cross_margin` - normal: spot trading - margin: margin trading - cross_margin: cross_margin trading | [default to 'normal']
1111
**time_in_force** | **str** | time_in_force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only | [optional] [default to 'gtc']
1212

1313
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SubAccountCrossMarginBalance
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**uid** | **str** | User ID | [optional]
7+
**available** | [**SubCrossMarginAccount**](.md) | 账户余额信息 | [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/SubCrossMarginAccount.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SubCrossMarginAccount
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**user_id** | **int** | User ID of the cross margin account. 0 means that the subaccount has not yet opened a cross margin account | [optional]
7+
**locked** | **bool** | Whether account is locked | [optional]
8+
**balances** | [**dict(str, CrossMarginBalance)**](CrossMarginBalance.md) | | [optional]
9+
**total** | **str** | Total account value in USDT, i.e., the sum of all currencies' `(available+freeze)*price*discount` | [optional]
10+
**borrowed** | **str** | Total borrowed value in USDT, i.e., the sum of all currencies' `borrowed*price*discount` | [optional]
11+
**borrowed_net** | **str** | Total borrowed value in USDT * borrowed factor | [optional]
12+
**net** | **str** | Total net assets in USDT | [optional]
13+
**leverage** | **str** | Position leverage | [optional]
14+
**interest** | **str** | Total unpaid interests in USDT, i.e., the sum of all currencies' `interest*price*discount` | [optional]
15+
**risk** | **str** | Risk rate. When it belows 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+interest)` | [optional]
16+
**total_initial_margin** | **str** | Total initial margin | [optional]
17+
**total_margin_balance** | **str** | Total margin balance | [optional]
18+
**total_maintenance_margin** | **str** | Total maintenance margin | [optional]
19+
**total_initial_margin_rate** | **str** | Total initial margin rate | [optional]
20+
**total_maintenance_margin_rate** | **str** | Total maintenance margin rate | [optional]
21+
**total_available_margin** | **str** | Total available margin | [optional]
22+
23+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
24+
25+

docs/TransactionID.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# TransactionID
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**tx_id** | **int** | Order id | [optional]
7+
8+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
9+
10+

docs/WalletApi.md

Lines changed: 146 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Method | HTTP request | Description
1515
[**list_sub_account_balances**](WalletApi.md#list_sub_account_balances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances
1616
[**list_sub_account_margin_balances**](WalletApi.md#list_sub_account_margin_balances) | **GET** /wallet/sub_account_margin_balances | Query sub accounts' margin balances
1717
[**list_sub_account_futures_balances**](WalletApi.md#list_sub_account_futures_balances) | **GET** /wallet/sub_account_futures_balances | Query sub accounts' futures account balances
18+
[**list_sub_account_cross_margin_balances**](WalletApi.md#list_sub_account_cross_margin_balances) | **GET** /wallet/sub_account_cross_margin_balances | Query subaccount's cross_margin account info
19+
[**list_saved_address**](WalletApi.md#list_saved_address) | **GET** /wallet/saved_address | Query saved address
1820
[**get_trade_fee**](WalletApi.md#get_trade_fee) | **GET** /wallet/fee | Retrieve personal trading fee
1921
[**get_total_balance**](WalletApi.md#get_total_balance) | **GET** /wallet/total_balance | Retrieve user's total balances
2022

@@ -299,7 +301,7 @@ Name | Type | Description | Notes
299301
[[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)
300302

301303
# **transfer**
302-
> transfer(transfer)
304+
> TransactionID transfer(transfer)
303305
304306
Transfer between trading accounts
305307

@@ -333,7 +335,8 @@ transfer = gate_api.Transfer() # Transfer |
333335

334336
try:
335337
# Transfer between trading accounts
336-
api_instance.transfer(transfer)
338+
api_response = api_instance.transfer(transfer)
339+
print(api_response)
337340
except GateApiException as ex:
338341
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
339342
except ApiException as e:
@@ -348,7 +351,7 @@ Name | Type | Description | Notes
348351

349352
### Return type
350353

351-
void (empty response body)
354+
[**TransactionID**](TransactionID.md)
352355

353356
### Authorization
354357

@@ -357,12 +360,12 @@ void (empty response body)
357360
### HTTP request headers
358361

359362
- **Content-Type**: application/json
360-
- **Accept**: Not defined
363+
- **Accept**: application/json
361364

362365
### HTTP response details
363366
| Status code | Description | Response headers |
364367
|-------------|-------------|------------------|
365-
**204** | Balance transferred | - |
368+
**200** | Balance transferred | - |
366369

367370
[[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)
368371

@@ -781,6 +784,144 @@ Name | Type | Description | Notes
781784

782785
[[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)
783786

787+
# **list_sub_account_cross_margin_balances**
788+
> list[SubAccountCrossMarginBalance] list_sub_account_cross_margin_balances(sub_uid=sub_uid)
789+
790+
Query subaccount's cross_margin account info
791+
792+
### Example
793+
794+
* Api Key Authentication (apiv4):
795+
```python
796+
from __future__ import print_function
797+
import gate_api
798+
from gate_api.exceptions import ApiException, GateApiException
799+
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
800+
# See configuration.py for a list of all supported configuration parameters.
801+
# The client must configure the authentication and authorization parameters
802+
# in accordance with the API server security policy.
803+
# Examples for each auth method are provided below, use the example that
804+
# satisfies your auth use case.
805+
806+
# Configure APIv4 key authorization
807+
configuration = gate_api.Configuration(
808+
host = "https://api.gateio.ws/api/v4",
809+
key = "YOU_API_KEY",
810+
secret = "YOUR_API_SECRET"
811+
)
812+
813+
api_client = gate_api.ApiClient(configuration)
814+
# Create an instance of the API class
815+
api_instance = gate_api.WalletApi(api_client)
816+
sub_uid = '10003' # str | Sub account user ID. Return records related to all sub accounts if not specified (optional)
817+
818+
try:
819+
# Query subaccount's cross_margin account info
820+
api_response = api_instance.list_sub_account_cross_margin_balances(sub_uid=sub_uid)
821+
print(api_response)
822+
except GateApiException as ex:
823+
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
824+
except ApiException as e:
825+
print("Exception when calling WalletApi->list_sub_account_cross_margin_balances: %s\n" % e)
826+
```
827+
828+
### Parameters
829+
830+
Name | Type | Description | Notes
831+
------------- | ------------- | ------------- | -------------
832+
**sub_uid** | **str**| Sub account user ID. Return records related to all sub accounts if not specified | [optional]
833+
834+
### Return type
835+
836+
[**list[SubAccountCrossMarginBalance]**](SubAccountCrossMarginBalance.md)
837+
838+
### Authorization
839+
840+
[apiv4](../README.md#apiv4)
841+
842+
### HTTP request headers
843+
844+
- **Content-Type**: Not defined
845+
- **Accept**: application/json
846+
847+
### HTTP response details
848+
| Status code | Description | Response headers |
849+
|-------------|-------------|------------------|
850+
**200** | List retrieved | - |
851+
852+
[[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)
853+
854+
# **list_saved_address**
855+
> list[SavedAddress] list_saved_address(currency, chain=chain, limit=limit)
856+
857+
Query saved address
858+
859+
### Example
860+
861+
* Api Key Authentication (apiv4):
862+
```python
863+
from __future__ import print_function
864+
import gate_api
865+
from gate_api.exceptions import ApiException, GateApiException
866+
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
867+
# See configuration.py for a list of all supported configuration parameters.
868+
# The client must configure the authentication and authorization parameters
869+
# in accordance with the API server security policy.
870+
# Examples for each auth method are provided below, use the example that
871+
# satisfies your auth use case.
872+
873+
# Configure APIv4 key authorization
874+
configuration = gate_api.Configuration(
875+
host = "https://api.gateio.ws/api/v4",
876+
key = "YOU_API_KEY",
877+
secret = "YOUR_API_SECRET"
878+
)
879+
880+
api_client = gate_api.ApiClient(configuration)
881+
# Create an instance of the API class
882+
api_instance = gate_api.WalletApi(api_client)
883+
currency = 'USDT' # str | Currency
884+
chain = '' # str | Chain name (optional) (default to '')
885+
limit = '50' # str | Maximum number returned, 100 at most (optional) (default to '50')
886+
887+
try:
888+
# Query saved address
889+
api_response = api_instance.list_saved_address(currency, chain=chain, limit=limit)
890+
print(api_response)
891+
except GateApiException as ex:
892+
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
893+
except ApiException as e:
894+
print("Exception when calling WalletApi->list_saved_address: %s\n" % e)
895+
```
896+
897+
### Parameters
898+
899+
Name | Type | Description | Notes
900+
------------- | ------------- | ------------- | -------------
901+
**currency** | **str**| Currency |
902+
**chain** | **str**| Chain name | [optional] [default to '']
903+
**limit** | **str**| Maximum number returned, 100 at most | [optional] [default to '50']
904+
905+
### Return type
906+
907+
[**list[SavedAddress]**](SavedAddress.md)
908+
909+
### Authorization
910+
911+
[apiv4](../README.md#apiv4)
912+
913+
### HTTP request headers
914+
915+
- **Content-Type**: Not defined
916+
- **Accept**: application/json
917+
918+
### HTTP response details
919+
| Status code | Description | Response headers |
920+
|-------------|-------------|------------------|
921+
**200** | List retrieved | - |
922+
923+
[[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)
924+
784925
# **get_trade_fee**
785926
> TradeFee get_trade_fee(currency_pair=currency_pair)
786927

gate_api/__init__.py

Lines changed: 5 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.25.1"
17+
__version__ = "4.26.0"
1818

1919
# import apis into sdk package
2020
from gate_api.api.delivery_api import DeliveryApi
@@ -115,19 +115,23 @@
115115
from gate_api.models.position_close_order import PositionCloseOrder
116116
from gate_api.models.repay_request import RepayRequest
117117
from gate_api.models.repayment import Repayment
118+
from gate_api.models.saved_address import SavedAddress
118119
from gate_api.models.spot_account import SpotAccount
119120
from gate_api.models.spot_price_put_order import SpotPricePutOrder
120121
from gate_api.models.spot_price_trigger import SpotPriceTrigger
121122
from gate_api.models.spot_price_triggered_order import SpotPriceTriggeredOrder
122123
from gate_api.models.sub_account_balance import SubAccountBalance
124+
from gate_api.models.sub_account_cross_margin_balance import SubAccountCrossMarginBalance
123125
from gate_api.models.sub_account_futures_balance import SubAccountFuturesBalance
124126
from gate_api.models.sub_account_margin_balance import SubAccountMarginBalance
125127
from gate_api.models.sub_account_transfer import SubAccountTransfer
128+
from gate_api.models.sub_cross_margin_account import SubCrossMarginAccount
126129
from gate_api.models.system_time import SystemTime
127130
from gate_api.models.ticker import Ticker
128131
from gate_api.models.total_balance import TotalBalance
129132
from gate_api.models.trade import Trade
130133
from gate_api.models.trade_fee import TradeFee
134+
from gate_api.models.transaction_id import TransactionID
131135
from gate_api.models.transfer import Transfer
132136
from gate_api.models.trigger_order_response import TriggerOrderResponse
133137
from gate_api.models.withdraw_status import WithdrawStatus

0 commit comments

Comments
 (0)