Skip to content

Commit 98884bc

Browse files
committed
release 4.42.0 with uni loans supports
1 parent 612b74b commit 98884bc

59 files changed

Lines changed: 7047 additions & 58 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 37 additions & 15 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.40.0
9-
- Package version: 4.40.0
8+
- API version: 4.42.0
9+
- Package version: 4.42.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

@@ -78,31 +78,23 @@ from gate_api.exceptions import ApiException, GateApiException
7878

7979
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
8080
# See configuration.py for a list of all supported configuration parameters.
81-
# The client must configure the authentication and authorization parameters
82-
# in accordance with the API server security policy.
83-
# Examples for each auth method are provided below, use the example that
84-
# satisfies your auth use case.
85-
86-
# Configure APIv4 key authorization
8781
configuration = gate_api.Configuration(
88-
host = "https://api.gateio.ws/api/v4",
89-
key = "YOU_API_KEY",
90-
secret = "YOUR_API_SECRET"
82+
host = "https://api.gateio.ws/api/v4"
9183
)
9284

9385

9486
api_client = gate_api.ApiClient(configuration)
9587
# Create an instance of the API class
96-
api_instance = gate_api.SubAccountApi(api_client)
88+
api_instance = gate_api.EarnUniApi(api_client)
9789

9890
try:
99-
# List sub-accounts
100-
api_response = api_instance.list_sub_accounts()
91+
# List currencies for lending
92+
api_response = api_instance.list_uni_currencies()
10193
print(api_response)
10294
except GateApiException as ex:
10395
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
10496
except ApiException as e:
105-
print("Exception when calling SubAccountApi->list_sub_accounts: %s\n" % e)
97+
print("Exception when calling EarnUniApi->list_uni_currencies: %s\n" % e)
10698

