public class IDexAPI extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ETH_ADR |
| Constructor and Description |
|---|
IDexAPI() |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Outcome> |
cancel(org.web3j.crypto.Credentials credentials,
String orderHash)
Cancels an order associated with the address.
|
CompletableFuture<Outcome> |
cancel(String orderHash,
String address,
long nonce,
byte v,
byte[] r,
byte[] s)
Cancels an order associated with the address.
|
CompletableFuture<Order> |
order(org.web3j.crypto.Credentials credentials,
String tokenBuy,
BigInteger amountBuy,
String tokenSell,
BigInteger amountSell,
Long expires)
Places a limit order on IDEX.
|
CompletableFuture<Order> |
order(org.web3j.crypto.Credentials credentials,
String contractAdress,
long nonce,
String tokenBuy,
BigInteger amountBuy,
String tokenSell,
BigInteger amountSell,
Long expires)
Places a limit order on IDEX.
|
CompletableFuture<Order> |
order(String tokenBuy,
BigInteger amountBuy,
String tokenSell,
BigInteger amountSell,
String address,
long nonce,
long expires,
byte v,
byte[] r,
byte[] s)
Places a limit order on IDEX.
|
CompletableFuture<Volume> |
return24Volume()
Returns the 24-hour volume for all markets, plus totals for primary
currencies.
|
CompletableFuture<Map<String,BigDecimal>> |
returnBalances(String address)
Returns available balances for an address(total deposited minus amount in
open orders) indexed by token symbol.
|
CompletableFuture<Map<String,BalanceOrder>> |
returnCompleteBalances(String address)
Returns available balances for an address along with the amount of open
orders for each token, indexed by token symbol.
|
CompletableFuture<String> |
returnContractAddress()
Returns the lowest nonce that you can use from the given address in one of
the contract-backed trade functions.
|
CompletableFuture<Map<String,Currency>> |
returnCurrencies()
Returns an object of token data indexed by symbol.
|
CompletableFuture<DepositsWithdrawals> |
returnDepositsWithdrawals(String address,
LocalDateTime start,
LocalDateTime end)
Returns your deposit and withdrawal history within a range, specified by
the "start" and "end" optional properties.
|
CompletableFuture<Long> |
returnNextNonce(String address)
Returns the lowest nonce that you can use from the given address in one of
the contract-backed trade functions.
|
CompletableFuture<List<Order>> |
returnOpenOrders(String market,
String address,
Integer count,
Long cursor)
Returns a paginated list of all open orders for a given market or address.
|
CompletableFuture<OrderBook> |
returnOrderBook(String market,
Integer count)
Returns the best-priced open orders for a given market.
|
CompletableFuture<Order> |
returnOrderStatus(String orderHash)
Returns a single order.
|
CompletableFuture<List<OrderTrade>> |
returnOrderTrades(String orderHash)
Returns all trades involving a given order hash.
|
CompletableFuture<Ticker> |
returnTicker(String market)
Designed to behave similar to the API call of the same name provided by
the Poloniex HTTP API, with the addition of highs and lows.
|
CompletableFuture<List<TradeHistory>> |
returnTradeHistory(String market,
String address,
LocalDateTime start,
LocalDateTime end,
String sort,
Integer count,
Long cursor)
Returns a paginated list of all trades for a given market or address,
sorted by date.
|
CompletableFuture<List<TradeHistory>> |
returnTradeHistory(String market,
String address,
Long start,
Long end,
String sort,
Integer count,
Long cursor)
Returns a paginated list of all trades for a given market or address,
sorted by date.
|
CompletableFuture<Outcome> |
withdraw(org.web3j.crypto.Credentials credentials,
BigInteger amount,
String token)
Withdraws funds associated with the address.
|
CompletableFuture<Outcome> |
withdraw(org.web3j.crypto.Credentials credentials,
String contractAddress,
BigInteger amount,
String token,
long nonce)
Withdraws funds associated with the address.
|
CompletableFuture<Outcome> |
withdraw(String address,
BigInteger amount,
String token,
long nonce,
byte v,
byte[] r,
byte[] s)
Withdraws funds associated with the address.
|
public static final String DEFAULT_ETH_ADR
public CompletableFuture<Order> order(String tokenBuy, BigInteger amountBuy, String tokenSell, BigInteger amountSell, String address, long nonce, long expires, byte v, byte[] r, byte[] s)
tokenBuy - The address of the token you will receive as a result of the
trade.amountBuy - The amount of the token you will receive when the order is fully
filled.tokenSell - The address of the token you will lose as a result of the tradeamountSell - The amount of the token you will give up when the order is fully
filledaddress - The address you are posting the order fromnonce - One time number associated with the limit orderexpires - DEPRECATED this property has no effect on your limit order but
is still REQUIRED to submit a limit order as it is one of the
parameters that is hashedv - Derived from signing the hash of the messager - Derived from signing the hash of the messages - Derived from signing the hash of the messagepublic CompletableFuture<Order> order(org.web3j.crypto.Credentials credentials, String contractAdress, long nonce, String tokenBuy, BigInteger amountBuy, String tokenSell, BigInteger amountSell, Long expires)
credentials - Wallet credentialscontractAdress - The contract address used for depositing, withdrawing, and
posting orders. Can get from returnContractAddressnonce - One time numeric value associated with your address. Can get
from returnNextNonce.tokenBuy - The address of the token you will receive as a result of the
trade.amountBuy - The amount of the token you will receive when the order is fully
filled.tokenSell - The address of the token you will lose as a result of the tradeamountSell - The amount of the token you will give up when the order is fully
filledexpires - DEPRECATED this property has no effect on your limit order but
is still REQUIRED to submit a limit order as it is one of the
parameters that is hashedpublic CompletableFuture<Order> order(org.web3j.crypto.Credentials credentials, String tokenBuy, BigInteger amountBuy, String tokenSell, BigInteger amountSell, Long expires)
credentials - Wallet credentialstokenBuy - The address of the token you will receive as a result of the
trade.amountBuy - The amount of the token you will receive when the order is fully
filled.tokenSell - The address of the token you will lose as a result of the tradeamountSell - The amount of the token you will give up when the order is fully
filledexpires - DEPRECATED this property has no effect on your limit order but
is still REQUIRED to submit a limit order as it is one of the
parameters that is hashedpublic CompletableFuture<Outcome> cancel(String orderHash, String address, long nonce, byte v, byte[] r, byte[] s)
orderHash - The raw hash of the order you are cancelling.address - The address you are sending the cancel from must own the order.nonce - One time number associated with the address.v - Derived from signing the hash of the message.r - Derived from signing the hash of the message.s - Derived from signing the hash of the message.public CompletableFuture<Outcome> cancel(org.web3j.crypto.Credentials credentials, String orderHash)
credentials - Wallet credentialsorderHash - The raw hash of the order you are cancelling.public CompletableFuture<Outcome> withdraw(String address, BigInteger amount, String token, long nonce, byte v, byte[] r, byte[] s)
address - The address you are transacting from.amount - The raw amount you are withdrawing, not adjusted for token
precision.token - The address of the token you are withdrawing from, Constant
(IDexAPI.DEFAULT_ETH_ADR) for ETH.nonce - One time numeric value associated with your address. Can get
from returnNextNonce.v - Value obtained from signing message hash.r - Value obtained from signing message hash.s - Value obtained from signing message hash.public CompletableFuture<Outcome> withdraw(org.web3j.crypto.Credentials credentials, String contractAddress, BigInteger amount, String token, long nonce)
credentials - Wallet credentialscontractAddress - The contract address used for depositing, withdrawing, and
posting orders. Can get from returnContractAddressamount - The raw amount you are withdrawing, not adjusted for token
precision.token - The address of the token you are withdrawing from, Constant
(IDexAPI.DEFAULT_ETH_ADR) for ETH.nonce - One time numeric value associated with your address. Can get
from returnNextNonce.public CompletableFuture<Outcome> withdraw(org.web3j.crypto.Credentials credentials, BigInteger amount, String token)
credentials - Wallet credentialsamount - The raw amount you are withdrawing, not adjusted for token
precision.token - The address of the token you are withdrawing from, Constant
(IDexAPI.DEFAULT_ETH_ADR) for ETH.public CompletableFuture<Long> returnNextNonce(String address)
address - Ethereum Address to get nounce forpublic CompletableFuture<String> returnContractAddress()
public CompletableFuture<OrderBook> returnOrderBook(String market, Integer count)
market - Market paircount - Number of records to be returned per asks/bids segment.public CompletableFuture<List<Order>> returnOpenOrders(String market, String address, Integer count, Long cursor)
market - Required if address not specified.address - Required if market not specified. Returns all open orders placed
by the given address.count - Number of records to be returned per request. Default 10cursor - For pagination. Provide the value returned in the
idex-next-cursor HTTP header to request the next slice (or
page). This endpoint uses the orderNumber property of a record
for the cursor.public CompletableFuture<Order> returnOrderStatus(String orderHash)
orderHash - OrderHashpublic CompletableFuture<List<OrderTrade>> returnOrderTrades(String orderHash)
orderHash - The order hash to query for associated trades.public CompletableFuture<List<TradeHistory>> returnTradeHistory(String market, String address, Long start, Long end, String sort, Integer count, Long cursor)
market - Required if address not specified.address - Required if market not specified. Returns all trades that
involve the given address as the maker or taker. Note - When
querying by address, the type property of a trade refers to the
action taken by the user, and not relative to the market. This
behavior is designed to mirror the "My Trades" section of the
IDEX website.start - Unix timestamp (in seconds) marking the time of the oldest trade
that will be included.end - Unix timestamp (in seconds) marking the time of the newest trade
that will be included.sort - Possible values are asc (oldest first) and desc (newest first).
Defaults to desc.count - Number of records to be returned per request. [1..100]cursor - For pagination. Provide the value returned in the
idex-next-cursor HTTP header to request the next slice (or
page). This endpoint uses the tid property of a record for the
cursor.public CompletableFuture<List<TradeHistory>> returnTradeHistory(String market, String address, LocalDateTime start, LocalDateTime end, String sort, Integer count, Long cursor)
market - Required if address not specified.address - Required if market not specified. Returns all trades that
involve the given address as the maker or taker. Note - When
querying by address, the type property of a trade refers to the
action taken by the user, and not relative to the market. This
behavior is designed to mirror the "My Trades" section of the
IDEX website.start - Unix timestamp (in seconds) marking the time of the oldest trade
that will be included.end - Unix timestamp (in seconds) marking the time of the newest trade
that will be included.sort - Possible values are asc (oldest first) and desc (newest first).
Defaults to desc.count - Number of records to be returned per request. [1..100]cursor - For pagination. Provide the value returned in the
idex-next-cursor HTTP header to request the next slice (or
page). This endpoint uses the tid property of a record for the
cursor.public CompletableFuture<DepositsWithdrawals> returnDepositsWithdrawals(String address, LocalDateTime start, LocalDateTime end)
address - Address of the walletstart - Optional Inclusive starting UNIX timestamp of returned resultend - Optional Inclusive ending UNIX timestamp of returned results.
Defaults to current timestamppublic CompletableFuture<Map<String,BalanceOrder>> returnCompleteBalances(String address)
address - ETH Addresspublic CompletableFuture<Map<String,BigDecimal>> returnBalances(String address)
address - ETH Addresspublic CompletableFuture<Volume> return24Volume()
public CompletableFuture<Map<String,Currency>> returnCurrencies()
public CompletableFuture<Ticker> returnTicker(String market)
market - Market eg. ETH_SAN, ETH_AURACopyright © 2019. All rights reserved.