-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'knowm-develop' into enforcer-plugin
- Loading branch information
Showing
71 changed files
with
2,691 additions
and
1 deletion.
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
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 @@ | ||
# private properties for idea rest client | ||
http-client.private.env.json | ||
|
||
# private properties for integration tests | ||
integration-test.env.properties |
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,21 @@ | ||
## Using IntelliJ Idea HTTP client | ||
|
||
There are *.http files stored in `src/test/resources/rest` that can be used with IntelliJ Idea HTTP Client. | ||
|
||
Some requests need authorization, so the api credentials have to be stored in `http-client.private.env.json` in module's root. Sample content can be found in `example.http-client.private.env.json` | ||
|
||
> [!CAUTION] | ||
> Never commit your api credentials to the repository! | ||
|
||
[HTTP Client documentation](https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html) | ||
|
||
## Running integration tests that require API keys | ||
|
||
Integration tests that require API keys read them from environment variables. They can be defined in `integration-test.env.properties`. Sample content can be found in `example.integration-test.env.properties`. | ||
|
||
If no keys are provided the integration tests that need them are skipped. | ||
|
||
> [!CAUTION] | ||
> Never commit your api credentials to the repository! | ||
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,7 @@ | ||
{ | ||
"default": { | ||
"api_key": "change_me", | ||
"api_secret": "change_me", | ||
"api_passphrase": "change_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,3 @@ | ||
apiKey=change_me | ||
secretKey=change_me | ||
passphrase=change_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_host": "https://api.bitget.com" | ||
} | ||
} |
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,73 @@ | ||
<?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.2.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>xchange-bitget</artifactId> | ||
|
||
<name>XChange Bitget</name> | ||
<description>XChange implementation for the Bitget Exchange</description> | ||
|
||
<url>http://knowm.org/open-source/xchange/</url> | ||
<inceptionYear>2012</inceptionYear> | ||
|
||
<organization> | ||
<name>Knowm Inc.</name> | ||
<url>http://knowm.org/open-source/xchange/</url> | ||
</organization> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>com.fasterxml.jackson.datatype</groupId> | ||
<artifactId>jackson-datatype-jsr310</artifactId> | ||
<version>${version.fasterxml}</version> | ||
</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> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.wiremock</groupId> | ||
<artifactId>wiremock</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
|
||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<configuration> | ||
<systemPropertiesFile>integration-test.env.properties</systemPropertiesFile> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
|
||
</build> | ||
|
||
</project> |
50 changes: 50 additions & 0 deletions
50
xchange-bitget/src/main/java/org/knowm/xchange/bitget/Bitget.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,50 @@ | ||
package org.knowm.xchange.bitget; | ||
|
||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.QueryParam; | ||
import jakarta.ws.rs.core.MediaType; | ||
import java.io.IOException; | ||
import java.util.List; | ||
import org.knowm.xchange.bitget.dto.BitgetException; | ||
import org.knowm.xchange.bitget.dto.BitgetResponse; | ||
import org.knowm.xchange.bitget.dto.marketdata.BitgetCoinDto; | ||
import org.knowm.xchange.bitget.dto.marketdata.BitgetMarketDepthDto; | ||
import org.knowm.xchange.bitget.dto.marketdata.BitgetServerTime; | ||
import org.knowm.xchange.bitget.dto.marketdata.BitgetSymbolDto; | ||
import org.knowm.xchange.bitget.dto.marketdata.BitgetTickerDto; | ||
|
||
@Path("") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
public interface Bitget { | ||
|
||
@GET | ||
@Path("api/v2/public/time") | ||
BitgetResponse<BitgetServerTime> serverTime() throws IOException, BitgetException; | ||
|
||
|
||
@GET | ||
@Path("api/v2/spot/public/coins") | ||
BitgetResponse<List<BitgetCoinDto>> coins(@QueryParam("coin") String coin) throws IOException, BitgetException; | ||
|
||
|
||
@GET | ||
@Path("api/v2/spot/public/symbols") | ||
BitgetResponse<List<BitgetSymbolDto>> symbols(@QueryParam("symbol") String symbol) | ||
throws IOException, BitgetException; | ||
|
||
|
||
@GET | ||
@Path("api/v2/spot/market/tickers") | ||
BitgetResponse<List<BitgetTickerDto>> tickers(@QueryParam("symbol") String symbol) | ||
throws IOException, BitgetException; | ||
|
||
|
||
@GET | ||
@Path("api/v2/spot/market/orderbook") | ||
BitgetResponse<BitgetMarketDepthDto> orderbook(@QueryParam("symbol") String symbol) | ||
throws IOException, BitgetException; | ||
|
||
|
||
} |
Oops, something went wrong.