Package com.xeiam.xchange.bitkonan.dto.marketdata

Examples of com.xeiam.xchange.bitkonan.dto.marketdata.BitKonanOrderBook


    // Read in the JSON from the example resources
    InputStream is = BitKonanMarketDataJsonTest.class.getResourceAsStream("/marketdata/bitkonan-example-orderbook-data.json");

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    BitKonanOrderBook orderBook = mapper.readValue(is, BitKonanOrderBook.class);

    OrderBook adaptedOrderBook = BitKonanAdapters.adaptOrderBook(orderBook);

    List<LimitOrder> asks = adaptedOrderBook.getAsks();
    assertThat(asks.size()).isEqualTo(10);
View Full Code Here


    // Read in the JSON from the example resources
    InputStream is = BitKonanMarketDataJsonTest.class.getResourceAsStream("/marketdata/bitkonan-example-orderbook-data.json");

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    BitKonanOrderBook orderBook = mapper.readValue(is, BitKonanOrderBook.class);

    BitKonanOrderBookElement[] asks = orderBook.getAsks();
    assertThat(asks).hasSize(10);
    assertTrue(asks[0].getVolume().compareTo(new BigDecimal("0.46557")) == 0);
    assertTrue(asks[1].getVolume().compareTo(new BigDecimal("0.5011")) == 0);

    BitKonanOrderBookElement[] bids = orderBook.getBids();
    assertThat(bids).hasSize(10);
    assertTrue(bids[0].getVolume().compareTo(new BigDecimal("0.04455")) == 0);
    assertTrue(bids[1].getVolume().compareTo(new BigDecimal("3")) == 0);
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.bitkonan.dto.marketdata.BitKonanOrderBook

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.