1 package org.oxerr.okcoin.rest.service;
2
3 import java.io.IOException;
4
5 import org.knowm.xchange.Exchange;
6 import org.knowm.xchange.ExchangeSpecification;
7 import org.oxerr.okcoin.rest.OKCoin;
8 import org.oxerr.okcoin.rest.dto.CandlestickChart;
9 import org.oxerr.okcoin.rest.dto.Depth;
10 import org.oxerr.okcoin.rest.dto.LendDepth;
11 import org.oxerr.okcoin.rest.dto.TickerResponse;
12 import org.oxerr.okcoin.rest.dto.Trade;
13
14 import si.mazi.rescu.RestProxyFactory;
15
16
17
18
19 public class OKCoinMarketDataServiceRaw extends OKCoinBaseService {
20
21 private final OKCoin okCoin;
22
23 protected OKCoinMarketDataServiceRaw(Exchange exchange) {
24 super(exchange);
25 ExchangeSpecification spec = exchange.getExchangeSpecification();
26 final String baseUrl = spec.getSslUri();
27 okCoin = RestProxyFactory.createProxy(OKCoin.class, baseUrl);
28 }
29
30 public TickerResponse getTicker(String symbol) throws IOException {
31 return okCoin.getTicker(symbol);
32 }
33
34 public Depth getDepth(String symbol, Integer size, Integer merge)
35 throws IOException {
36 return okCoin.getDepth(symbol, size, merge);
37 }
38
39 public Trade[] getTrades(String symbol, Long since) throws IOException {
40 return okCoin.getTrades(symbol, since);
41 }
42
43
44
45
46
47
48
49
50
51
52
53 public CandlestickChart getCandlestickChart(String symbol, String type,
54 Integer size, Long since) throws IOException {
55 return okCoin.getCandlestickChart(symbol, type, size, since);
56 }
57
58 public LendDepth getLendDepth(String symbol) throws IOException {
59 return okCoin.getLendDepth(symbol);
60 }
61
62 }