public class CHBTCClient extends Object implements AutoCloseable
| Constructor and Description |
|---|
CHBTCClient(String accessKey,
String secretKey,
int socketTimeout,
int connectTimeout,
int connectionRequestTimeout) |
CHBTCClient(String tradeApiUrl,
String accessKey,
String secretKey,
int socketTimeout,
int connectTimeout,
int connectionRequestTimeout) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelOrder(long id,
String currency)
取消委托买单或卖单。
|
void |
close() |
AccountInfo |
getAccountInfo()
获取用户信息。
|
Depth |
getDepth()
Deprecated.
|
Depth |
getDepth(String currency)
Deprecated.
|
Order |
getOrder(long id,
String currency)
获取委托买单或卖单。
|
List<Order> |
getOrders(Type tradeType,
String currency,
int pageIndex)
获取多个委托买单或卖单,每次请求返回 10 条记录。
|
List<Order> |
getOrdersIgnoreTradeType(String currency,
int pageIndex,
int pageSize)
与 gerOrders 的区别是取消 tradeType 字段过滤,可同时获取买单和卖单。
|
List<Order> |
getOrdersNew(Type tradeType,
String currency,
int pageIndex,
int pageSize)
获取多个委托买单或卖单,每次请求返回 pageSize<=100 条记录。
|
Ticker |
getTicker()
Deprecated.
Use
CHBTCMarketDataServiceRaw.getTicker(CurrencyPair) instead. |
Ticker |
getTicker(String currency)
Deprecated.
Use
CHBTCMarketDataServiceRaw.getTicker(CurrencyPair) instead. |
List<Trade> |
getTrades()
Deprecated.
|
List<Trade> |
getTrades(int since)
Deprecated.
|
List<Trade> |
getTrades(String currency)
Deprecated.
|
List<Trade> |
getTrades(String currency,
int since)
Deprecated.
|
List<Order> |
getUnfinishedOrdersIgnoreTradeType(String currency,
int pageIndex,
int pageSize)
获取未成交或部份成交的买单和卖单,每次请求返回 pageSize<=100 条记录。
|
long |
order(BigDecimal price,
BigDecimal amount,
Type tradeType,
String currency)
委托 BTC/LTC 买单或卖单。
|
public static final String ENCODING
public CHBTCClient(String accessKey, String secretKey, int socketTimeout, int connectTimeout, int connectionRequestTimeout)
@Deprecated public Ticker getTicker() throws IOException
CHBTCMarketDataServiceRaw.getTicker(CurrencyPair) instead.IOException - indicates I/O exception.@Deprecated public Ticker getTicker(String currency) throws IOException
CHBTCMarketDataServiceRaw.getTicker(CurrencyPair) instead.currency - the currency symbol of the tradable, could be BTC or LTC.IOException - indicates I/O exception.@Deprecated public Depth getDepth() throws IOException
CHBTCMarketDataService.getOrderBook(CurrencyPair, Object...) instead.IOException - indicates I/O exception.@Deprecated public Depth getDepth(String currency) throws IOException
CHBTCMarketDataService.getOrderBook(CurrencyPair, Object...) instead.currency - the currency symbol of the tradable, could be BTC or LTC.IOException - indicates I/O exception.@Deprecated public List<Trade> getTrades() throws IOException
CHBTCMarketDataService.getTrades(CurrencyPair, Object...) instead.IOException - indicates I/O exception.@Deprecated public List<Trade> getTrades(int since) throws IOException
CHBTCMarketDataService.getTrades(CurrencyPair, Object...) instead.since - 1 based. When pass 1, will get trades from the first trade of CHBTC.IOException - indicates I/O exception.@Deprecated public List<Trade> getTrades(String currency) throws IOException
CHBTCMarketDataService.getTrades(CurrencyPair, Object...) instead.currency - the currency symbol of the tradable, could be BTC or LTC.IOException - indicates I/O exception.@Deprecated public List<Trade> getTrades(String currency, int since) throws IOException
CHBTCMarketDataService.getTrades(CurrencyPair, Object...) instead.currency - the currency symbol of the tradable, could be BTC or LTC.since - 1 based. When pass 1, will get trades from the first trade of CHBTC.IOException - indicates I/O exception.public void close()
throws IOException
close in interface AutoCloseableIOExceptionpublic long order(BigDecimal price, BigDecimal amount, Type tradeType, String currency) throws IOException
price - 单价。amount - 交易数量。tradeType - 交易类型 1/0[buy/sell]currency - 交易类型(目前仅支持 BTC/LTC)。IOException - indicates I/O exception.public void cancelOrder(long id,
String currency)
throws IOException
id - 挂单 ID。currency - 交易类型(目前仅支持 BTC/LTC)。IOException - indicates I/O exception.public Order getOrder(long id, String currency) throws IOException
id - 挂单 ID。currency - 交易类型(目前仅支持 BTC/LTC)。IOException - indicates I/O exception.public List<Order> getOrders(Type tradeType, String currency, int pageIndex) throws IOException
tradeType - 交易类型 1/0[buy/sell]。currency - 交易类型(目前仅支持 BTC/LTC)。pageIndex - 当前页数。IOException - indicates I/O exception.public List<Order> getOrdersNew(Type tradeType, String currency, int pageIndex, int pageSize) throws IOException
tradeType - 交易类型 1/0[buy/sell]。currency - 交易类型(目前仅支持 BTC/LTC)。pageIndex - 当前页数。pageSize - 每页数量。IOException - indicates I/O exception.public List<Order> getOrdersIgnoreTradeType(String currency, int pageIndex, int pageSize) throws IOException
currency - 交易类型(目前仅支持 BTC/LTC)。pageIndex - 当前页数。pageSize - 每页数量。IOException - indicates I/O exception.public List<Order> getUnfinishedOrdersIgnoreTradeType(String currency, int pageIndex, int pageSize) throws IOException
currency - 交易类型(目前仅支持 BTC/LTC)。pageIndex - 当前页数。pageSize - 每页数量。IOException - indicates I/O exception.public AccountInfo getAccountInfo() throws IOException
IOException - indicates I/O exception.Copyright © 2013–2015. All rights reserved.