Skip to content

Commit 95f07e6

Browse files
committed
update SDK release to 1.1.0
1 parent 7507b0c commit 95f07e6

52 files changed

Lines changed: 1981 additions & 796 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: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# gate-client
1+
# gate-api
22

33
Gate API v4
4-
- API version: 1.0.0
4+
- API version: 1.1.0
55

66
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.
77

@@ -39,8 +39,8 @@ Add this dependency to your project's POM:
3939
```xml
4040
<dependency>
4141
<groupId>io.gate</groupId>
42-
<artifactId>gate-client</artifactId>
43-
<version>1.0.0</version>
42+
<artifactId>gate-api</artifactId>
43+
<version>1.1.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-client:1.0.0"
53+
compile "io.gate:gate-api:1.1.0"
5454
```
5555

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

6464
Then manually install the following JARs:
6565

66-
* `target/gate-client-1.0.0.jar`
66+
* `target/gate-api-1.1.0.jar`
6767
* `target/lib/*.jar`
6868

6969
## Getting Started
7070

7171
Please follow the [installation](#installation) instruction and execute the following Java code:
7272

7373
```java
74-
import io.gate.gateapi.ApiClient;
74+
75+
import io.gate.gateapi.*;
76+
import io.gate.gateapi.models.*;
7577
import io.gate.gateapi.api.FuturesApi;
76-
import io.gate.gateapi.models.Contract;
77-
import io.gate.gateapi.models.FuturesOrder;
78+
79+
import java.io.File;
80+
import java.util.*;
7881

7982
public class FuturesApiExample {
8083

8184
public static void main(String[] args) {
82-
ApiClient apiClient = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
83-
// uncomment the next line if testing the API with TestNet
84-
// apiClient.setBasePath("https://fx-api-testnet.gateio.io/api/v4");
85-
FuturesApi futuresApi = new FuturesApi(apiClient);
85+
ApiClient client = new ApiClient("YOUR_API_KEY", "YOUR_API_SECRET");
86+
// uncomment the next line if testing the API with other host
87+
// apiClient.setBasePath("https://some-other-host");
88+
FuturesApi apiInstance = new FuturesApi(client);
89+
String orderId = "12345"; // String | ID returned on order successfully being created
8690
try {
87-
List<Contract> contracts = futuresApi.listFuturesContracts();
88-
for (Contract c: contracts) {
89-
System.out.println(c.getName());
90-
}
91-
String contract = "BTC_USD";
92-
FuturesOrder order = new FuturesOrder();
93-
order.setContract(contract);
94-
order.setSize(100L);
95-
order.setPrice("4000");
96-
order = futuresApi.createOrder(order);
97-
System.out.println(order.getId());
91+
FuturesOrder result = apiInstance.cancelOrder(orderId);
92+
System.out.println(result);
9893
} catch (ApiException e) {
9994
System.err.println(e.getResponseBody());
10095
e.printStackTrace();
@@ -124,10 +119,11 @@ Class | Method | HTTP request | Description
124119
*FuturesApi* | [**listFuturesTickers**](docs/FuturesApi.md#listFuturesTickers) | **GET** /futures/tickers | List futures tickers
125120
*FuturesApi* | [**listFuturesTrades**](docs/FuturesApi.md#listFuturesTrades) | **GET** /futures/trades | Futures trading history
126121
*FuturesApi* | [**listOrders**](docs/FuturesApi.md#listOrders) | **GET** /futures/orders | List futures orders
127-
*FuturesApi* | [**listPositions**](docs/FuturesApi.md#listPositions) | **GET** /futures/positions | List all positions
122+
*FuturesApi* | [**listPositionClose**](docs/FuturesApi.md#listPositionClose) | **GET** /futures/position_close | List position close history
123+
*FuturesApi* | [**listPositions**](docs/FuturesApi.md#listPositions) | **GET** /futures/positions | List all positions of a user
128124
*FuturesApi* | [**updatePositionLeverage**](docs/FuturesApi.md#updatePositionLeverage) | **POST** /futures/positions/{contract}/leverage | Update position leverage
129125
*FuturesApi* | [**updatePositionMargin**](docs/FuturesApi.md#updatePositionMargin) | **POST** /futures/positions/{contract}/margin | Update position margin
130-
*FuturesApi* | [**updatePositionRiskLimit**](docs/FuturesApi.md#updatePositionRiskLimit) | **POST** /futures/positions/{contract}/risk_limit | Update poisition risk limit
126+
*FuturesApi* | [**updatePositionRiskLimit**](docs/FuturesApi.md#updatePositionRiskLimit) | **POST** /futures/positions/{contract}/risk_limit | Update position risk limit
131127

132128

133129
## Documentation for Models
@@ -136,7 +132,6 @@ Class | Method | HTTP request | Description
136132
- [FundingRateRecord](docs/FundingRateRecord.md)
137133
- [FuturesAccount](docs/FuturesAccount.md)
138134
- [FuturesCandlestick](docs/FuturesCandlestick.md)
139-
- [FuturesErrorResponse](docs/FuturesErrorResponse.md)
140135
- [FuturesOrder](docs/FuturesOrder.md)
141136
- [FuturesOrderBook](docs/FuturesOrderBook.md)
142137
- [FuturesOrderBookItem](docs/FuturesOrderBookItem.md)
@@ -145,6 +140,8 @@ Class | Method | HTTP request | Description
145140
- [InsuranceRecord](docs/InsuranceRecord.md)
146141
- [MyFuturesTrade](docs/MyFuturesTrade.md)
147142
- [Position](docs/Position.md)
143+
- [PositionClose](docs/PositionClose.md)
144+
- [PositionCloseOrder](docs/PositionCloseOrder.md)
148145

149146

150147
## Recommendation

build.gradle

Lines changed: 2 additions & 2 deletions
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.0.0'
5+
version = '1.1.0'
66

77
buildscript {
88
repositories {
@@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') {
8383

8484
install {
8585
repositories.mavenInstaller {
86-
pom.artifactId = 'gate-client'
86+
pom.artifactId = 'gate-api'
8787
}
8888
}
8989

build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
lazy val root = (project in file(".")).
22
settings(
33
organization := "io.gate",
4-
name := "gate-client",
5-
version := "1.0.0",
4+
name := "gate-api",
5+
version := "1.1.0",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),

docs/Contract.md

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,40 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**name** | **String** | Futures name | [optional]
8-
**type** | [**TypeEnum**](#TypeEnum) | Futures type | [optional]
7+
**name** | **String** | Futures contract name | [optional]
8+
**type** | [**TypeEnum**](#TypeEnum) | Futures contract type | [optional]
99
**quantoMultiplier** | **String** | Multiplier used in converting from invoicing to settlement currency in quanto futures | [optional]
10-
**leverageMin** | **String** | minimum leverage | [optional]
11-
**leverageMax** | **String** | maximum leverage | [optional]
12-
**markType** | [**MarkTypeEnum**](#MarkTypeEnum) | mark price type, internal - based on internal trading, index - based on external index price | [optional]
13-
**markPrice** | **String** | latest mark price | [optional]
14-
**indexPrice** | **String** | latest index price | [optional]
15-
**maintenanceRate** | **String** | maintenance rate of margin | [optional]
16-
**fundingRate** | **String** | funding rate | [optional]
17-
**fundingInterval** | **Integer** | funding application interval, unit in seconds | [optional]
18-
**fundingNextApply** | [**BigDecimal**](BigDecimal.md) | next funding time | [optional]
19-
**riskLimitBase** | **String** | risk limit base | [optional]
20-
**riskLimitStep** | **String** | step of adjusting risk limit | [optional]
21-
**riskLimitMax** | **String** | maximum risk limit the contract allowed | [optional]
22-
**orderSizeMin** | **Long** | minimum order size the contract allowed | [optional]
23-
**orderSizeMax** | **Long** | maximum order size the contract allowed | [optional]
24-
**orderPriceDeviate** | **String** | deviation between order price and current index price. If price of an order is denoted as &#x60;order_price&#x60;, it must meet the following condition: abs(order_price - mark_price) &lt;&#x3D; mark_price * order_price_deviate | [optional]
10+
**leverageMin** | **String** | Minimum leverage | [optional]
11+
**leverageMax** | **String** | Maximum leverage | [optional]
12+
**maintenanceRate** | **String** | Maintenance rate of margin | [optional]
13+
**markType** | [**MarkTypeEnum**](#MarkTypeEnum) | Mark price type, internal - based on internal trading, index - based on external index price | [optional]
14+
**markPrice** | **String** | Current mark price | [optional]
15+
**indexPrice** | **String** | Current index price | [optional]
16+
**lastPrice** | **String** | Last trading price | [optional]
17+
**makerFeeRate** | **String** | Maker fee rate, where negative means rebate | [optional]
18+
**takerFeeRate** | **String** | Taker fee rate | [optional]
19+
**orderPriceRound** | **String** | Minimum order price increment | [optional]
20+
**markPriceRound** | **String** | Minimum mark price increment | [optional]
21+
**fundingRate** | **String** | Current funding rate | [optional]
22+
**fundingInterval** | **Integer** | Funding application interval, unit in seconds | [optional]
23+
**fundingNextApply** | [**BigDecimal**](BigDecimal.md) | Next funding time | [optional]
24+
**riskLimitBase** | **String** | Risk limit base | [optional]
25+
**riskLimitStep** | **String** | Step of adjusting risk limit | [optional]
26+
**riskLimitMax** | **String** | Maximum risk limit the contract allowed | [optional]
27+
**orderSizeMin** | **Long** | Minimum order size the contract allowed | [optional]
28+
**orderSizeMax** | **Long** | Maximum order size the contract allowed | [optional]
29+
**orderPriceDeviate** | **String** | deviation between order price and current index price. If price of an order is denoted as order_price, it must meet the following condition: abs(order_price - mark_price) &lt;&#x3D; mark_price * order_price_deviate | [optional]
30+
**orderbookId** | **Long** | Current orderbook ID | [optional]
31+
**tradeId** | **Long** | Current trade ID | [optional]
32+
**tradeSize** | **Long** | Historical accumulation trade size | [optional]
33+
**positionSize** | **Long** | Current total long position size | [optional]
2534

2635

2736
<a name="TypeEnum"></a>
2837
## Enum: TypeEnum
2938
Name | Value
3039
---- | -----
3140
INVERSE | &quot;inverse&quot;
32-
QUANTO | &quot;quanto&quot;
3341
DIRECT | &quot;direct&quot;
3442

3543

docs/FundingRateRecord.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**t** | **Long** | Unix timestamp in seconds | [optional]
8-
**r** | **String** | funding rate | [optional]
8+
**r** | **String** | Funding rate | [optional]
99

1010

1111

docs/FuturesAccount.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**total** | **String** | total assets, total &#x3D; position_margin + order_margin + available | [optional]
8-
**unrealisedPnl** | **String** | unrealized pnl | [optional]
9-
**positionMargin** | **String** | position margin | [optional]
10-
**orderMargin** | **String** | order margin of unfinished orders | [optional]
11-
**available** | **String** | available balance to transfer out or trade | [optional]
7+
**total** | **String** | Total assets, total &#x3D; position_margin + order_margin + available | [optional]
8+
**unrealisedPnl** | **String** | Unrealized PNL | [optional]
9+
**positionMargin** | **String** | Position margin | [optional]
10+
**orderMargin** | **String** | Order margin of unfinished orders | [optional]
11+
**available** | **String** | Available balance to transfer out or trade | [optional]
1212

1313

1414

0 commit comments

Comments
 (0)