Skip to content

Commit e0e9da8

Browse files
committed
fix mistaken position field dual_mode
1 parent c285862 commit e0e9da8

9 files changed

Lines changed: 49 additions & 49 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
Gate API v4
44

5-
- API version: 4.16.0
6-
- SDK version: 5.16.0
5+
- API version: 4.16.1
6+
- SDK version: 5.16.1
77

88
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.
99

@@ -65,7 +65,7 @@ Add this dependency to your project's POM:
6565
<dependency>
6666
<groupId>io.gate</groupId>
6767
<artifactId>gate-api</artifactId>
68-
<version>5.16.0</version>
68+
<version>5.16.1</version>
6969
<scope>compile</scope>
7070
</dependency>
7171
```
@@ -75,7 +75,7 @@ Add this dependency to your project's POM:
7575
Add this dependency to your project's build file:
7676

7777
```groovy
78-
compile "io.gate:gate-api:5.16.0"
78+
compile "io.gate:gate-api:5.16.1"
7979
```
8080

8181
### Others
@@ -88,7 +88,7 @@ mvn clean package
8888

8989
Then manually install the following JARs:
9090

91-
* `target/gate-api-5.16.0.jar`
91+
* `target/gate-api-5.16.1.jar`
9292
* `target/lib/*.jar`
9393

9494
## Getting Started

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'eclipse'
33
apply plugin: 'java'
44

55
group = 'io.gate'
6-
version = '5.16.0'
6+
version = '5.16.1'
77

88
buildscript {
99
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 := "5.16.0",
5+
version := "5.16.1",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),

docs/DeliveryApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,7 @@ public class Example {
17611761
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
17621762
String settle = "usdt"; // String | Settle currency
17631763
String status = "status_example"; // String | List orders based on status
1764-
String contract = "BTC_USD"; // String | Futures contract, return related data only if specified
1764+
String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
17651765
Integer limit = 100; // Integer | Maximum number of records returned in one list
17661766
Integer offset = 0; // Integer | List offset, starting from 0
17671767
try {
@@ -1910,7 +1910,7 @@ public class Example {
19101910

19111911
DeliveryApi apiInstance = new DeliveryApi(defaultClient);
19121912
String settle = "usdt"; // String | Settle currency
1913-
String contract = "BTC_USD"; // String | Futures contract
1913+
String contract = "BTC_USDT"; // String | Futures contract
19141914
try {
19151915
List<FuturesPriceTriggeredOrder> result = apiInstance.cancelPriceTriggeredDeliveryOrderList(settle, contract);
19161916
System.out.println(result);

docs/FuturesApi.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public class Example {
197197

198198
FuturesApi apiInstance = new FuturesApi(defaultClient);
199199
String settle = "btc"; // String | Settle currency
200-
String contract = "BTC_USD"; // String | Futures contract
200+
String contract = "BTC_USDT"; // String | Futures contract
201201
String interval = "0"; // String | Order depth. 0 means no aggregation is applied. default to 0
202202
Integer limit = 10; // Integer | Maximum number of order depth data in asks or bids
203203
try {
@@ -270,7 +270,7 @@ public class Example {
270270

271271
FuturesApi apiInstance = new FuturesApi(defaultClient);
272272
String settle = "btc"; // String | Settle currency
273-
String contract = "BTC_USD"; // String | Futures contract
273+
String contract = "BTC_USDT"; // String | Futures contract
274274
Integer limit = 100; // Integer | Maximum number of records returned in one list
275275
String lastId = "12345"; // String | Specify list staring point using the id of last record in previous list-query results This parameter is deprecated. Use `from` and `to` instead to limit time range
276276
Long from = 1546905600L; // Long | Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned.
@@ -351,7 +351,7 @@ public class Example {
351351

352352
FuturesApi apiInstance = new FuturesApi(defaultClient);
353353
String settle = "btc"; // String | Settle currency
354-
String contract = "BTC_USD"; // String | Futures contract
354+
String contract = "BTC_USDT"; // String | Futures contract
355355
Long from = 1546905600L; // Long | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified
356356
Long to = 1546935600L; // Long | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time
357357
Integer limit = 100; // Integer | Maximum recent data points returned. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected.
@@ -430,7 +430,7 @@ public class Example {
430430

431431
FuturesApi apiInstance = new FuturesApi(defaultClient);
432432
String settle = "btc"; // String | Settle currency
433-
String contract = "BTC_USD"; // String | Futures contract, return related data only if specified
433+
String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
434434
try {
435435
List<FuturesTicker> result = apiInstance.listFuturesTickers(settle)
436436
.contract(contract)
@@ -498,7 +498,7 @@ public class Example {
498498

499499
FuturesApi apiInstance = new FuturesApi(defaultClient);
500500
String settle = "btc"; // String | Settle currency
501-
String contract = "BTC_USD"; // String | Futures contract
501+
String contract = "BTC_USDT"; // String | Futures contract
502502
Integer limit = 100; // Integer | Maximum number of records returned in one list
503503
try {
504504
List<FundingRateRecord> result = apiInstance.listFuturesFundingRateHistory(settle, contract)
@@ -636,7 +636,7 @@ public class Example {
636636

637637
FuturesApi apiInstance = new FuturesApi(defaultClient);
638638
String settle = "btc"; // String | Settle currency
639-
String contract = "BTC_USD"; // String | Futures contract
639+
String contract = "BTC_USDT"; // String | Futures contract
640640
Long from = 1604561000L; // Long | Start timestamp
641641
String interval = "5m"; // String |
642642
Integer limit = 30; // Integer |
@@ -714,7 +714,7 @@ public class Example {
714714

715715
FuturesApi apiInstance = new FuturesApi(defaultClient);
716716
String settle = "btc"; // String | Settle currency
717-
String contract = "BTC_USD"; // String | Futures contract, return related data only if specified
717+
String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
718718
Long from = 1547706332L; // Long | Start timestamp
719719
Long to = 1547706332L; // Long | End timestamp
720720
Integer limit = 100; // Integer | Maximum number of records returned in one list
@@ -1658,7 +1658,7 @@ public class Example {
16581658

16591659
FuturesApi apiInstance = new FuturesApi(defaultClient);
16601660
String settle = "btc"; // String | Settle currency
1661-
String contract = "BTC_USD"; // String | Futures contract
1661+
String contract = "BTC_USDT"; // String | Futures contract
16621662
String status = "open"; // String | List orders based on status
16631663
Integer limit = 100; // Integer | Maximum number of records returned in one list
16641664
Integer offset = 0; // Integer | List offset, starting from 0
@@ -1817,7 +1817,7 @@ public class Example {
18171817

18181818
FuturesApi apiInstance = new FuturesApi(defaultClient);
18191819
String settle = "btc"; // String | Settle currency
1820-
String contract = "BTC_USD"; // String | Futures contract
1820+
String contract = "BTC_USDT"; // String | Futures contract
18211821
String side = "ask"; // String | All bids or asks. Both included in not specified
18221822
try {
18231823
List<FuturesOrder> result = apiInstance.cancelFuturesOrders(settle, contract, side);
@@ -2031,7 +2031,7 @@ public class Example {
20312031

20322032
FuturesApi apiInstance = new FuturesApi(defaultClient);
20332033
String settle = "btc"; // String | Settle currency
2034-
String contract = "BTC_USD"; // String | Futures contract, return related data only if specified
2034+
String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
20352035
Long order = 12345L; // Long | Futures order ID, return related data only if specified
20362036
Integer limit = 100; // Integer | Maximum number of records returned in one list
20372037
Integer offset = 0; // Integer | List offset, starting from 0
@@ -2118,7 +2118,7 @@ public class Example {
21182118

21192119
FuturesApi apiInstance = new FuturesApi(defaultClient);
21202120
String settle = "btc"; // String | Settle currency
2121-
String contract = "BTC_USD"; // String | Futures contract, return related data only if specified
2121+
String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
21222122
Integer limit = 100; // Integer | Maximum number of records returned in one list
21232123
try {
21242124
List<PositionClose> result = apiInstance.listPositionClose(settle)
@@ -2193,7 +2193,7 @@ public class Example {
21932193

21942194
FuturesApi apiInstance = new FuturesApi(defaultClient);
21952195
String settle = "btc"; // String | Settle currency
2196-
String contract = "BTC_USD"; // String | Futures contract, return related data only if specified
2196+
String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
21972197
Integer limit = 100; // Integer | Maximum number of records returned in one list
21982198
Integer at = 0; // Integer | Specify a liquidation timestamp
21992199
try {
@@ -2272,7 +2272,7 @@ public class Example {
22722272
FuturesApi apiInstance = new FuturesApi(defaultClient);
22732273
String settle = "btc"; // String | Settle currency
22742274
String status = "status_example"; // String | List orders based on status
2275-
String contract = "BTC_USD"; // String | Futures contract, return related data only if specified
2275+
String contract = "BTC_USDT"; // String | Futures contract, return related data only if specified
22762276
Integer limit = 100; // Integer | Maximum number of records returned in one list
22772277
Integer offset = 0; // Integer | List offset, starting from 0
22782278
try {
@@ -2421,7 +2421,7 @@ public class Example {
24212421

24222422
FuturesApi apiInstance = new FuturesApi(defaultClient);
24232423
String settle = "btc"; // String | Settle currency
2424-
String contract = "BTC_USD"; // String | Futures contract
2424+
String contract = "BTC_USDT"; // String | Futures contract
24252425
try {
24262426
List<FuturesPriceTriggeredOrder> result = apiInstance.cancelPriceTriggeredOrderList(settle, contract);
24272427
System.out.println(result);

docs/Position.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ Name | Type | Description | Notes
2828
**adlRanking** | **Integer** | ADL ranking, range from 1 to 5 | [optional] [readonly]
2929
**pendingOrders** | **Integer** | Current open orders | [optional] [readonly]
3030
**closeOrder** | [**PositionCloseOrder**](PositionCloseOrder.md) | | [optional]
31-
**dualMode** | [**DualModeEnum**](#DualModeEnum) | Position mode, including: - &#x60;single&#x60;: dual mode is not enabled- &#x60;dual_long&#x60;: long position in dual mode- &#x60;dual_short&#x60;: short position in dual mode | [optional]
31+
**mode** | [**ModeEnum**](#ModeEnum) | Position mode, including: - &#x60;single&#x60;: dual mode is not enabled- &#x60;dual_long&#x60;: long position in dual mode- &#x60;dual_short&#x60;: short position in dual mode | [optional]
3232

33-
## Enum: DualModeEnum
33+
## Enum: ModeEnum
3434

3535
Name | Value
3636
---- | -----

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>gate-api</artifactId>
66
<packaging>jar</packaging>
77
<name>gate-api</name>
8-
<version>5.16.0</version>
8+
<version>5.16.1</version>
99
<url>https://github.com/openapitools/openapi-generator</url>
1010
<description>Java client for gateapi</description>
1111
<scm>

src/main/java/io/gate/gateapi/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private void init() {
113113
json = new JSON();
114114

115115
// Set default User-Agent.
116-
setUserAgent("OpenAPI-Generator/5.16.0/java");
116+
setUserAgent("OpenAPI-Generator/5.16.1/java");
117117

118118
authentications = new HashMap<String, Authentication>();
119119
}

src/main/java/io/gate/gateapi/models/Position.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ public class Position {
111111
/**
112112
* Position mode, including: - &#x60;single&#x60;: dual mode is not enabled- &#x60;dual_long&#x60;: long position in dual mode- &#x60;dual_short&#x60;: short position in dual mode
113113
*/
114-
@JsonAdapter(DualModeEnum.Adapter.class)
115-
public enum DualModeEnum {
114+
@JsonAdapter(ModeEnum.Adapter.class)
115+
public enum ModeEnum {
116116
SINGLE("single"),
117117

118118
DUAL_LONG("dual_long"),
@@ -121,7 +121,7 @@ public enum DualModeEnum {
121121

122122
private String value;
123123

124-
DualModeEnum(String value) {
124+
ModeEnum(String value) {
125125
this.value = value;
126126
}
127127

@@ -134,32 +134,32 @@ public String toString() {
134134
return String.valueOf(value);
135135
}
136136

137-
public static DualModeEnum fromValue(String value) {
138-
for (DualModeEnum b : DualModeEnum.values()) {
137+
public static ModeEnum fromValue(String value) {
138+
for (ModeEnum b : ModeEnum.values()) {
139139
if (b.value.equals(value)) {
140140
return b;
141141
}
142142
}
143143
throw new IllegalArgumentException("Unexpected value '" + value + "'");
144144
}
145145

146-
public static class Adapter extends TypeAdapter<DualModeEnum> {
146+
public static class Adapter extends TypeAdapter<ModeEnum> {
147147
@Override
148-
public void write(final JsonWriter jsonWriter, final DualModeEnum enumeration) throws IOException {
148+
public void write(final JsonWriter jsonWriter, final ModeEnum enumeration) throws IOException {
149149
jsonWriter.value(enumeration.getValue());
150150
}
151151

152152
@Override
153-
public DualModeEnum read(final JsonReader jsonReader) throws IOException {
153+
public ModeEnum read(final JsonReader jsonReader) throws IOException {
154154
String value = jsonReader.nextString();
155-
return DualModeEnum.fromValue(value);
155+
return ModeEnum.fromValue(value);
156156
}
157157
}
158158
}
159159

160-
public static final String SERIALIZED_NAME_DUAL_MODE = "dual_mode";
161-
@SerializedName(SERIALIZED_NAME_DUAL_MODE)
162-
private DualModeEnum dualMode;
160+
public static final String SERIALIZED_NAME_MODE = "mode";
161+
@SerializedName(SERIALIZED_NAME_MODE)
162+
private ModeEnum mode;
163163

164164

165165
/**
@@ -412,24 +412,24 @@ public void setCloseOrder(PositionCloseOrder closeOrder) {
412412
this.closeOrder = closeOrder;
413413
}
414414

415-
public Position dualMode(DualModeEnum dualMode) {
415+
public Position mode(ModeEnum mode) {
416416

417-
this.dualMode = dualMode;
417+
this.mode = mode;
418418
return this;
419419
}
420420

421421
/**
422422
* Position mode, including: - &#x60;single&#x60;: dual mode is not enabled- &#x60;dual_long&#x60;: long position in dual mode- &#x60;dual_short&#x60;: short position in dual mode
423-
* @return dualMode
423+
* @return mode
424424
**/
425425
@javax.annotation.Nullable
426-
public DualModeEnum getDualMode() {
427-
return dualMode;
426+
public ModeEnum getMode() {
427+
return mode;
428428
}
429429

430430

431-
public void setDualMode(DualModeEnum dualMode) {
432-
this.dualMode = dualMode;
431+
public void setMode(ModeEnum mode) {
432+
this.mode = mode;
433433
}
434434
@Override
435435
public boolean equals(java.lang.Object o) {
@@ -461,12 +461,12 @@ public boolean equals(java.lang.Object o) {
461461
Objects.equals(this.adlRanking, position.adlRanking) &&
462462
Objects.equals(this.pendingOrders, position.pendingOrders) &&
463463
Objects.equals(this.closeOrder, position.closeOrder) &&
464-
Objects.equals(this.dualMode, position.dualMode);
464+
Objects.equals(this.mode, position.mode);
465465
}
466466

467467
@Override
468468
public int hashCode() {
469-
return Objects.hash(user, contract, size, leverage, riskLimit, leverageMax, maintenanceRate, value, margin, entryPrice, liqPrice, markPrice, unrealisedPnl, realisedPnl, historyPnl, lastClosePnl, realisedPoint, historyPoint, adlRanking, pendingOrders, closeOrder, dualMode);
469+
return Objects.hash(user, contract, size, leverage, riskLimit, leverageMax, maintenanceRate, value, margin, entryPrice, liqPrice, markPrice, unrealisedPnl, realisedPnl, historyPnl, lastClosePnl, realisedPoint, historyPoint, adlRanking, pendingOrders, closeOrder, mode);
470470
}
471471

472472

@@ -495,7 +495,7 @@ public String toString() {
495495
sb.append(" adlRanking: ").append(toIndentedString(adlRanking)).append("\n");
496496
sb.append(" pendingOrders: ").append(toIndentedString(pendingOrders)).append("\n");
497497
sb.append(" closeOrder: ").append(toIndentedString(closeOrder)).append("\n");
498-
sb.append(" dualMode: ").append(toIndentedString(dualMode)).append("\n");
498+
sb.append(" mode: ").append(toIndentedString(mode)).append("\n");
499499
sb.append("}");
500500
return sb.toString();
501501
}

0 commit comments

Comments
 (0)