コード例 #1
0
  @Override
  public OrderBook getOrderBook(String symbol) {

    // Request data
    ImcexDepth imcexDepth =
        HttpUtils.getForJsonObject(
            apiBase + symbol + "/public/depth?raw",
            ImcexDepth.class,
            mapper,
            new HashMap<String, String>());

    OrderBook depth = new OrderBook();

    return depth;
  }
コード例 #2
0
  @Override
  public Ticker getTicker(String symbol) {

    // Request data
    ImcexTicker mtGoxTicker =
        HttpUtils.getForJsonObject(
            apiBase + symbol + "/public/ticker",
            ImcexTicker.class,
            mapper,
            new HashMap<String, String>());

    // Adapt to XChange DTOs
    Ticker ticker = new Ticker();

    // TODO Provide more detail
    ticker.setLast(Integer.parseInt(mtGoxTicker.getReturn().getLast_orig().getValue_int()));
    ticker.setVolume(Long.parseLong(mtGoxTicker.getReturn().getVol().getValue_int()));

    return ticker;
  }