Skip to content

Commit 9b912f3

Browse files
committed
add margin, spot, futures price order API
1 parent 80c9fdf commit 9b912f3

69 files changed

Lines changed: 10882 additions & 56 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: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# gate-api
2-
APIv4 futures provides all sorts of futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.
2+
APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.
33

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

6-
- API version: 1.3.0
7-
- Package version: 1.3.0
6+
- API version: 4.5.0
7+
- Package version: 4.5.0
88
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
99
For more information, please visit [https://gate.io/page/contacts](https://gate.io/page/contacts)
1010

@@ -71,17 +71,21 @@ except ApiException as e:
7171

7272
## Documentation for API Endpoints
7373

74-
All URIs are relative to *https://fx-api.gateio.ws/api/v4*
74+
All URIs are relative to *https://api.gateio.ws/api/v4*
7575

7676
Class | Method | HTTP request | Description
7777
------------ | ------------- | ------------- | -------------
7878
*FuturesApi* | [**cancel_order**](docs/FuturesApi.md#cancel_order) | **DELETE** /futures/orders/{order_id} | Cancel a single order
7979
*FuturesApi* | [**cancel_orders**](docs/FuturesApi.md#cancel_orders) | **DELETE** /futures/orders | Cancel all `open` orders matched
80+
*FuturesApi* | [**cancel_price_triggered_order**](docs/FuturesApi.md#cancel_price_triggered_order) | **DELETE** /futures/price_orders/{order_id} | Cancel a single order
81+
*FuturesApi* | [**cancel_price_triggered_order_list**](docs/FuturesApi.md#cancel_price_triggered_order_list) | **DELETE** /futures/price_orders | Cancel all open orders
8082
*FuturesApi* | [**create_order**](docs/FuturesApi.md#create_order) | **POST** /futures/orders | Create a futures order
83+
*FuturesApi* | [**create_price_triggered_order**](docs/FuturesApi.md#create_price_triggered_order) | **POST** /futures/price_orders | Create a price-triggered order
8184
*FuturesApi* | [**get_futures_contract**](docs/FuturesApi.md#get_futures_contract) | **GET** /futures/contracts/{contract} | Get a single contract
8285
*FuturesApi* | [**get_my_trades**](docs/FuturesApi.md#get_my_trades) | **GET** /futures/my_trades | List personal trading history
8386
*FuturesApi* | [**get_order**](docs/FuturesApi.md#get_order) | **GET** /futures/orders/{order_id} | Get a single order
8487
*FuturesApi* | [**get_position**](docs/FuturesApi.md#get_position) | **GET** /futures/positions/{contract} | Get single position
88+
*FuturesApi* | [**get_price_triggered_order**](docs/FuturesApi.md#get_price_triggered_order) | **GET** /futures/price_orders/{order_id} | Get a single order
8589
*FuturesApi* | [**list_futures_account_book**](docs/FuturesApi.md#list_futures_account_book) | **GET** /futures/account_book | Query account book
8690
*FuturesApi* | [**list_futures_accounts**](docs/FuturesApi.md#list_futures_accounts) | **GET** /futures/accounts | Query futures account
8791
*FuturesApi* | [**list_futures_candlesticks**](docs/FuturesApi.md#list_futures_candlesticks) | **GET** /futures/candlesticks | Get futures candlesticks
@@ -94,28 +98,77 @@ Class | Method | HTTP request | Description
9498
*FuturesApi* | [**list_orders**](docs/FuturesApi.md#list_orders) | **GET** /futures/orders | List futures orders
9599
*FuturesApi* | [**list_position_close**](docs/FuturesApi.md#list_position_close) | **GET** /futures/position_close | List position close history
96100
*FuturesApi* | [**list_positions**](docs/FuturesApi.md#list_positions) | **GET** /futures/positions | List all positions of a user
101+
*FuturesApi* | [**list_price_triggered_orders**](docs/FuturesApi.md#list_price_triggered_orders) | **GET** /futures/price_orders | List all auto orders
97102
*FuturesApi* | [**update_position_leverage**](docs/FuturesApi.md#update_position_leverage) | **POST** /futures/positions/{contract}/leverage | Update position leverage
98103
*FuturesApi* | [**update_position_margin**](docs/FuturesApi.md#update_position_margin) | **POST** /futures/positions/{contract}/margin | Update position margin
99104
*FuturesApi* | [**update_position_risk_limit**](docs/FuturesApi.md#update_position_risk_limit) | **POST** /futures/positions/{contract}/risk_limit | Update position risk limit
105+
*MarginApi* | [**cancel_loan**](docs/MarginApi.md#cancel_loan) | **DELETE** /margin/loans/{loan_id} | Cancel lending loan
106+
*MarginApi* | [**create_loan**](docs/MarginApi.md#create_loan) | **POST** /margin/loans | Lend or borrow
107+
*MarginApi* | [**get_loan**](docs/MarginApi.md#get_loan) | **GET** /margin/loans/{loan_id} | Retrieve one single loan detail
108+
*MarginApi* | [**get_loan_record**](docs/MarginApi.md#get_loan_record) | **GET** /margin/loan_records/{loan_record_id} | Get one single loan record
109+
*MarginApi* | [**list_funding_accounts**](docs/MarginApi.md#list_funding_accounts) | **GET** /margin/funding_accounts | Funding account list
110+
*MarginApi* | [**list_funding_book**](docs/MarginApi.md#list_funding_book) | **GET** /margin/funding_book | Order book of lending loans
111+
*MarginApi* | [**list_loan_records**](docs/MarginApi.md#list_loan_records) | **GET** /margin/loan_records | List repayment records of specified loan
112+
*MarginApi* | [**list_loan_repayments**](docs/MarginApi.md#list_loan_repayments) | **GET** /margin/loans/{loan_id}/repayment | List loan repayment records
113+
*MarginApi* | [**list_loans**](docs/MarginApi.md#list_loans) | **GET** /margin/loans | List all loans
114+
*MarginApi* | [**list_margin_accounts**](docs/MarginApi.md#list_margin_accounts) | **GET** /margin/accounts | Margin account list
115+
*MarginApi* | [**list_margin_currency_pairs**](docs/MarginApi.md#list_margin_currency_pairs) | **GET** /margin/currency_pairs | List all supported currency pairs supported in margin trading
116+
*MarginApi* | [**merge_loans**](docs/MarginApi.md#merge_loans) | **POST** /margin/merged_loans | Merge multiple lending loans
117+
*MarginApi* | [**repay_loan**](docs/MarginApi.md#repay_loan) | **POST** /margin/loans/{loan_id}/repayment | Repay a loan
118+
*MarginApi* | [**update_loan**](docs/MarginApi.md#update_loan) | **PATCH** /margin/loans/{loan_id} | Modify a loan
119+
*MarginApi* | [**update_loan_record**](docs/MarginApi.md#update_loan_record) | **PATCH** /margin/loan_records/{loan_record_id} | Modify a loan record
120+
*SpotApi* | [**cancel_order**](docs/SpotApi.md#cancel_order) | **DELETE** /spot/orders/{order_id} | Cancel a single order
121+
*SpotApi* | [**cancel_orders**](docs/SpotApi.md#cancel_orders) | **DELETE** /spot/orders | Cancel all `open` orders in specified currency pair
122+
*SpotApi* | [**create_order**](docs/SpotApi.md#create_order) | **POST** /spot/orders | Create an order
123+
*SpotApi* | [**get_currency_pair**](docs/SpotApi.md#get_currency_pair) | **GET** /spot/currency_pairs/{currency_pair} | Get detail of one single order
124+
*SpotApi* | [**get_order**](docs/SpotApi.md#get_order) | **GET** /spot/orders/{order_id} | Get a single order
125+
*SpotApi* | [**list_candlesticks**](docs/SpotApi.md#list_candlesticks) | **GET** /spot/candlesticks | Market candlesticks
126+
*SpotApi* | [**list_currency_pairs**](docs/SpotApi.md#list_currency_pairs) | **GET** /spot/currency_pairs | List all currency pairs supported
127+
*SpotApi* | [**list_my_trades**](docs/SpotApi.md#list_my_trades) | **GET** /spot/my_trades | List personal trading history
128+
*SpotApi* | [**list_order_book**](docs/SpotApi.md#list_order_book) | **GET** /spot/order_book | Retrieve order book
129+
*SpotApi* | [**list_orders**](docs/SpotApi.md#list_orders) | **GET** /spot/orders | List futures orders
130+
*SpotApi* | [**list_spot_accounts**](docs/SpotApi.md#list_spot_accounts) | **GET** /spot/accounts | List spot accounts
131+
*SpotApi* | [**list_tickers**](docs/SpotApi.md#list_tickers) | **GET** /spot/tickers | Retrieve ticker information
132+
*SpotApi* | [**list_trades**](docs/SpotApi.md#list_trades) | **GET** /spot/trades | Retrieve market trades
100133

101134

102135
## Documentation For Models
103136

104137
- [Contract](docs/Contract.md)
138+
- [CurrencyPair](docs/CurrencyPair.md)
139+
- [FundingAccount](docs/FundingAccount.md)
140+
- [FundingBookItem](docs/FundingBookItem.md)
105141
- [FundingRateRecord](docs/FundingRateRecord.md)
106142
- [FuturesAccount](docs/FuturesAccount.md)
107143
- [FuturesAccountBook](docs/FuturesAccountBook.md)
108144
- [FuturesCandlestick](docs/FuturesCandlestick.md)
145+
- [FuturesInitialOrder](docs/FuturesInitialOrder.md)
109146
- [FuturesOrder](docs/FuturesOrder.md)
110147
- [FuturesOrderBook](docs/FuturesOrderBook.md)
111148
- [FuturesOrderBookItem](docs/FuturesOrderBookItem.md)
149+
- [FuturesPriceTrigger](docs/FuturesPriceTrigger.md)
150+
- [FuturesPriceTriggeredOrder](docs/FuturesPriceTriggeredOrder.md)
112151
- [FuturesTicker](docs/FuturesTicker.md)
113152
- [FuturesTrade](docs/FuturesTrade.md)
114153
- [InsuranceRecord](docs/InsuranceRecord.md)
154+
- [Loan](docs/Loan.md)
155+
- [LoanPatch](docs/LoanPatch.md)
156+
- [LoanRecord](docs/LoanRecord.md)
157+
- [MarginAccount](docs/MarginAccount.md)
158+
- [MarginAccountCurrency](docs/MarginAccountCurrency.md)
159+
- [MarginCurrencyPair](docs/MarginCurrencyPair.md)
115160
- [MyFuturesTrade](docs/MyFuturesTrade.md)
161+
- [Order](docs/Order.md)
162+
- [OrderBook](docs/OrderBook.md)
116163
- [Position](docs/Position.md)
117164
- [PositionClose](docs/PositionClose.md)
118165
- [PositionCloseOrder](docs/PositionCloseOrder.md)
166+
- [RepayRequest](docs/RepayRequest.md)
167+
- [Repayment](docs/Repayment.md)
168+
- [SpotAccount](docs/SpotAccount.md)
169+
- [Ticker](docs/Ticker.md)
170+
- [Trade](docs/Trade.md)
171+
- [TriggerOrderResponse](docs/TriggerOrderResponse.md)
119172

120173

121174
## Author

docs/CurrencyPair.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# CurrencyPair
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**id** | **str** | Currency pair | [optional]
7+
**base** | **str** | Base currency | [optional]
8+
**quote** | **str** | Quote currency | [optional]
9+
**fee** | **str** | Trading fee | [optional]
10+
**min_base_amount** | **str** | Minimum amount of base currency to trade, `null` means no limit | [optional]
11+
**min_quote_amount** | **str** | Minimum amount of quote currency to trade, `null` means no limit | [optional]
12+
**precision** | **int** | Price scale | [optional]
13+
14+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
15+
16+

docs/FundingAccount.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# FundingAccount
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**currency** | **str** | Currency name | [optional]
7+
**available** | **str** | Available assets to lend, which is identical to spot account `available` | [optional]
8+
**locked** | **str** | Locked amount. i.e. amount in `open` loans | [optional]
9+
**lent** | **str** | Amount that is loaned but not repaid | [optional]
10+
**total_lent** | **str** | Amount used for lending. total_lent = lent + locked | [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/FundingBookItem.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# FundingBookItem
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**rate** | **str** | Loan rate | [optional]
7+
**amount** | **str** | Borrowable amount | [optional]
8+
**days** | **int** | How long the loan should be repaid | [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+

0 commit comments

Comments
 (0)