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

Examples of com.xeiam.xchange.kraken.dto.account.results.KrakenBalanceResult


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

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

    AccountInfo info = KrakenAdapters.adaptBalance(krakenBalance.getResult(), null);

    assertThat(info.getBalance(Currencies.EUR)).isEqualTo(new BigDecimal("1.0539"));
    assertThat(info.getBalance(Currencies.BTC)).isEqualTo(new BigDecimal("0.4888583300"));

  }
View Full Code Here


   * @return Map of Kraken Assets to account balance
   * @throws IOException
   */
  public Map<String, BigDecimal> getKrakenBalance() throws IOException {

    KrakenBalanceResult balanceResult = kraken.balance(exchangeSpecification.getApiKey(), signatureCreator, nextNonce());
    return checkResult(balanceResult);
  }
View Full Code Here

    // Read in the JSON from the example resources
    InputStream is = KrakenAccountJSONTest.class.getResourceAsStream("/account/example-balance-data.json");

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    KrakenBalanceResult krakenBalance = mapper.readValue(is, KrakenBalanceResult.class);
    Assert.assertEquals(2, krakenBalance.getResult().size());
    assertThat(krakenBalance.getResult().get("ZUSD")).isNull();
    assertThat(krakenBalance.getResult().get("ZEUR")).isEqualTo("1.0539");

  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.kraken.dto.account.results.KrakenBalanceResult

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.