Examples of ANXAccountInfo


Examples of com.xeiam.xchange.anx.v2.dto.account.polling.ANXAccountInfo

    InputStream is = AccountInfoJSONTest.class.getResourceAsStream("/v2/account/example-accountinfo-data.json");

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    ANXAccountInfo anxAccountInfo = mapper.readValue(is, ANXAccountInfo.class);

    // Verify that the example data was unmarshalled correctly
    assertThat(anxAccountInfo.getLogin()).isEqualTo("test@anxpro.com");

    // Get Balance
    assertThat(anxAccountInfo.getWallets().getBTC().getBalance().getValue()).isEqualTo(new BigDecimal("100000.01988000"));
    assertThat(anxAccountInfo.getWallets().getUSD().getBalance().getValue()).isEqualTo(new BigDecimal("100000.00000"));
    assertThat(anxAccountInfo.getWallets().getHKD().getBalance().getValue()).isEqualTo(new BigDecimal("99863.07000"));

    assertThat(anxAccountInfo.getWallets().getLTC().getBalance().getValue()).isEqualTo(new BigDecimal("100000.00000000"));
    assertThat(anxAccountInfo.getWallets().getDOGE().getBalance().getValue()).isEqualTo(new BigDecimal("9999781.09457936"));

    // Get Other Balance
    assertThat(anxAccountInfo.getWallets().getBTC().getMaxWithdraw().getValue()).isEqualTo(new BigDecimal("100.00000000"));
    assertThat(anxAccountInfo.getWallets().getBTC().getDailyWithdrawLimit().getValue()).isEqualTo(new BigDecimal("100.00000000"));
  }
View Full Code Here

Examples of com.xeiam.xchange.anx.v2.dto.account.polling.ANXAccountInfo

    InputStream is = ANXAdapterTest.class.getResourceAsStream("/v2/account/example-accountinfo-data.json");

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    ANXAccountInfo anxAccountInfo = mapper.readValue(is, ANXAccountInfo.class);

    AccountInfo accountInfo = ANXAdapters.adaptAccountInfo(anxAccountInfo);
    assertThat(accountInfo.getUsername()).isEqualTo("test@anxpro.com");
  }
View Full Code Here

Examples of com.xeiam.xchange.anx.v2.dto.account.polling.ANXAccountInfo

    InputStream is = ANXAdapterTest.class.getResourceAsStream("/v2/account/example-accountinfo-data.json");

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    ANXAccountInfo anxAccountInfo = mapper.readValue(is, ANXAccountInfo.class);

    // in Wallet(s), only wallets from ANXAccountInfo.getWallets that contained data are NOT null.
    List<Wallet> wallets = ANXAdapters.adaptWallets(anxAccountInfo.getWallets());
    Assert.assertEquals(22, wallets.size());

    Assert.assertTrue(wallets.contains(new Wallet(Currencies.CAD, new BigDecimal("100000.00000"))));
    Assert.assertTrue(wallets.contains(new Wallet(Currencies.BTC, new BigDecimal("100000.01988000"))));
    Assert.assertTrue(wallets.contains(new Wallet(Currencies.DOGE, new BigDecimal("9999781.09457936"))));
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.