Examples of BTCETradeHistoryReturn


Examples of com.xeiam.xchange.btce.v2.dto.trade.BTCETradeHistoryReturn

    // Read in the JSON from the example resources
    InputStream is = BTCETradeHistoryJSONTest.class.getResourceAsStream("/v2/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

Examples of com.xeiam.xchange.btce.v2.dto.trade.BTCETradeHistoryReturn

  }

  @Test
  public void testOwnTransactions() throws IOException {

    BTCETradeHistoryReturn result = getResult("/v2/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

Examples of com.xeiam.xchange.btce.v2.dto.trade.BTCETradeHistoryReturn

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

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

    UserTrades trades = BTCEAdapters.adaptTradeHistory(btceTradeHistory.getReturnValue());
    List<UserTrade> tradeList = trades.getUserTrades();
    UserTrade lastTrade = tradeList.get(tradeList.size() - 1);
    assertThat(lastTrade.getId()).isEqualTo("7258275");
    assertThat(lastTrade.getType()).isEqualTo(OrderType.ASK);
    assertThat(lastTrade.getPrice().toString()).isEqualTo("125.75");
View Full Code Here

Examples of com.xeiam.xchange.btce.v2.dto.trade.BTCETradeHistoryReturn

    } catch (ArrayIndexOutOfBoundsException e) {
      // ignore, can happen if no arg given.
    }

    String pair = String.format("%s_%s", tradableIdentifier, transactionCurrency).toLowerCase();
    BTCETradeHistoryReturn btceTradeHistory = btce.TradeHistory(apiKey, signatureCreator, nextNonce(), null, numberOfTransactions, null, null, BTCEAuthenticated.SortOrder.DESC, null, null, pair);
    checkResult(btceTradeHistory);
    return BTCEAdapters.adaptTradeHistory(btceTradeHistory.getReturnValue());
  }
View Full Code Here

Examples of com.xeiam.xchange.btce.v2.dto.trade.BTCETradeHistoryReturn

    } catch (ArrayIndexOutOfBoundsException e) {
      // ignore, can happen if no arg given.
    }

    String pair = String.format("%s_%s", tradableIdentifier, transactionCurrency).toLowerCase();
    BTCETradeHistoryReturn btceTradeHistory = btce.TradeHistory(apiKey, signatureCreator, nextNonce(), null, numberOfTransactions, null, null, BTCEAuthenticated.SortOrder.DESC, null, null, pair);
    checkResult(btceTradeHistory);
    return BTCEAdapters.adaptTradeHistory(btceTradeHistory.getReturnValue());
  }
View Full Code Here

Examples of com.xeiam.xchange.btce.v3.dto.trade.BTCETradeHistoryReturn

    // 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 btceTradeHistory = mapper.readValue(is, BTCETradeHistoryReturn.class);

    UserTrades trades = BTCEAdapters.adaptTradeHistory(btceTradeHistory.getReturnValue());
    List<UserTrade> tradeList = trades.getUserTrades();
    UserTrade lastTrade = tradeList.get(tradeList.size() - 1);
    assertThat(lastTrade.getId()).isEqualTo("7258275");
    assertThat(lastTrade.getType()).isEqualTo(OrderType.ASK);
    assertThat(lastTrade.getPrice().toString()).isEqualTo("125.75");
View Full Code Here

Examples of com.xeiam.xchange.btce.v3.dto.trade.BTCETradeHistoryReturn

    // 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

Examples of com.xeiam.xchange.btce.v3.dto.trade.BTCETradeHistoryReturn

  }

  @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

Examples of com.xeiam.xchange.btce.v3.dto.trade.BTCETradeHistoryReturn

   * @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
TOP
Copyright © 2018 www.massapi.com. 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.