Package com.xeiam.xchange.btce.v3.dto.marketdata

Examples of com.xeiam.xchange.btce.v3.dto.marketdata.BTCETickerWrapper


    // Read in the JSON from the example resources
    InputStream is = BTCETradeHistoryJSONTest.class.getResourceAsStream("/v3/trade/example-trade-history-data.json");

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    BTCETradeHistoryReturn transactions = mapper.readValue(is, BTCETradeHistoryReturn.class);
    Map<Long, BTCETradeHistoryResult> result = transactions.getReturnValue();
    assertThat(result.size()).isEqualTo(32);
    Entry<Long, BTCETradeHistoryResult> firstEntry = result.entrySet().iterator().next();
    // Verify that the example data was unmarshalled correctly
    assertThat(firstEntry.getKey()).isEqualTo(7258275L);
    assertThat(firstEntry.getValue().getAmount()).isEqualTo(new BigDecimal("0.1"));
View Full Code Here


  }

  @Test
  public void testOwnTransactions() throws IOException {

    BTCETradeHistoryReturn result = getResult("/v3/trade/example-trade-history-data.json", BTCETradeHistoryReturn.class);
    // Verify that the example data was unmarshalled correctly
    Map<Long, BTCETradeHistoryResult> rv = result.getReturnValue();
    assertThat(rv.keySet()).containsAll(Arrays.asList(7258275L, 7160193L));

    BTCETradeHistoryResult trade = rv.get(7258275L);
    assertThat(trade.getPair()).isEqualTo("btc_usd");
    assertThat(trade.getType()).isEqualTo(Type.sell);
View Full Code Here

   * @param pair The pair to show the transaction; example btc_usd; all pairs
   * @return {success=1, return={tradeId={pair=btc_usd, type=sell, amount=1, rate=1, orderId=1234, timestamp=1234}}}
   */
  public Map<Long, BTCETradeHistoryResult> getBTCETradeHistory(Long from, Long count, Long fromId, Long endId, BTCEAuthenticated.SortOrder order, Long since, Long end, String pair) throws IOException {

    BTCETradeHistoryReturn btceTradeHistory = btce.TradeHistory(apiKey, signatureCreator, nextNonce(), from, count, fromId, endId, order, since, end, pair);
    checkResult(btceTradeHistory);
    return btceTradeHistory.getReturnValue();
  }
View Full Code Here

  public void applySpecification(ExchangeSpecification exchangeSpecification) {

    super.applySpecification(exchangeSpecification);

    this.pollingMarketDataService = new BTCEMarketDataService(exchangeSpecification);
    this.pollingAccountService = new BTCEAccountService(exchangeSpecification);
    this.pollingTradeService = new BTCETradeService(exchangeSpecification);
  }
View Full Code Here

  }

  private static void raw(Exchange exchange) throws IOException {

    // Interested in the private account functionality (authentication)
    BTCEAccountServiceRaw accountService = (BTCEAccountServiceRaw) exchange.getPollingAccountService();

    // Get the account information
    BTCEAccountInfo accountInfo = accountService.getBTCEAccountInfo(null, null, null, null, null, null, null);
    System.out.println("BTCE AccountInfo as String: " + accountInfo.toString());
  }
View Full Code Here

  @Override
  public void applySpecification(ExchangeSpecification exchangeSpecification) {

    super.applySpecification(exchangeSpecification);

    this.pollingMarketDataService = new BTCEMarketDataService(exchangeSpecification);
    this.pollingAccountService = new BTCEAccountService(exchangeSpecification);
    this.pollingTradeService = new BTCETradeService(exchangeSpecification);
  }
View Full Code Here

  }

  private static void raw(Exchange exchange) throws IOException {

    // Interested in the public polling market data feed (no authentication)
    BTCEMarketDataServiceRaw marketDataService = (BTCEMarketDataServiceRaw) exchange.getPollingMarketDataService();

    // Get the latest trade data for BTC/USD
    Map<String, BTCETrade[]> trades = marketDataService.getBTCETrades("btc_usd", 7).getTradesMap();

    for (Map.Entry<String, BTCETrade[]> entry : trades.entrySet()) {
      System.out.println("Pair: " + entry.getKey() + ", Trades:");
      for (BTCETrade trade : entry.getValue()) {
        System.out.println(trade.toString());
View Full Code Here

  }

  private static void raw(Exchange exchange) throws IOException {

    // Interested in the public polling market data feed (no authentication)
    BTCEMarketDataServiceRaw marketDataService = (BTCEMarketDataServiceRaw) exchange.getPollingMarketDataService();

    // Get the latest full order book data for LTC/USD
    Map<String, BTCEDepth> depth = marketDataService.getBTCEDepth("ltc_usd", 7).getDepthMap();
    for (Map.Entry<String, BTCEDepth> entry : depth.entrySet()) {
      System.out.println("Pair: " + entry.getKey() + ", Depth:" + entry.getValue());
    }
  }
View Full Code Here

  }

  private static void raw(Exchange exchange) throws IOException {

    // Interested in the public polling market data feed (no authentication)
    BTCEMarketDataServiceRaw marketDataService = (BTCEMarketDataServiceRaw) exchange.getPollingMarketDataService();

    // Get the latest ticker data showing BTC to USD
    BTCETickerWrapper ticker = marketDataService.getBTCETicker("btc_usd");
    System.out.println(ticker.toString());
  }
View Full Code Here

    super.applySpecification(exchangeSpecification);

    this.pollingMarketDataService = new BTCEMarketDataService(exchangeSpecification);
    this.pollingAccountService = new BTCEAccountService(exchangeSpecification);
    this.pollingTradeService = new BTCETradeService(exchangeSpecification);
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.btce.v3.dto.marketdata.BTCETickerWrapper

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.