Skip to content

Commit 40b7d08

Browse files
author
gateio
committed
update to 6.86.0
1 parent b6e5fed commit 40b7d08

546 files changed

Lines changed: 53149 additions & 61043 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ hs_err_pid*
1919
target
2020
.gradle
2121
build
22+
*.iml

README.md

Lines changed: 70 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# gate-api
22

33
Gate API v4
4+
45
- API version: 4.86.0
6+
- SDK version: 6.86.0
57

68
Welcome to Gate.io API
79

@@ -11,39 +13,48 @@ APIv4 provides spot, margin and futures trading operations. There are public API
1113

1214
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
1315

16+
## Versioning
1417

15-
## Requirements
18+
Trying our best to follow the [semantic versioning](https://semver.org/), while enjoying recent features
19+
provided by programming language and libraries, from 4.15.2, one major versioning difference will be
20+
introduced:
1621

17-
Building the API client library requires:
18-
1. Java 1.8+
19-
2. Maven/Gradle
22+
If extra code rewrite is required when you upgrade the SDK, such as:
2023

21-
## Installation
24+
- some outdated programming language version support is dropped
25+
- API method signature has breaking changes.
2226

23-
To install the API client library to your local Maven repository, simply execute:
27+
**the MAJOR version will be incremented, but the MINOR and PATCH version are still following REST API's
28+
instead of resetting to 0**, so that you can recognize it has some breaking changes, but still getting
29+
the idea of from which REST API version the change is introduced.
2430

25-
```shell
26-
mvn clean install
27-
```
31+
For example, the previous REST API and SDK version are both 4.14.0. But if we decide to introduce
32+
some breaking changes in SDK along with REST API 4.15.2 upgrade, then the version of next SDK release
33+
will be 5.15.2(the MAJOR version is incremented to denote breaking changes, but the MINOR and PATCH
34+
version are identical to REST API's instead of resetting them to 0)
2835

29-
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
36+
If MAJOR version is incremented, make sure you read the release note on
37+
[Releases](https://github.com/gateio/gateapi-java/releases)
38+
page
3039

31-
```shell
32-
mvn clean deploy
33-
```
40+
## Requirements
3441

35-
Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
42+
Building the API client library requires:
43+
1. Java 1.8+
44+
2. Maven/Gradle
45+
46+
## Installation
3647

3748
### Maven users
3849

3950
Add this dependency to your project's POM:
4051

4152
```xml
4253
<dependency>
43-
<groupId>io.gate</groupId>
44-
<artifactId>gate-api</artifactId>
45-
<version>6.86.0</version>
46-
<scope>compile</scope>
54+
<groupId>io.gate</groupId>
55+
<artifactId>gate-api</artifactId>
56+
<version>6.86.0</version>
57+
<scope>compile</scope>
4758
</dependency>
4859
```
4960

@@ -68,47 +79,62 @@ Then manually install the following JARs:
6879
* `target/gate-api-6.86.0.jar`
6980
* `target/lib/*.jar`
7081

82+
To install the API client library to your local Maven repository, simply execute:
83+
84+
```shell
85+
mvn clean install
86+
```
87+
88+
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
89+
90+
```shell
91+
mvn clean deploy
92+
```
93+
94+
Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
95+
7196
## Getting Started
7297

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

75-
```java
76100

101+
```java
77102
// Import classes:
78103
import io.gate.gateapi.ApiClient;
79104
import io.gate.gateapi.ApiException;
80105
import io.gate.gateapi.Configuration;
106+
import io.gate.gateapi.GateApiException;
81107
import io.gate.gateapi.auth.*;
82108
import io.gate.gateapi.models.*;
83109
import io.gate.gateapi.api.AccountApi;
84110

85111
public class Example {
86-
public static void main(String[] args) {
87-
ApiClient defaultClient = Configuration.getDefaultApiClient();
88-
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
89-
90-
// Configure API key authorization: apiv4
91-
ApiKeyAuth apiv4 = (ApiKeyAuth) defaultClient.getAuthentication("apiv4");
92-
apiv4.setApiKey("YOUR API KEY");
93-
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
94-
//apiv4.setApiKeyPrefix("Token");
95-
96-
AccountApi apiInstance = new AccountApi(defaultClient);
97-
try {
98-
AccountDetail result = apiInstance.getAccountDetail();
99-
System.out.println(result);
100-
} catch (ApiException e) {
101-
System.err.println("Exception when calling AccountApi#getAccountDetail");
102-
System.err.println("Status code: " + e.getCode());
103-
System.err.println("Reason: " + e.getResponseBody());
104-
System.err.println("Response headers: " + e.getResponseHeaders());
105-
e.printStackTrace();
112+
public static void main(String[] args) {
113+
ApiClient defaultClient = Configuration.getDefaultApiClient();
114+
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
115+
116+
// Configure APIv4 authorization: apiv4
117+
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
118+
119+
AccountApi apiInstance = new AccountApi(defaultClient);
120+
try {
121+
AccountDetail result = apiInstance.getAccountDetail();
122+
System.out.println(result);
123+
} catch (GateApiException e) {
124+
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
125+
e.printStackTrace();
126+
} catch (ApiException e) {
127+
System.err.println("Exception when calling AccountApi#getAccountDetail");
128+
System.err.println("Status code: " + e.getCode());
129+
System.err.println("Response headers: " + e.getResponseHeaders());
130+
e.printStackTrace();
131+
}
106132
}
107-
}
108133
}
109-
110134
```
111135

136+
For a more complete API usage example, refer to the demo application in [example](example) directory
137+
112138
## Documentation for API Endpoints
113139

114140
All URIs are relative to *https://api.gateio.ws/api/v4*
@@ -662,16 +688,14 @@ Class | Method | HTTP request | Description
662688
## Documentation for Authorization
663689

664690
Authentication schemes defined for the API:
665-
### apiv4
666691

667-
- **Type**: API key
668-
- **API key parameter name**: SIGN
669-
- **Location**: HTTP header
692+
### apiv4
670693

694+
- **Type**: Gate APIv4
671695

672696
## Recommendation
673697

674-
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
698+
It's recommended to create an instance of `ApiClient` per thread in a multi-threaded environment to avoid any potential issues.
675699

676700
## Author
677701

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ if(hasProperty('target') && target == 'android') {
9898
}
9999

100100
dependencies {
101-
compile 'io.swagger:swagger-annotations:1.5.24'
102101
compile "com.google.code.findbugs:jsr305:3.0.2"
103-
compile 'com.squareup.okhttp3:okhttp:3.14.7'
104-
compile 'com.squareup.okhttp3:logging-interceptor:3.14.7'
105-
compile 'com.google.code.gson:gson:2.8.6'
102+
compile 'com.squareup.okhttp3:okhttp:4.9.3'
103+
compile 'com.squareup.okhttp3:logging-interceptor:4.9.3'
104+
compile 'com.google.code.gson:gson:2.10'
106105
compile 'io.gsonfire:gson-fire:1.8.4'
106+
compile 'commons-codec:commons-codec:1.14'
107107
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'
108108
testCompile 'junit:junit:4.13'
109109
}

build.sbt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ lazy val root = (project in file(".")).
99
publishArtifact in (Compile, packageDoc) := false,
1010
resolvers += Resolver.mavenLocal,
1111
libraryDependencies ++= Seq(
12-
"io.swagger" % "swagger-annotations" % "1.5.24",
13-
"com.squareup.okhttp3" % "okhttp" % "3.14.7",
14-
"com.squareup.okhttp3" % "logging-interceptor" % "3.14.7",
15-
"com.google.code.gson" % "gson" % "2.8.6",
12+
"com.squareup.okhttp3" % "okhttp" % "4.9.3",
13+
"com.squareup.okhttp3" % "logging-interceptor" % "4.9.3",
14+
"com.google.code.gson" % "gson" % "2.10",
1615
"org.apache.commons" % "commons-lang3" % "3.10",
16+
"commons-codec" % "commons-codec" % "1.14",
1717
"io.gsonfire" % "gson-fire" % "1.8.3" % "compile",
1818
"javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
1919
"com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile",

0 commit comments

Comments
 (0)