1 package org.oxerr.okcoin.rest.service;
2
3 import java.io.IOException;
4 import java.math.BigDecimal;
5
6 import org.knowm.xchange.Exchange;
7 import org.oxerr.okcoin.rest.OKCoinException;
8 import org.oxerr.okcoin.rest.dto.AccountRecords;
9 import org.oxerr.okcoin.rest.dto.UserInfo;
10 import org.oxerr.okcoin.rest.dto.Withdrawal;
11
12
13
14
15 public class OKCoinAccountServiceRaw extends OKCoinBaseTradeService {
16
17 private static final String METHOD_GET_USER_INFO = "userinfo";
18
19 protected OKCoinAccountServiceRaw(Exchange exchange) {
20 super(exchange);
21 }
22
23 public UserInfo getUserInfo() throws OKCoinException, IOException {
24 sleep(METHOD_GET_USER_INFO);
25 UserInfo userInfo = okCoin.getUserInfo(apiKey, sign);
26 updateLast(METHOD_GET_USER_INFO);
27 return userInfo;
28 }
29
30 public Withdrawal withdraw(String symbol, BigDecimal chargeFee,
31 String tradePassword, String withdrawAddress,
32 BigDecimal withdrawAmount) throws OKCoinException, IOException {
33 return okCoin.withdraw(apiKey, symbol, chargeFee, tradePassword,
34 withdrawAddress, withdrawAmount, sign);
35 }
36
37 public Withdrawal cancelWithdraw(String symbol, long withdrawId)
38 throws OKCoinException, IOException {
39 return okCoin.cancelWithdraw(apiKey, symbol, withdrawId, sign);
40 }
41
42
43
44
45
46
47
48
49
50
51
52
53 public AccountRecords getAccountRecords(String symbol, int type,
54 int currentPage, int pageLength) throws OKCoinException,
55 IOException {
56 return okCoin.getAccountRecords(apiKey, symbol, type, currentPage,
57 pageLength, sign);
58 }
59
60 }