Skip to content

Commit 05e5e3f

Browse files
committed
add margin, spot, futures price order API
1 parent 0b12657 commit 05e5e3f

81 files changed

Lines changed: 11786 additions & 101 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: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# gate-api
22

33
Gate API v4
4-
- API version: 1.3.0
4+
- API version: 4.5.0
55

6-
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.
6+
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.
77

88
For more information, please visit [https://gate.io/page/contacts](https://gate.io/page/contacts)
99

@@ -40,7 +40,7 @@ Add this dependency to your project's POM:
4040
<dependency>
4141
<groupId>io.gate</groupId>
4242
<artifactId>gate-api</artifactId>
43-
<version>1.3.0</version>
43+
<version>4.5.0</version>
4444
<scope>compile</scope>
4545
</dependency>
4646
```
@@ -50,7 +50,7 @@ Add this dependency to your project's POM:
5050
Add this dependency to your project's build file:
5151

5252
```groovy
53-
compile "io.gate:gate-api:1.3.0"
53+
compile "io.gate:gate-api:4.5.0"
5454
```
5555

5656
### Others
@@ -63,7 +63,7 @@ mvn clean package
6363

6464
Then manually install the following JARs:
6565

66-
* `target/gate-api-1.3.0.jar`
66+
* `target/gate-api-4.5.0.jar`
6767
* `target/lib/*.jar`
6868

6969
## Getting Started
@@ -101,17 +101,21 @@ public class FuturesApiExample {
101101

102102
## Documentation for API Endpoints
103103

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

106106
Class | Method | HTTP request | Description
107107
------------ | ------------- | ------------- | -------------
108108
*FuturesApi* | [**cancelOrder**](docs/FuturesApi.md#cancelOrder) | **DELETE** /futures/orders/{order_id} | Cancel a single order
109109
*FuturesApi* | [**cancelOrders**](docs/FuturesApi.md#cancelOrders) | **DELETE** /futures/orders | Cancel all &#x60;open&#x60; orders matched
110+
*FuturesApi* | [**cancelPriceTriggeredOrder**](docs/FuturesApi.md#cancelPriceTriggeredOrder) | **DELETE** /futures/price_orders/{order_id} | Cancel a single order
111+
*FuturesApi* | [**cancelPriceTriggeredOrderList**](docs/FuturesApi.md#cancelPriceTriggeredOrderList) | **DELETE** /futures/price_orders | Cancel all open orders
110112
*FuturesApi* | [**createOrder**](docs/FuturesApi.md#createOrder) | **POST** /futures/orders | Create a futures order
113+
*FuturesApi* | [**createPriceTriggeredOrder**](docs/FuturesApi.md#createPriceTriggeredOrder) | **POST** /futures/price_orders | Create a price-triggered order
111114
*FuturesApi* | [**getFuturesContract**](docs/FuturesApi.md#getFuturesContract) | **GET** /futures/contracts/{contract} | Get a single contract
112115
*FuturesApi* | [**getMyTrades**](docs/FuturesApi.md#getMyTrades) | **GET** /futures/my_trades | List personal trading history
113116
*FuturesApi* | [**getOrder**](docs/FuturesApi.md#getOrder) | **GET** /futures/orders/{order_id} | Get a single order
114117
*FuturesApi* | [**getPosition**](docs/FuturesApi.md#getPosition) | **GET** /futures/positions/{contract} | Get single position
118+
*FuturesApi* | [**getPriceTriggeredOrder**](docs/FuturesApi.md#getPriceTriggeredOrder) | **GET** /futures/price_orders/{order_id} | Get a single order
115119
*FuturesApi* | [**listFuturesAccountBook**](docs/FuturesApi.md#listFuturesAccountBook) | **GET** /futures/account_book | Query account book
116120
*FuturesApi* | [**listFuturesAccounts**](docs/FuturesApi.md#listFuturesAccounts) | **GET** /futures/accounts | Query futures account
117121
*FuturesApi* | [**listFuturesCandlesticks**](docs/FuturesApi.md#listFuturesCandlesticks) | **GET** /futures/candlesticks | Get futures candlesticks
@@ -124,28 +128,77 @@ Class | Method | HTTP request | Description
124128
*FuturesApi* | [**listOrders**](docs/FuturesApi.md#listOrders) | **GET** /futures/orders | List futures orders
125129
*FuturesApi* | [**listPositionClose**](docs/FuturesApi.md#listPositionClose) | **GET** /futures/position_close | List position close history
126130
*FuturesApi* | [**listPositions**](docs/FuturesApi.md#listPositions) | **GET** /futures/positions | List all positions of a user
131+
*FuturesApi* | [**listPriceTriggeredOrders**](docs/FuturesApi.md#listPriceTriggeredOrders) | **GET** /futures/price_orders | List all auto orders
127132
*FuturesApi* | [**updatePositionLeverage**](docs/FuturesApi.md#updatePositionLeverage) | **POST** /futures/positions/{contract}/leverage | Update position leverage
128133
*FuturesApi* | [**updatePositionMargin**](docs/FuturesApi.md#updatePositionMargin) | **POST** /futures/positions/{contract}/margin | Update position margin
129134
*FuturesApi* | [**updatePositionRiskLimit**](docs/FuturesApi.md#updatePositionRiskLimit) | **POST** /futures/positions/{contract}/risk_limit | Update position risk limit
135+
*MarginApi* | [**cancelLoan**](docs/MarginApi.md#cancelLoan) | **DELETE** /margin/loans/{loan_id} | Cancel lending loan
136+
*MarginApi* | [**createLoan**](docs/MarginApi.md#createLoan) | **POST** /margin/loans | Lend or borrow
137+
*MarginApi* | [**getLoan**](docs/MarginApi.md#getLoan) | **GET** /margin/loans/{loan_id} | Retrieve one single loan detail
138+
*MarginApi* | [**getLoanRecord**](docs/MarginApi.md#getLoanRecord) | **GET** /margin/loan_records/{loan_record_id} | Get one single loan record
139+
*MarginApi* | [**listFundingAccounts**](docs/MarginApi.md#listFundingAccounts) | **GET** /margin/funding_accounts | Funding account list
140+
*MarginApi* | [**listFundingBook**](docs/MarginApi.md#listFundingBook) | **GET** /margin/funding_book | Order book of lending loans
141+
*MarginApi* | [**listLoanRecords**](docs/MarginApi.md#listLoanRecords) | **GET** /margin/loan_records | List repayment records of specified loan
142+
*MarginApi* | [**listLoanRepayments**](docs/MarginApi.md#listLoanRepayments) | **GET** /margin/loans/{loan_id}/repayment | List loan repayment records
143+
*MarginApi* | [**listLoans**](docs/MarginApi.md#listLoans) | **GET** /margin/loans | List all loans
144+
*MarginApi* | [**listMarginAccounts**](docs/MarginApi.md#listMarginAccounts) | **GET** /margin/accounts | Margin account list
145+
*MarginApi* | [**listMarginCurrencyPairs**](docs/MarginApi.md#listMarginCurrencyPairs) | **GET** /margin/currency_pairs | List all supported currency pairs supported in margin trading
146+
*MarginApi* | [**mergeLoans**](docs/MarginApi.md#mergeLoans) | **POST** /margin/merged_loans | Merge multiple lending loans
147+
*MarginApi* | [**repayLoan**](docs/MarginApi.md#repayLoan) | **POST** /margin/loans/{loan_id}/repayment | Repay a loan
148+
*MarginApi* | [**updateLoan**](docs/MarginApi.md#updateLoan) | **PATCH** /margin/loans/{loan_id} | Modify a loan
149+
*MarginApi* | [**updateLoanRecord**](docs/MarginApi.md#updateLoanRecord) | **PATCH** /margin/loan_records/{loan_record_id} | Modify a loan record
150+
*SpotApi* | [**cancelOrder**](docs/SpotApi.md#cancelOrder) | **DELETE** /spot/orders/{order_id} | Cancel a single order
151+
*SpotApi* | [**cancelOrders**](docs/SpotApi.md#cancelOrders) | **DELETE** /spot/orders | Cancel all &#x60;open&#x60; orders in specified currency pair
152+
*SpotApi* | [**createOrder**](docs/SpotApi.md#createOrder) | **POST** /spot/orders | Create an order
153+
*SpotApi* | [**getCurrencyPair**](docs/SpotApi.md#getCurrencyPair) | **GET** /spot/currency_pairs/{currency_pair} | Get detail of one single order
154+
*SpotApi* | [**getOrder**](docs/SpotApi.md#getOrder) | **GET** /spot/orders/{order_id} | Get a single order
155+
*SpotApi* | [**listCandlesticks**](docs/SpotApi.md#listCandlesticks) | **GET** /spot/candlesticks | Market candlesticks
156+
*SpotApi* | [**listCurrencyPairs**](docs/SpotApi.md#listCurrencyPairs) | **GET** /spot/currency_pairs | List all currency pairs supported
157+
*SpotApi* | [**listMyTrades**](docs/SpotApi.md#listMyTrades) | **GET** /spot/my_trades | List personal trading history
158+
*SpotApi* | [**listOrderBook**](docs/SpotApi.md#listOrderBook) | **GET** /spot/order_book | Retrieve order book
159+
*SpotApi* | [**listOrders**](docs/SpotApi.md#listOrders) | **GET** /spot/orders | List futures orders
160+
*SpotApi* | [**listSpotAccounts**](docs/SpotApi.md#listSpotAccounts) | **GET** /spot/accounts | List spot accounts
161+
*SpotApi* | [**listTickers**](docs/SpotApi.md#listTickers) | **GET** /spot/tickers | Retrieve ticker information
162+
*SpotApi* | [**listTrades**](docs/SpotApi.md#listTrades) | **GET** /spot/trades | Retrieve market trades
130163

131164

132165
## Documentation for Models
133166

134167
- [Contract](docs/Contract.md)
168+
- [CurrencyPair](docs/CurrencyPair.md)
169+
- [FundingAccount](docs/FundingAccount.md)
170+
- [FundingBookItem](docs/FundingBookItem.md)
135171
- [FundingRateRecord](docs/FundingRateRecord.md)
136172
- [FuturesAccount](docs/FuturesAccount.md)
137173
- [FuturesAccountBook](docs/FuturesAccountBook.md)
138174
- [FuturesCandlestick](docs/FuturesCandlestick.md)
175+
- [FuturesInitialOrder](docs/FuturesInitialOrder.md)
139176
- [FuturesOrder](docs/FuturesOrder.md)
140177
- [FuturesOrderBook](docs/FuturesOrderBook.md)
141178
- [FuturesOrderBookItem](docs/FuturesOrderBookItem.md)
179+
- [FuturesPriceTrigger](docs/FuturesPriceTrigger.md)
180+
- [FuturesPriceTriggeredOrder](docs/FuturesPriceTriggeredOrder.md)
142181
- [FuturesTicker](docs/FuturesTicker.md)
143182
- [FuturesTrade](docs/FuturesTrade.md)
144183
- [InsuranceRecord](docs/InsuranceRecord.md)
184+
- [Loan](docs/Loan.md)
185+
- [LoanPatch](docs/LoanPatch.md)
186+
- [LoanRecord](docs/LoanRecord.md)
187+
- [MarginAccount](docs/MarginAccount.md)
188+
- [MarginAccountCurrency](docs/MarginAccountCurrency.md)
189+
- [MarginCurrencyPair](docs/MarginCurrencyPair.md)
145190
- [MyFuturesTrade](docs/MyFuturesTrade.md)
191+
- [Order](docs/Order.md)
192+
- [OrderBook](docs/OrderBook.md)
146193
- [Position](docs/Position.md)
147194
- [PositionClose](docs/PositionClose.md)
148195
- [PositionCloseOrder](docs/PositionCloseOrder.md)
196+
- [RepayRequest](docs/RepayRequest.md)
197+
- [Repayment](docs/Repayment.md)
198+
- [SpotAccount](docs/SpotAccount.md)
199+
- [Ticker](docs/Ticker.md)
200+
- [Trade](docs/Trade.md)
201+
- [TriggerOrderResponse](docs/TriggerOrderResponse.md)
149202

150203

151204
## Recommendation

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'idea'
22
apply plugin: 'eclipse'
33

44
group = 'io.gate'
5-
version = '1.3.0'
5+
version = '4.5.0'
66

77
buildscript {
88
repositories {

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
22
settings(
33
organization := "io.gate",
44
name := "gate-api",
5-
version := "1.3.0",
5+
version := "4.5.0",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),

docs/CurrencyPair.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
# CurrencyPair
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**id** | **String** | Currency pair | [optional]
8+
**base** | **String** | Base currency | [optional]
9+
**quote** | **String** | Quote currency | [optional]
10+
**fee** | **String** | Trading fee | [optional]
11+
**minBaseAmount** | **String** | Minimum amount of base currency to trade, &#x60;null&#x60; means no limit | [optional]
12+
**minQuoteAmount** | **String** | Minimum amount of quote currency to trade, &#x60;null&#x60; means no limit | [optional]
13+
**precision** | **Integer** | Price scale | [optional]
14+
15+
16+

docs/FundingAccount.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
# FundingAccount
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**currency** | **String** | Currency name | [optional]
8+
**available** | **String** | Available assets to lend, which is identical to spot account &#x60;available&#x60; | [optional]
9+
**locked** | **String** | Locked amount. i.e. amount in &#x60;open&#x60; loans | [optional]
10+
**lent** | **String** | Amount that is loaned but not repaid | [optional]
11+
**totalLent** | **String** | Amount used for lending. total_lent &#x3D; lent + locked | [optional]
12+
13+
14+

docs/FundingBookItem.md

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

0 commit comments

Comments
 (0)