11# gate-api
22
33Gate API v4
4+
45- API version: 4.86.0
6+ - SDK version: 6.86.0
57
68Welcome 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
3950Add 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
7398Please follow the [ installation] ( #installation ) instruction and execute the following Java code:
7499
75- ``` java
76100
101+ ``` java
77102// Import classes:
78103import io.gate.gateapi.ApiClient ;
79104import io.gate.gateapi.ApiException ;
80105import io.gate.gateapi.Configuration ;
106+ import io.gate.gateapi.GateApiException ;
81107import io.gate.gateapi.auth.* ;
82108import io.gate.gateapi.models.* ;
83109import io.gate.gateapi.api.AccountApi ;
84110
85111public 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
114140All URIs are relative to * https://api.gateio.ws/api/v4 *
@@ -662,16 +688,14 @@ Class | Method | HTTP request | Description
662688## Documentation for Authorization
663689
664690Authentication 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
0 commit comments