Package com.xeiam.xchange.btccentral.dto.marketdata

Examples of com.xeiam.xchange.btccentral.dto.marketdata.BTCCentralMarketDepth


    // Read in the JSON from the example resources
    InputStream is = MarketDataTest.class.getResourceAsStream("/Example_DepthData.json");

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

    assertEquals(btcCentralMarketDepth.getAsks().get(0).getAmount(), new BigDecimal("0.48762"));
    assertEquals(btcCentralMarketDepth.getAsks().get(0).getPrice(), new BigDecimal("24.48996"));
    assertEquals(btcCentralMarketDepth.getBids().get(0).getAmount(), new BigDecimal("0.77372456"));
    assertEquals(btcCentralMarketDepth.getBids().get(0).getPrice(), new BigDecimal("24.05"));

  }
View Full Code Here


    // Read in the JSON from the example resources
    InputStream is = AdaptersTest.class.getResourceAsStream("/Example_DepthData.json");

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

    OrderBook genericOrderBook = BTCCentralAdapters.adaptMarketDepth(btcCentralMarketDepth, CurrencyPair.BTC_EUR);

    assertEquals(genericOrderBook.getAsks().get(0).getTradableAmount(), new BigDecimal("0.48762"));
    assertEquals(genericOrderBook.getAsks().get(0).getLimitPrice(), new BigDecimal("24.48996"));
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.btccentral.dto.marketdata.BTCCentralMarketDepth

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.