-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4766 from bigscoop/gateio-v4
[gateio] [gateio-streaming] Add gate.io api v4, gate.io streaming support
- Loading branch information
Showing
218 changed files
with
7,814 additions
and
667 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,12 @@ bin/ | |
log/ | ||
classes/ | ||
|
||
# maven wrapper | ||
.mvn | ||
mvnw | ||
mvnw.cmd | ||
|
||
|
||
# Misc. | ||
.DS_Store | ||
*.swp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
http-client.private.env.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Gate.io Exchange API V4 specification | ||
================================ | ||
|
||
Public API | ||
|
||
Documentation | ||
------------- | ||
https://www.gate.io/docs/developers/apiv4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"default": { | ||
"api_key": "replace_me", | ||
"api_secret": "replace_me" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"default": { | ||
"api_v4": "https://api.gateio.ws/api/v4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lombok.equalsAndHashCode.callSuper = call | ||
lombok.tostring.callsuper = call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.knowm.xchange</groupId> | ||
<artifactId>xchange-parent</artifactId> | ||
<version>5.1.2-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>xchange-gateio-v4</artifactId> | ||
|
||
<name>XChange Gate.io V4</name> | ||
<description>XChange implementation for the Gate.io Exchange</description> | ||
|
||
<properties> | ||
<version.maven-enforcer-plugin>3.2.1</version.maven-enforcer-plugin> | ||
<version.mockito>5.3.1</version.mockito> | ||
<version.sortpom-maven-plugin>3.2.0</version.sortpom-maven-plugin> | ||
</properties> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>com.fasterxml.jackson.datatype</groupId> | ||
<artifactId>jackson-datatype-jsr310</artifactId> | ||
<version>${version.fasterxml}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.github.resilience4j</groupId> | ||
<artifactId>resilience4j-ratelimiter</artifactId> | ||
<version>${version.resilience4j}</version> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.github.resilience4j</groupId> | ||
<artifactId>resilience4j-retry</artifactId> | ||
<version>${version.resilience4j}</version> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.knowm.xchange</groupId> | ||
<artifactId>xchange-core</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-junit-jupiter</artifactId> | ||
<version>${version.mockito}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.wiremock</groupId> | ||
<artifactId>wiremock</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.github.ekryd.sortpom</groupId> | ||
<artifactId>sortpom-maven-plugin</artifactId> | ||
<version>${version.sortpom-maven-plugin}</version> | ||
<configuration> | ||
<sortProperties>true</sortProperties> | ||
<createBackupFile>false</createBackupFile> | ||
<sortDependencies>groupId,artifactId</sortDependencies> | ||
<sortModules>true</sortModules> | ||
<nrOfIndentSpace>4</nrOfIndentSpace> | ||
<sortPlugins>groupId,artifactId</sortPlugins> | ||
<expandEmptyElements>false</expandEmptyElements> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>sort</goal> | ||
</goals> | ||
<phase>verify</phase> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-enforcer-plugin</artifactId> | ||
<version>${version.maven-enforcer-plugin}</version> | ||
<executions> | ||
<execution> | ||
<id>enforce</id> | ||
<goals> | ||
<goal>enforce</goal> | ||
</goals> | ||
<configuration> | ||
<rules> | ||
<dependencyConvergence/> | ||
<banDuplicatePomDependencyVersions/> | ||
<reactorModuleConvergence/> | ||
</rules> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
</plugins> | ||
</build> | ||
|
||
</project> |
52 changes: 52 additions & 0 deletions
52
xchange-gateio-v4/src/main/java/org/knowm/xchange/gateio/Gateio.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package org.knowm.xchange.gateio; | ||
|
||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.PathParam; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.QueryParam; | ||
import jakarta.ws.rs.core.MediaType; | ||
import org.knowm.xchange.gateio.dto.GateioException; | ||
import org.knowm.xchange.gateio.dto.marketdata.*; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
@Path("api/v4") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
public interface Gateio { | ||
|
||
@GET | ||
@Path("spot/currencies") | ||
List<GateioCurrencyInfo> getCurrencies() throws IOException, GateioException; | ||
|
||
|
||
@GET | ||
@Path("spot/order_book") | ||
GateioOrderBook getOrderBook( | ||
@QueryParam("currency_pair") String currencyPair, | ||
@QueryParam("with_id") Boolean withId | ||
) throws IOException, GateioException; | ||
|
||
|
||
@GET | ||
@Path("wallet/currency_chains") | ||
List<GateioCurrencyChain> getCurrencyChains(@QueryParam("currency") String currency) throws IOException, GateioException; | ||
|
||
|
||
@GET | ||
@Path("spot/currency_pairs") | ||
List<GateioCurrencyPairDetails> getCurrencyPairDetails() throws IOException, GateioException; | ||
|
||
|
||
@GET | ||
@Path("spot/currency_pairs/{currency_pair}") | ||
GateioCurrencyPairDetails getCurrencyPairDetails(@PathParam("currency_pair") String currencyPair) throws IOException, GateioException; | ||
|
||
|
||
@GET | ||
@Path("spot/tickers") | ||
List<GateioTicker> getTickers(@QueryParam("currency_pair") String currencyPair) throws IOException, GateioException; | ||
|
||
|
||
} |
Oops, something went wrong.