com.codemonkeylab.idex:java-api-idex

JAVA wrapper of the IDEX market interface

Лицензия

Лицензия

Категории

Категории

IDE Инструменты разработки Java Языки программирования KeY Данные Data Formats Formal Verification Dex Универсальные библиотеки Utility
Группа

Группа

com.codemonkeylab.idex
Идентификатор

Идентификатор

java-api-idex
Последняя версия

Последняя версия

0.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

com.codemonkeylab.idex:java-api-idex
JAVA wrapper of the IDEX market interface
Ссылка на сайт

Ссылка на сайт

https://github.com/CodeMonkeyLab/java-api-idex/
Система контроля версий

Система контроля версий

https://github.com/CodeMonkeyLab/java-api-idex

Скачать java-api-idex

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.codemonkeylab.idex/java-api-idex/ -->
<dependency>
    <groupId>com.codemonkeylab.idex</groupId>
    <artifactId>java-api-idex</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.codemonkeylab.idex/java-api-idex/
implementation 'com.codemonkeylab.idex:java-api-idex:0.1.0'
// https://jarcasting.com/artifacts/com.codemonkeylab.idex/java-api-idex/
implementation ("com.codemonkeylab.idex:java-api-idex:0.1.0")
'com.codemonkeylab.idex:java-api-idex:jar:0.1.0'
<dependency org="com.codemonkeylab.idex" name="java-api-idex" rev="0.1.0">
  <artifact name="java-api-idex" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.codemonkeylab.idex', module='java-api-idex', version='0.1.0')
)
libraryDependencies += "com.codemonkeylab.idex" % "java-api-idex" % "0.1.0"
[com.codemonkeylab.idex/java-api-idex "0.1.0"]

Зависимости

compile (5)

Идентификатор библиотеки Тип Версия
com.fasterxml.jackson.core : jackson-core jar 2.9.9
com.fasterxml.jackson.core : jackson-databind jar 2.9.9
org.web3j : crypto jar 4.3.1
org.asynchttpclient : async-http-client jar 2.10.0
org.slf4j : slf4j-api jar 1.7.25

test (5)

Идентификатор библиотеки Тип Версия
org.junit.jupiter : junit-jupiter-api jar 5.3.2
org.junit.jupiter : junit-jupiter-engine jar 5.3.2
org.junit.vintage : junit-vintage-engine jar 5.3.2
org.junit.platform : junit-platform-launcher jar 1.3.2
org.junit.platform : junit-platform-runner jar 1.3.2

Модули Проекта

Данный проект не имеет модулей.

java-api-idex

IDEX API JAVA

This library uses the IDEX API.

Installation

Using Maven

Add the following dependency to your project's Maven pom.xml:

<dependency>
	<groupId>com.codemonkeylab.idex</groupId>
	<artifactId>java-api-idex</artifactId>
	<version>0.1.0</version>
</dependency>

Usage

You will need a Ethereum private key with some ether loaded to trade. Some interactions (read) does not require private key.

import org.web3j.crypto.Credentials;
import com.cml.idex.IDexAPI;

final Credentials credentials = Credentials.create("WALLET_PRIVATE_KEY");
final IDexAPI idex = new IDexAPI();
try {
   // Your code here
}
finally {
   idex.shutdown();
}

When interacting with ETH trading pair use the IDexAPI.DEFAULT_ETH_ADR as the token address.

Examples

Balance

Returns available balances for an address(total deposited minus amount in open orders) indexed by token symbol.

import com.cml.idex.IDexAPI;

final IDexAPI idex = new IDexAPI();
try {
   CompletableFuture<Map<String, BigDecimal>> balFuture = idex.returnBalances("ETH_ADR");
   balFuture.get().entrySet()
      .forEach(entry -> System.out.println("ERC20: " + entry.getKey() + ", Balance: " + entry.getValue()));
} catch (InterruptedException | ExecutionException e) {
   e.printStackTrace();
} finally {
   idex.shutdown();
}

IDEX Contract Address

Returns the contract address used for depositing, withdrawing, and posting orders.

import com.cml.idex.IDexAPI;

final IDexAPI idex = new IDexAPI();
try {
   System.out.println("IDEX Contract Address : " + idex.returnContractAddress().get());
} catch (InterruptedException | ExecutionException e) {
   e.printStackTrace();
} finally {
   idex.shutdown();
}

Trade History for Market

To get trading history for Token Pair. The Results object returned allows you paginate through the results.

import com.cml.idex.IDexAPI;

final IDexAPI idex = new IDexAPI();
try {
   // Market History for ETH_ZCC
   CompletableFuture<Page<List<TradeHistory>>> tradeHistoryF = idex.returnTradeHistoryPage("ETH_ZCC", null,
            LocalDateTime.of(2019, 1, 1, 1, 1), LocalDateTime.now(), SortOrder.ASC, 50);

   future.join();

   while (tradeHistoryF.get().getResults() != null && !tradeHistoryF.get().getResults().isEmpty()) {
      // Current page
      final Page<List<TradeHistory>> page = tradeHistoryF.get();
      // Results for this page
      final List<TradeHistory> trades = page.getResults();
      
      System.out.println("Size = " + trades.size());
      // Return the next Page results
      tradeHistoryF = page.nextPage();
      tradeHistoryF.join();
   }
} catch (InterruptedException | ExecutionException e) {
   e.printStackTrace();
} finally {
   idex.shutdown();
}

Версии библиотеки

Версия
0.1.0
0.0.3
0.0.2