Package com.xeiam.xchange.bitstamp.dto.marketdata

Examples of com.xeiam.xchange.bitstamp.dto.marketdata.BitstampTicker


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

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

    Ticker ticker = BitstampAdapters.adaptTicker(bitstampTicker, CurrencyPair.BTC_USD);

    assertThat(ticker.getLast().toString()).isEqualTo("134.89");
    assertThat(ticker.getBid().toString()).isEqualTo("134.89");
View Full Code Here


    System.out.println(ticker.toString());
  }

  private static void raw(BitstampMarketDataServiceRaw marketDataService) throws IOException {

    BitstampTicker bitstampTicker = marketDataService.getBitstampTicker();

    System.out.println(bitstampTicker.toString());
  }
View Full Code Here

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

    ObjectMapper mapper = new ObjectMapper();
    BitstampTicker bitstampTicker = mapper.readValue(is, BitstampTicker.class);

    // Verify that the example data was unmarshalled correctly
    assertThat(bitstampTicker.getLast()).isEqualTo(new BigDecimal("134.89"));
    assertThat(bitstampTicker.getHigh()).isEqualTo(new BigDecimal("138.22"));
    assertThat(bitstampTicker.getLow()).isEqualTo(new BigDecimal("131.79"));
    assertThat(bitstampTicker.getVolume()).isEqualTo(new BigDecimal("21982.44926674"));
    assertThat(bitstampTicker.getBid()).isEqualTo(new BigDecimal("134.89"));
    assertThat(bitstampTicker.getAsk()).isEqualTo(new BigDecimal("134.92"));
    assertThat(bitstampTicker.getTimestamp()).isEqualTo(1381787133L);
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.bitstamp.dto.marketdata.BitstampTicker

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.