10799
```
108100

@@ -114,6 +106,21 @@ All URIs are relative to *https://api.gateio.ws/api/v4*
114106

115107
Class | Method | HTTP request | Description
116108
------------ | ------------- | ------------- | -------------
109+
*EarnUniApi* | [**list_uni_currencies**](docs/EarnUniApi.md#list_uni_currencies) | **GET** /earn/uni/currencies | List currencies for lending
110+
*EarnUniApi* | [**get_uni_currency**](docs/EarnUniApi.md#get_uni_currency) | **GET** /earn/uni/currencies/{currency} | Get currency detail for lending
111+
*EarnUniApi* | [**list_user_uni_lends**](docs/EarnUniApi.md#list_user_uni_lends) | **GET** /earn/uni/lends | List user's lending orders
112+
*EarnUniApi* | [**create_uni_lend**](docs/EarnUniApi.md#create_uni_lend) | **POST** /earn/uni/lends | Lend or redeem
113+
*EarnUniApi* | [**change_uni_lend**](docs/EarnUniApi.md#change_uni_lend) | **PATCH** /earn/uni/lends | Amend lending order
114+
*EarnUniApi* | [**list_uni_lend_records**](docs/EarnUniApi.md#list_uni_lend_records) | **GET** /earn/uni/lend_records | List records of lending
115+
*EarnUniApi* | [**get_uni_interest**](docs/EarnUniApi.md#get_uni_interest) | **GET** /earn/uni/interests/{currency} | Get the user's total interest income of specified currency
116+
*EarnUniApi* | [**list_uni_interest_records**](docs/EarnUniApi.md#list_uni_interest_records) | **GET** /earn/uni/interest_records | List interest records
117+
*MarginUniApi* | [**list_uni_currency_pairs**](docs/MarginUniApi.md#list_uni_currency_pairs) | **GET** /margin/uni/currency_pairs | List lending markets
118+
*MarginUniApi* | [**get_uni_currency_pair**](docs/MarginUniApi.md#get_uni_currency_pair) | **GET** /margin/uni/currency_pairs/{currency_pair} | Get detail of lending market
119+
*MarginUniApi* | [**list_uni_loans**](docs/MarginUniApi.md#list_uni_loans) | **GET** /margin/uni/loans | List loans
120+
*MarginUniApi* | [**create_uni_loan**](docs/MarginUniApi.md#create_uni_loan) | **POST** /margin/uni/loans | Borrow or repay
121+
*MarginUniApi* | [**list_uni_loan_records**](docs/MarginUniApi.md#list_uni_loan_records) | **GET** /margin/uni/loan_records | Get load records
122+
*MarginUniApi* | [**list_uni_loan_interest_records**](docs/MarginUniApi.md#list_uni_loan_interest_records) | **GET** /margin/uni/interest_records | List interest records
123+
*MarginUniApi* | [**get_uni_borrowable**](docs/MarginUniApi.md#get_uni_borrowable) | **GET** /margin/uni/borrowable | Get maximum borrowable
117124
*SubAccountApi* | [**list_sub_accounts**](docs/SubAccountApi.md#list_sub_accounts) | **GET** /sub_accounts | List sub-accounts
118125
*SubAccountApi* | [**create_sub_accounts**](docs/SubAccountApi.md#create_sub_accounts) | **POST** /sub_accounts | Create a new sub-account
119126
*SubAccountApi* | [**get_sub_account**](docs/SubAccountApi.md#get_sub_account) | **GET** /sub_accounts/{user_id} | Get the sub-account
@@ -323,9 +330,12 @@ Class | Method | HTTP request | Description
323330
- [ContractStat](docs/ContractStat.md)
324331
- [CountdownCancelAllFuturesTask](docs/CountdownCancelAllFuturesTask.md)
325332
- [CountdownCancelAllSpotTask](docs/CountdownCancelAllSpotTask.md)
333+
- [CreateUniLend](docs/CreateUniLend.md)
334+
- [CreateUniLoan](docs/CreateUniLoan.md)
326335
- [CrossMarginAccount](docs/CrossMarginAccount.md)
327336
- [CrossMarginAccountBook](docs/CrossMarginAccountBook.md)
328337
- [CrossMarginBalance](docs/CrossMarginBalance.md)
338+
- [CrossMarginBalance1](docs/CrossMarginBalance1.md)
329339
- [CrossMarginBorrowable](docs/CrossMarginBorrowable.md)
330340
- [CrossMarginCurrency](docs/CrossMarginCurrency.md)
331341
- [CrossMarginLoan](docs/CrossMarginLoan.md)
@@ -375,8 +385,10 @@ Class | Method | HTTP request | Description
375385
- [MarginBorrowable](docs/MarginBorrowable.md)
376386
- [MarginCurrencyPair](docs/MarginCurrencyPair.md)
377387
- [MarginTransferable](docs/MarginTransferable.md)
388+
- [MaxUniBorrowable](docs/MaxUniBorrowable.md)
378389
- [MultiChainAddressItem](docs/MultiChainAddressItem.md)
379390
- [MyFuturesTrade](docs/MyFuturesTrade.md)
391+
- [MyFuturesTradeTimeRange](docs/MyFuturesTradeTimeRange.md)
380392
- [OpenOrders](docs/OpenOrders.md)
381393
- [OptionsAccount](docs/OptionsAccount.md)
382394
- [OptionsAccountBook](docs/OptionsAccountBook.md)
@@ -395,6 +407,7 @@ Class | Method | HTTP request | Description
395407
- [Order](docs/Order.md)
396408
- [OrderBook](docs/OrderBook.md)
397409
- [OrderPatch](docs/OrderPatch.md)
410+
- [PatchUniLend](docs/PatchUniLend.md)
398411
- [Position](docs/Position.md)
399412
- [PositionClose](docs/PositionClose.md)
400413
- [PositionCloseOrder](docs/PositionCloseOrder.md)
@@ -424,6 +437,15 @@ Class | Method | HTTP request | Description
424437
- [Transfer](docs/Transfer.md)
425438
- [TriggerOrderResponse](docs/TriggerOrderResponse.md)
426439
- [TriggerTime](docs/TriggerTime.md)
440+
- [UniCurrency](docs/UniCurrency.md)
441+
- [UniCurrencyPair](docs/UniCurrencyPair.md)
442+
- [UniInterestRecord](docs/UniInterestRecord.md)
443+
- [UniLend](docs/UniLend.md)
444+
- [UniLendInterest](docs/UniLendInterest.md)
445+
- [UniLendRecord](docs/UniLendRecord.md)
446+
- [UniLoan](docs/UniLoan.md)
447+
- [UniLoanInterestRecord](docs/UniLoanInterestRecord.md)
448+
- [UniLoanRecord](docs/UniLoanRecord.md)
427449
- [WithdrawStatus](docs/WithdrawStatus.md)
428450

429451

docs/Contract.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Name | Type | Description | Notes
3838
**orders_limit** | **int** | Maximum number of open orders | [optional]
3939
**enable_bonus** | **bool** | Whether bouns is enabled | [optional]
4040
**enable_credit** | **bool** | Whether portfolio margin account is enabled | [optional]
41+
**create_time** | **float** | Created time of the contract | [optional]
4142

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

docs/CreateUniLend.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# CreateUniLend
2+
3+
Lend or redeem
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**currency** | **str** | Currency name |
8+
**amount** | **str** | The amount of currency could be lent |
9+
**type** | **str** | type: lend - lend, redeem - redeem |
10+
**min_rate** | **str** | The minimum interest rate. If the value is too high, it might lead to the unsuccessful lending and no profit will be gained for that hour. | [optional]
11+
12+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
13+
14+

docs/CreateUniLoan.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# CreateUniLoan
2+
3+
Borrow or repay
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**currency** | **str** | Currency |
8+
**type** | **str** | type: borrow - borrow, repay - repay |
9+
**amount** | **str** | The amount of lending or repaying |
10+
**repaid_all** | **bool** | Full repayment. Repay operation only. If the value is `true`, the amount will be ignored and the loan will be repaid in full. | [optional]
11+
**currency_pair** | **str** | Currency pair |
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/CrossMarginAccount.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ Name | Type | Description | Notes
1111
**interest** | **str** | Total unpaid interests in USDT, i.e., the sum of all currencies' `interest*price*discount` | [optional]
1212
**risk** | **str** | Risk rate. When it belows 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+interest)` | [optional]
1313
**total_initial_margin** | **str** | Total initial margin | [optional]
14-
**total_margin_balance** | **str** | Total margin balance | [optional]
14+
**total_margin_balance** | **str** | Total Margin Balance (∑(positive equity * index price * discount) + ∑(negative equity * index price)) | [optional]
1515
**total_maintenance_margin** | **str** | Total maintenance margin | [optional]
1616
**total_initial_margin_rate** | **str** | Total initial margin rate | [optional]
1717
**total_maintenance_margin_rate** | **str** | Total maintenance margin rate | [optional]
1818
**total_available_margin** | **str** | Total available margin | [optional]
1919
**portfolio_margin_total** | **str** | Total amount of the portfolio margin account | [optional]
20+
**portfolio_margin_total_liab** | **str** | Total liabilities of the portfolio margin account | [optional]
21+
**portfolio_margin_total_equity** | **str** | Total equity of the portfolio margin account | [optional]
2022

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

docs/CrossMarginBalance.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ Name | Type | Description | Notes
77
**freeze** | **str** | Locked amount | [optional]
88
**borrowed** | **str** | Borrowed amount | [optional]
99
**interest** | **str** | Unpaid interests | [optional]
10+
**negative_liab** | **str** | Negative Liabilities | [optional]
11+
**futures_pos_liab** | **str** | Borrowing to Open Positions in Futures | [optional]
12+
**equity** | **str** | Equity | [optional]
13+
**total_freeze** | **str** | Total occupied | [optional]
14+
**total_liab** | **str** | Total liabilities | [optional]
1015

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

docs/CrossMarginBalance1.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# CrossMarginBalance1
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**available** | **str** | Available amount | [optional]
7+
**freeze** | **str** | Locked amount | [optional]
8+
**borrowed** | **str** | Borrowed amount | [optional]
9+
**interest** | **str** | Unpaid interests | [optional]
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+
13+

0 commit comments

Comments
 (0)