public final class CoinExchange
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CoinExchange.Event |
static class |
CoinExchange.Order
Define a coin exchange order
'id' and 'fullHash' identify the coin exchange order
'chainId' is the chain identifier for the coin being exchanged
'exchangeId' is the chain identifier for the requested coin
'quantity' is the number of coins being exchanged (updated after each trade)
'bidPrice' is the bid price for the requested coin and is the exchange order price
'askPrice' is the ask price for coin being exchanged and is 1/bidPrice
|
static class |
CoinExchange.Trade
Define a coin exchange trade
A coin exchange consists of two trades.
|
Modifier and Type | Field and Description |
---|---|
static int |
AMOUNT_RESERVE |
Modifier and Type | Method and Description |
---|---|
static boolean |
addListener(Listener<CoinExchange.Trade> listener,
CoinExchange.Event eventType) |
static CoinExchange.Order |
getOrder(long orderId)
Return a coin exchange order
|
static int |
getOrderCount()
Return the number of coin exchange orders
|
static DbIterator<CoinExchange.Order> |
getOrders(long accountId,
int chainId,
int exchangeId,
int from,
int to)
Return orders matching the supplied criteria.
|
static CoinExchange.Trade |
getTrade(byte[] orderFullHash,
byte[] matchFullHash)
Return a coin exchange trade
|
static int |
getTradeCount()
Return the number of coin exchange trades
|
static DbIterator<CoinExchange.Trade> |
getTrades(long accountId,
int chainId,
int exchangeId,
byte[] orderFullHash,
int from,
int to)
Return trades matching the supplied criteria.
|
static void |
init() |
static boolean |
removeListener(Listener<CoinExchange.Trade> listener,
CoinExchange.Event eventType) |
public static final int AMOUNT_RESERVE
public static boolean addListener(Listener<CoinExchange.Trade> listener, CoinExchange.Event eventType)
public static boolean removeListener(Listener<CoinExchange.Trade> listener, CoinExchange.Event eventType)
public static void init()
public static int getOrderCount()
public static CoinExchange.Order getOrder(long orderId)
orderId
- Order identifierpublic static DbIterator<CoinExchange.Order> getOrders(long accountId, int chainId, int exchangeId, int from, int to)
accountId
- Account identifier (0 if no account criteria)chainId
- Chain identifier (0 if no chain criteria)exchangeId
- Exchange identifier (0 if no exchange criteria)from
- Starting index within search resultsto
- Ending index within search resultspublic static CoinExchange.Trade getTrade(byte[] orderFullHash, byte[] matchFullHash)
orderFullHash
- Coin exchange order full hashmatchFullHash
- Matching order full hashpublic static int getTradeCount()
public static DbIterator<CoinExchange.Trade> getTrades(long accountId, int chainId, int exchangeId, byte[] orderFullHash, int from, int to)
accountId
- Account identifier (0 if no account criteria)chainId
- Chain identifier (0 if no chain criteria)exchangeId
- Exchange identifier (0 if no exchange criteria)orderFullHash
- Coin exchange order full hash (null or zero-length if no order criteria)from
- Starting index within search resultsto
- Ending index within search results