Package com.xeiam.xchange.kraken.dto.marketdata.results

Examples of com.xeiam.xchange.kraken.dto.marketdata.results.KrakenDepthResult


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

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    KrakenDepthResult krakenDepthResult = mapper.readValue(is, KrakenDepthResult.class);
    Map<String, KrakenDepth> krakenDepths = krakenDepthResult.getResult();
    String krakenAssetPair = "XXBTZEUR";
    KrakenDepth krakenDepth = krakenDepths.get(krakenAssetPair);

    OrderBook orderBook = KrakenAdapters.adaptOrderBook(krakenDepth, CurrencyPair.BTC_EUR);
View Full Code Here


  }

  public KrakenDepth getKrakenDepth(CurrencyPair currencyPair, long count) throws IOException {

    String krakenCurrencyPair = createKrakenCurrencyPair(currencyPair);
    KrakenDepthResult result = kraken.getDepth(krakenCurrencyPair, count);

    return checkResult(result).get(krakenCurrencyPair);
  }
View Full Code Here

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

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    KrakenDepthResult krakenDepthResult = mapper.readValue(is, KrakenDepthResult.class);
    Map<String, KrakenDepth> krakenDepths = krakenDepthResult.getResult();

    // Verify that the example data was unmarshalled correctly
    assertThat(krakenDepths.get("XXBTXLTC")).isEqualTo(null);
    List<KrakenPublicOrder> krakenAsks = krakenDepths.get("XXBTZEUR").getAsks();
    KrakenPublicOrder krakenPublicOrder = krakenAsks.get(0);
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.kraken.dto.marketdata.results.KrakenDepthResult

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.