public interface OKCoin
Modifier and Type | Method and Description |
---|---|
BatchTradeResult |
batchTrade(String apiKey,
String symbol,
Type type,
String ordersData,
si.mazi.rescu.ParamsDigest sign)
Batch trade.
|
BorrowResult |
borrowMoney(String apiKey,
String symbol,
String days,
BigDecimal amount,
BigDecimal rate,
si.mazi.rescu.ParamsDigest sign)
Request borrow.
|
BorrowResult |
cancelBorrow(String apiKey,
String symbol,
long borrowId,
si.mazi.rescu.ParamsDigest sign)
Cancel borrow order.
|
CancelOrderResult |
cancelOrder(String apiKey,
String symbol,
String orderId,
si.mazi.rescu.ParamsDigest sign)
Cancel orders.
|
Withdrawal |
cancelWithdraw(String apiKey,
String symbol,
long withdrawId,
si.mazi.rescu.ParamsDigest sign)
Withdrawal Cancellation Request.
|
AccountRecords |
getAccountRecords(String apiKey,
String symbol,
int type,
int currentPage,
int pageLength,
si.mazi.rescu.ParamsDigest sign)
Get user deposits or withdraw Records.
|
BorrowOrderInfo |
getBorrowOrderInfo(String apiKey,
long borrowId,
si.mazi.rescu.ParamsDigest sign)
Get borrowing order info.
|
BorrowsInfo |
getBorrowsInfo(String apiKey,
String symbol,
si.mazi.rescu.ParamsDigest sign)
Get user borrow information.
|
CandlestickChart |
getCandlestickChart(String symbol,
String type,
Integer size,
Long since)
Get BTC/LTC candlestick data.
|
Depth |
getDepth(String symbol,
Integer size,
Integer merge)
Get market depth.
|
LendDepth |
getLendDepth(String symbol)
Get top 10 lending entries.
|
OrderResult |
getOrder(String apiKey,
String symbol,
long orderId,
si.mazi.rescu.ParamsDigest sign)
Get order info.
|
OrderFee |
getOrderFee(String apiKey,
String symbol,
long orderId,
si.mazi.rescu.ParamsDigest sign)
Query fee.
|
OrderHistory |
getOrderHistory(String apiKey,
String symbol,
int status,
int currentPage,
int pageLength,
si.mazi.rescu.ParamsDigest sign)
Returns the most recent 7 days orders.
|
OrderResult |
getOrders(String apiKey,
String symbol,
int type,
String orderId,
si.mazi.rescu.ParamsDigest sign)
Get order information in batch.
|
TickerResponse |
getTicker(String symbol)
Get price ticker.
|
Trade[] |
getTradeHistory(String apiKey,
String symbol,
Long since,
si.mazi.rescu.ParamsDigest sign)
Get Trade History (Not for Personal).
|
Trade[] |
getTrades(String symbol,
Long since)
Get trade history.
|
UnrepaymentsInfo |
getUnrepaymentsInfo(String apiKey,
String symbol,
int currentPage,
int pageLength,
si.mazi.rescu.ParamsDigest sign)
Get debt list.
|
UserInfo |
getUserInfo(String apiKey,
si.mazi.rescu.ParamsDigest sign)
Get user account info.
|
BorrowResult |
repay(String apiKey,
long borrowId,
si.mazi.rescu.ParamsDigest sign)
Pay off debt.
|
TradeResult |
trade(String apiKey,
String symbol,
Type type,
BigDecimal price,
BigDecimal amount,
si.mazi.rescu.ParamsDigest sign)
Place order.
|
Withdrawal |
withdraw(String apiKey,
String symbol,
BigDecimal chargeFee,
String tradePassword,
String withdrawAddress,
BigDecimal withdrawAmount,
si.mazi.rescu.ParamsDigest sign)
BTC/LTC Withdraw.
|
TickerResponse getTicker(String symbol) throws IOException
symbol
- the symbol: btc_cny, ltc_cny.IOException
- indicates I/O exception.Depth getDepth(String symbol, Integer size, Integer merge) throws IOException
symbol
- the symbol: btc_cny, ltc_cny.size
- must be between 1 - 200merge
- 1 (merge depth)IOException
- indicates I/O exception.Trade[] getTrades(String symbol, Long since) throws IOException
symbol
- the symbol: btc_cny, ltc_cny.since
- get 600 pieces of data starting from the given tid(optional).IOException
- indicates I/O exception.CandlestickChart getCandlestickChart(String symbol, String type, Integer size, Long since) throws IOException
symbol
- the symbol: btc_cny, ltc_cny.type
- size
- specify data size to be acquired.since
- timestamp(eg:1417536000000).
data after the timestamp will be returnedIOException
- indicates I/O exception.LendDepth getLendDepth(String symbol) throws OKCoinException, IOException
symbol
- the symbol, such as btc_cny, ltc_cny, cny.IOException
- indicates I/O exception.OKCoinException
UserInfo getUserInfo(String apiKey, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- API key of the user.sign
- signature of request parametersOKCoinException
- indicates request failed.IOException
- indicates I/O exception.TradeResult trade(String apiKey, String symbol, Type type, BigDecimal price, BigDecimal amount, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- the API key of the user.symbol
- the symbol: btc_cny, ltc_cny.type
- order type: limit order(buy/sell) market order(buy_market/sell_market).price
- order price. For limit orders, the price must be
between 0~1,000,000. IMPORTANT: for market buy orders, the price is to
total amount you want to buy, and it must be higher than the current
price of 0.01 BTC (minimum buying unit) or 0.1 LTC.amount
- order quantity. Must be higher than 0.01 for BTC, or 0.1 for LTC.sign
- signature of request parametersOKCoinException
- indicates request failed.IOException
- indicates I/O exception.Trade[] getTradeHistory(String apiKey, String symbol, Long since, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- the API key of the user.symbol
- the symbol: btc_cny, ltc_cny.since
- get 600 pieces of data starting from the given tid (Required).sign
- signature of request parameters.OKCoinException
- indicates request failed.IOException
- indicates I/O exception.BatchTradeResult batchTrade(String apiKey, String symbol, Type type, String ordersData, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- the API key of the user.symbol
- the symbol: btc_cny, ltc_cny.type
- optional, order type for limit orders (buy/sell).ordersData
- JSON string Example: [{price:3,amount:5,type:
'sell'},{price:3,amount:3,type:'buy'},{price:3,amount:3}] max
order number is 5,for 'price' and 'amount' parameter, refer to
trade/API. Final order type is decided primarily by 'type'
field within 'orders_data' and subsequently by 'type' field
(if no 'type' is provided within 'orders_data' field)sign
- signature of request parameters.OKCoinException
- indicates request failed.IOException
- indicates I/O exception.CancelOrderResult cancelOrder(String apiKey, String symbol, String orderId, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- the API key of the user.symbol
- the symbol: btc_cny, ltc_cny.orderId
- order ID (multiple orders are separated by a comma ',',
Max of 3 orders are allowed per request)sign
- signature of request parameters.OKCoinException
- indicates request failed.IOException
- indicates I/O exception.OrderResult getOrder(String apiKey, String symbol, long orderId, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- the API key of the user.symbol
- the symbol: btc_cny, ltc_cny.orderId
- if order_id is -1, then return all unfilled orders,
otherwise return the order specifiedsign
- signature of request parameters.OKCoinException
- indicates request failed.IOException
- indicates I/O exception.OrderResult getOrders(String apiKey, String symbol, int type, String orderId, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- the API key of the user.symbol
- the symbol: btc_cny, ltc_cny.type
- query type: 0 for unfilled (open) orders, 1 for filled ordersorderId
- order ID (multiple orders are separated by ',',
50 orders at most are allowed per request).sign
- signature of request parametersOKCoinException
- indicates request failed.IOException
- indicates I/O exception.OrderHistory getOrderHistory(String apiKey, String symbol, int status, int currentPage, int pageLength, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- the API key of the user.symbol
- the symbol: btc_cny, ltc_cny.status
- query status: 0 for unfilled orders, 1 for filled orders.currentPage
- current page number.pageLength
- number of orders returned per page, maximum 200.sign
- signature of request parametersOKCoinException
- indicates request failed.IOException
- indicates I/O exception.Withdrawal withdraw(String apiKey, String symbol, BigDecimal chargeFee, String tradePassword, String withdrawAddress, BigDecimal withdrawAmount, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- the API key of the suer.symbol
- the symbol: BTC, LTC.chargeFee
- network transaction fee. By default, fee is between
0.0001 - 0.01 for BTC, and 0.001 - 0.2 for LTC, transaction gets
confirmed faster with higher fees. For withdraws to another OKCoin
address, chargefee can be 0 and the withdraw will be 0 confirmation
as well.tradePassword
- trade/admin password.withdrawAddress
- withdraw address.withdrawAmount
- withdraw amount in BTC or LTC.sign
- signature of request parameters.OKCoinException
- indicates request failed.IOException
- indicates I/O exception.Withdrawal cancelWithdraw(String apiKey, String symbol, long withdrawId, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- the API key of the user.symbol
- the symbol: BTC, LTC.withdrawId
- withdrawal request ID.sign
- signature of request parameters.OKCoinException
- indicates request failed.IOException
- indicates I/O exception.OrderFee getOrderFee(String apiKey, String symbol, long orderId, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- the API key of the user.symbol
- the symbol: btc_cny, ltc_cny.orderId
- the order ID.sign
- the signature of request parameters.OKCoinException
- indicates request failed.IOException
- indicates I/O exception.BorrowsInfo getBorrowsInfo(String apiKey, String symbol, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- the API key of the user.symbol
- the symbol, such as btc_cny, ltc_cny, cny.sign
- signature of request parameters.OKCoinException
- indicates request failed.IOException
- indicates I/O exception.BorrowResult borrowMoney(String apiKey, String symbol, String days, BigDecimal amount, BigDecimal rate, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- the API key of the user.symbol
- the symbol, such as btc_cny, ltc_cny, cny.days
- days of borrow: three, seven, fifteen, thirty, sixty, ninety.amount
- borrow amount.rate
- borrow rate [0.0001, 0.01].sign
- signature of request parameters.OKCoinException
- indicates request failed.IOException
- indicates I/O exception.BorrowResult cancelBorrow(String apiKey, String symbol, long borrowId, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- the API key of the user.symbol
- the symbol, such as btc_cny, ltc_cny, cny.borrowId
- the borrow order ID.sign
- signature of request parameters.OKCoinException
- indicates request failed.IOException
- indicates I/O exception.BorrowOrderInfo getBorrowOrderInfo(String apiKey, long borrowId, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- the API key of the user.borrowId
- the borrow order ID.sign
- signature of request parameters.OKCoinException
- indicates request failed.IOException
- indicates I/O exception.BorrowResult repay(String apiKey, long borrowId, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- the API key of the user.borrowId
- the borrow order ID.sign
- signature of request parameters.OKCoinException
- indicates request failed.IOException
- indicates I/O exception.UnrepaymentsInfo getUnrepaymentsInfo(String apiKey, String symbol, int currentPage, int pageLength, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- the API key of the user.symbol
- the symbol, such as btc_cny, ltc_cny, cny.currentPage
- the current page number.pageLength
- data entries number per page, maximum 50.sign
- signature of request parametersOKCoinException
- indicates request failed.IOException
- indicates I/O exception.AccountRecords getAccountRecords(String apiKey, String symbol, int type, int currentPage, int pageLength, si.mazi.rescu.ParamsDigest sign) throws OKCoinException, IOException
apiKey
- the API key of the user.symbol
- the symbol: btc_cny, ltc_cny, cnytype
- 0: deposits, 1: withdraw.currentPage
- the current page number. 1 based.pageLength
- the data entries number per page, maximum 50.sign
- the signature of request parameters.OKCoinException
- indicates request failed.IOException
- indicates I/O exception.Copyright © 2013–2017. All rights reserved.