Skip to content

Commit ef89086

Browse files
committed
add wallet api; list loans supports rate sorting; add point info in futures
1 parent 2474fe9 commit ef89086

73 files changed

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

33
Gate API v4
4-
- API version: 4.6.1
4+
- API version: 4.7.2
55

66
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

@@ -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>4.6.1</version>
43+
<version>4.7.2</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:4.6.1"
53+
compile "io.gate:gate-api:4.7.2"
5454
```
5555

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

6464
Then manually install the following JARs:
6565

66-
* `target/gate-api-4.6.1.jar`
66+
* `target/gate-api-4.7.2.jar`
6767
* `target/lib/*.jar`
6868

6969
## Getting Started
@@ -126,6 +126,7 @@ Class | Method | HTTP request | Description
126126
*FuturesApi* | [**listFuturesOrders**](docs/FuturesApi.md#listFuturesOrders) | **GET** /futures/orders | List futures orders
127127
*FuturesApi* | [**listFuturesTickers**](docs/FuturesApi.md#listFuturesTickers) | **GET** /futures/tickers | List futures tickers
128128
*FuturesApi* | [**listFuturesTrades**](docs/FuturesApi.md#listFuturesTrades) | **GET** /futures/trades | Futures trading history
129+
*FuturesApi* | [**listLiquidates**](docs/FuturesApi.md#listLiquidates) | **GET** /futures/liquidates | List liquidation history
129130
*FuturesApi* | [**listPositionClose**](docs/FuturesApi.md#listPositionClose) | **GET** /futures/position_close | List position close history
130131
*FuturesApi* | [**listPositions**](docs/FuturesApi.md#listPositions) | **GET** /futures/positions | List all positions of a user
131132
*FuturesApi* | [**listPriceTriggeredOrders**](docs/FuturesApi.md#listPriceTriggeredOrders) | **GET** /futures/price_orders | List all auto orders
@@ -156,10 +157,11 @@ Class | Method | HTTP request | Description
156157
*SpotApi* | [**listCurrencyPairs**](docs/SpotApi.md#listCurrencyPairs) | **GET** /spot/currency_pairs | List all currency pairs supported
157158
*SpotApi* | [**listMyTrades**](docs/SpotApi.md#listMyTrades) | **GET** /spot/my_trades | List personal trading history
158159
*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* | [**listOrders**](docs/SpotApi.md#listOrders) | **GET** /spot/orders | List orders
160161
*SpotApi* | [**listSpotAccounts**](docs/SpotApi.md#listSpotAccounts) | **GET** /spot/accounts | List spot accounts
161162
*SpotApi* | [**listTickers**](docs/SpotApi.md#listTickers) | **GET** /spot/tickers | Retrieve ticker information
162163
*SpotApi* | [**listTrades**](docs/SpotApi.md#listTrades) | **GET** /spot/trades | Retrieve market trades
164+
*WalletApi* | [**transfer**](docs/WalletApi.md#transfer) | **POST** /wallet/transfers | Transfer between accounts
163165

164166

165167
## Documentation for Models
@@ -173,6 +175,7 @@ Class | Method | HTTP request | Description
173175
- [FuturesAccountBook](docs/FuturesAccountBook.md)
174176
- [FuturesCandlestick](docs/FuturesCandlestick.md)
175177
- [FuturesInitialOrder](docs/FuturesInitialOrder.md)
178+
- [FuturesLiquidate](docs/FuturesLiquidate.md)
176179
- [FuturesOrder](docs/FuturesOrder.md)
177180
- [FuturesOrderBook](docs/FuturesOrderBook.md)
178181
- [FuturesOrderBookItem](docs/FuturesOrderBookItem.md)
@@ -198,6 +201,7 @@ Class | Method | HTTP request | Description
198201
- [SpotAccount](docs/SpotAccount.md)
199202
- [Ticker](docs/Ticker.md)
200203
- [Trade](docs/Trade.md)
204+
- [Transfer](docs/Transfer.md)
201205
- [TriggerOrderResponse](docs/TriggerOrderResponse.md)
202206

203207

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 = '4.6.1'
5+
version = '4.7.2'
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 := "4.6.1",
5+
version := "4.7.2",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),

docs/FuturesAccount.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
99
**positionMargin** | **String** | Position margin | [optional]
1010
**orderMargin** | **String** | Order margin of unfinished orders | [optional]
1111
**available** | **String** | Available balance to transfer out or trade | [optional]
12+
**point** | **String** | POINT amount | [optional]
1213

1314

1415

docs/FuturesAccountBook.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
77
**time** | [**BigDecimal**](BigDecimal.md) | Change time | [optional]
88
**change** | **String** | Change amount | [optional]
99
**balance** | **String** | Balance after change | [optional]
10-
**type** | [**TypeEnum**](#TypeEnum) | Changing Type - dnw: Deposit &amp; Withdraw - pnl: Profit &amp; Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding | [optional]
10+
**type** | [**TypeEnum**](#TypeEnum) | Changing Type: - dnw: Deposit &amp; Withdraw - pnl: Profit &amp; Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit &amp; Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional]
1111
**text** | **String** | Comment | [optional]
1212

1313

@@ -20,6 +20,9 @@ PNL | &quot;pnl&quot;
2020
FEE | &quot;fee&quot;
2121
REFR | &quot;refr&quot;
2222
FUND | &quot;fund&quot;
23+
POINT_DNW | &quot;point_dnw&quot;
24+
POINT_FEE | &quot;point_fee&quot;
25+
POINT_REFR | &quot;point_refr&quot;
2326

2427

2528

docs/FuturesApi.md

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Method | HTTP request | Description
2525
[**listFuturesOrders**](FuturesApi.md#listFuturesOrders) | **GET** /futures/orders | List futures orders
2626
[**listFuturesTickers**](FuturesApi.md#listFuturesTickers) | **GET** /futures/tickers | List futures tickers
2727
[**listFuturesTrades**](FuturesApi.md#listFuturesTrades) | **GET** /futures/trades | Futures trading history
28+
[**listLiquidates**](FuturesApi.md#listLiquidates) | **GET** /futures/liquidates | List liquidation history
2829
[**listPositionClose**](FuturesApi.md#listPositionClose) | **GET** /futures/position_close | List position close history
2930
[**listPositions**](FuturesApi.md#listPositions) | **GET** /futures/positions | List all positions of a user
3031
[**listPriceTriggeredOrders**](FuturesApi.md#listPriceTriggeredOrders) | **GET** /futures/price_orders | List all auto orders
@@ -600,7 +601,7 @@ FuturesApi apiInstance = new FuturesApi(client);
600601
Integer limit = 100; // Integer | Maximum number of record returned in one list
601602
Integer from = 1547706332; // Integer | Start timestamp
602603
Integer to = 1547706332; // Integer | End timestamp
603-
String type = "dnw"; // String | Changing Type - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding
604+
String type = "dnw"; // String | Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate
604605
try {
605606
List<FuturesAccountBook> result = apiInstance.listFuturesAccountBook(limit, from, to, type);
606607
System.out.println(result);
@@ -617,7 +618,7 @@ Name | Type | Description | Notes
617618
**limit** | **Integer**| Maximum number of record returned in one list | [optional] [default to 100]
618619
**from** | **Integer**| Start timestamp | [optional]
619620
**to** | **Integer**| End timestamp | [optional]
620-
**type** | **String**| Changing Type - dnw: Deposit &amp; Withdraw - pnl: Profit &amp; Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding | [optional] [enum: dnw, pnl, fee, refr, fund]
621+
**type** | **String**| Changing Type: - dnw: Deposit &amp; Withdraw - pnl: Profit &amp; Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit &amp; Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional] [enum: dnw, pnl, fee, refr, fund, point_dnw, point_fee, point_refr]
621622

622623
### Return type
623624

@@ -1067,6 +1068,59 @@ Name | Type | Description | Notes
10671068

10681069
No authorization required
10691070

1071+
### HTTP request headers
1072+
1073+
- **Content-Type**: Not defined
1074+
- **Accept**: application/json
1075+
1076+
<a name="listLiquidates"></a>
1077+
# **listLiquidates**
1078+
> List&lt;FuturesLiquidate&gt; listLiquidates(contract, limit, at)
1079+
1080+
List liquidation history
1081+
1082+
### Example
1083+
1084+
```java
1085+
import io.gate.gateapi.*;
1086+
import io.gate.gateapi.models.*;
1087+
import io.gate.gateapi.api.FuturesApi;
1088+
1089+
import java.io.File;
1090+
import java.util.*;
1091+
1092+
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
1093+
// uncomment the next line if testing the API with other host
1094+
// apiClient.setBasePath("https://some-other-host");
1095+
FuturesApi apiInstance = new FuturesApi(client);
1096+
String contract = "BTC_USD"; // String | Futures contract, return related data only if specified
1097+
Integer limit = 100; // Integer | Maximum number of record returned in one list
1098+
Integer at = 0; // Integer | Specify a liquidation timestamp
1099+
try {
1100+
List<FuturesLiquidate> result = apiInstance.listLiquidates(contract, limit, at);
1101+
System.out.println(result);
1102+
} catch (ApiException e) {
1103+
System.err.println("Exception when calling FuturesApi#listLiquidates");
1104+
e.printStackTrace();
1105+
}
1106+
```
1107+
1108+
### Parameters
1109+
1110+
Name | Type | Description | Notes
1111+
------------- | ------------- | ------------- | -------------
1112+
**contract** | **String**| Futures contract, return related data only if specified | [optional]
1113+
**limit** | **Integer**| Maximum number of record returned in one list | [optional] [default to 100]
1114+
**at** | **Integer**| Specify a liquidation timestamp | [optional] [default to 0]
1115+
1116+
### Return type
1117+
1118+
[**List&lt;FuturesLiquidate&gt;**](FuturesLiquidate.md)
1119+
1120+
### Authorization
1121+
1122+
Authentication with API key and secret is required
1123+
10701124
### HTTP request headers
10711125

10721126
- **Content-Type**: Not defined

docs/FuturesInitialOrder.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Name | Type | Description | Notes
1010
**close** | **Boolean** | Set to true if trying to close the position | [optional]
1111
**tif** | [**TifEnum**](#TifEnum) | Time in force. If using market price, only &#x60;ioc&#x60; is supported. - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled | [optional]
1212
**text** | [**TextEnum**](#TextEnum) | How the order is created. Possible values are: web, api and app | [optional]
13-
**reduceOnly** | **Boolean** | Set to true to create an post-only order | [optional]
14-
**isReduceOnly** | **Boolean** | Is the order post-only | [optional]
13+
**reduceOnly** | **Boolean** | Set to true to create an reduce-only order | [optional]
14+
**isReduceOnly** | **Boolean** | Is the order reduce-only | [optional]
1515
**isClose** | **Boolean** | Is the order to close position | [optional]
1616

1717

docs/FuturesLiquidate.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
# FuturesLiquidate
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**time** | **Long** | Liquidation time | [optional]
8+
**contract** | **String** | Futures contract | [optional]
9+
**leverage** | **String** | Position leverage | [optional]
10+
**size** | **Long** | Position size | [optional]
11+
**margin** | **String** | Position margin | [optional]
12+
**entryPrice** | **String** | Average entry price | [optional]
13+
**liqPrice** | **String** | Liquidation price | [optional]
14+
**markPrice** | **String** | Mark price | [optional]
15+
**orderId** | **Long** | Liquidation order ID | [optional]
16+
**orderPrice** | **String** | Liquidation order price | [optional]
17+
**fillPrice** | **String** | Liquidation order average taker price | [optional]
18+
**left** | **Long** | Liquidation order maker size | [optional]
19+
20+
21+

docs/FuturesOrder.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Name | Type | Description | Notes
1717
**close** | **Boolean** | Set as &#x60;true&#x60; to close the position, with &#x60;size&#x60; set to 0 | [optional]
1818
**isClose** | **Boolean** | Is the order to close position | [optional]
1919
**reduceOnly** | **Boolean** | Set as &#x60;true&#x60; to be post-only order | [optional]
20-
**isReduceOnly** | **Boolean** | Is the order post-only | [optional]
20+
**isReduceOnly** | **Boolean** | Is the order reduce-only | [optional]
2121
**isLiq** | **Boolean** | Is the order for liquidation | [optional]
2222
**tif** | [**TifEnum**](#TifEnum) | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, post-only | [optional]
2323
**left** | **Long** | Size left to be traded | [optional]

docs/Loan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Name | Type | Description | Notes
1010
**status** | [**StatusEnum**](#StatusEnum) | Loan status open - not fully loaned loaned - all loaned out for lending loan; loaned in for borrowing side finished - loan is finished, either being all repaid or cancelled by the lender auto_repaid - automatically repaid by the system | [optional]
1111
**side** | [**SideEnum**](#SideEnum) | Loan side |
1212
**currency** | **String** | Loan currency |
13-
**rate** | **String** | Loan rate |
13+
**rate** | **String** | Loan rate. Only rates in [0.0002, 0.002] are supported. Not required in lending. Market rate calculated from recent rates will be used if not set | [optional]
1414
**amount** | **String** | Loan amount |
1515
**days** | **Integer** | Loan days |
1616
**autoRenew** | **Boolean** | Auto renew the loan on expiration | [optional]

0 commit comments

Comments
 (0)