1 package org.oxerr.chbtc.service.polling;
2
3 import java.io.IOException;
4 import java.math.BigDecimal;
5 import java.util.List;
6
7 import org.oxerr.chbtc.dto.Order;
8 import org.oxerr.chbtc.dto.Type;
9
10 import com.xeiam.xchange.Exchange;
11
12 public class CHBTCTradeServiceRaw extends CHBTCBaseTradePollingService {
13
14 private static final Order[] ORDER_ARRAY = new Order[] {};
15
16 protected CHBTCTradeServiceRaw(Exchange exchange) {
17 super(exchange);
18 }
19
20
21
22
23
24
25
26
27
28
29
30
31 public long order(BigDecimal price, BigDecimal amount,
32 Type tradeType, String currency) throws IOException {
33 return client.order(price, amount, tradeType, currency);
34 }
35
36
37
38
39
40
41
42
43
44 public void cancelOrder(long id, String currency) throws IOException {
45 client.cancelOrder(id, currency);
46 }
47
48
49
50
51
52
53
54
55
56
57 public Order getOrder(long id, String currency) throws IOException {
58 return client.getOrder(id, currency);
59 }
60
61
62
63
64
65
66
67
68
69
70 public Order[] getOrders(Type tradeType, String currency, int pageIndex)
71 throws IOException {
72 List<Order> orderList = client.getOrders(tradeType, currency, pageIndex);
73 return orderList.toArray(ORDER_ARRAY);
74 }
75
76
77
78
79
80
81
82
83
84
85
86
87 public Order[] getOrdersNew(Type tradeType, String currency, int pageIndex,
88 int pageSize) throws IOException {
89 List<Order> orderList = client.getOrdersNew(
90 tradeType, currency, pageIndex, pageSize);
91 return orderList.toArray(ORDER_ARRAY);
92 }
93
94
95
96
97
98
99
100
101
102
103
104 public Order[] getOrdersIgnoreTradeType(String currency, int pageIndex,
105 int pageSize) throws IOException {
106 List<Order> orderList = client.getOrdersIgnoreTradeType(
107 currency, pageIndex, pageSize);
108 return orderList.toArray(ORDER_ARRAY);
109 }
110
111
112
113
114
115
116
117
118
119
120
121 public Order[] getUnfinishedOrdersIgnoreTradeType(String currency,
122 int pageIndex, int pageSize) throws IOException {
123 List<Order> orderList = client.getUnfinishedOrdersIgnoreTradeType(
124 currency,
125 pageIndex,
126 pageSize);
127 return orderList.toArray(ORDER_ARRAY);
128 }
129
130 }