Package com.xeiam.xchange.dto.account

Examples of com.xeiam.xchange.dto.account.AccountInfo


  @Test
  public void testAdaptAccountInfo() throws IOException {

    BTCTradeBalance balance = mapper.readValue(getClass().getResource("dto/account/balance.json"), BTCTradeBalance.class);

    AccountInfo accountInfo = BTCTradeAdapters.adaptAccountInfo(balance);
    assertNull(accountInfo.getUsername());
    assertNull(accountInfo.getTradingFee());
    assertEquals(new BigDecimal(3), accountInfo.getBalance(Currencies.BTC));
    assertEquals(new BigDecimal("7"), accountInfo.getBalance(Currencies.LTC));
    assertEquals(new BigDecimal("11"), accountInfo.getBalance(Currencies.DOGE));
    assertEquals(new BigDecimal("15"), accountInfo.getBalance("YBC"));
    assertEquals(new BigDecimal("19"), accountInfo.getBalance(Currencies.CNY));
  }
View Full Code Here


    for (String lcCurrency : funds.keySet()) {
      String currency = lcCurrency.toUpperCase();
      wallets.add(new Wallet(currency, funds.get(lcCurrency)));
    }
    return new AccountInfo(null, wallets);
  }
View Full Code Here

    for (String lcCurrency : funds.keySet()) {
      String currency = lcCurrency.toUpperCase();

      wallets.add(new Wallet(currency, funds.get(lcCurrency)));
    }
    return new AccountInfo(null, wallets);
  }
View Full Code Here

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

    AccountInfo adaptedAccountInfo = CryptsyAdapters.adaptAccountInfo(accountInfo);

    List<Wallet> wallets = adaptedAccountInfo.getWallets();
    assertEquals(wallets.size(), 150);
    for (Wallet wallet : wallets) {
      if (wallet.getCurrency().equals("BTC")) {
        assertEquals(wallet.getBalance(), new BigDecimal("0.01527794"));
      }
View Full Code Here

  public void testAdaptAccountInfo() throws IOException {

    Wallet wallet = new Wallet("BTC", new BigDecimal("7.10770000"));
    List<Wallet> wallets = new ArrayList<Wallet>();
    wallets.add(wallet);
    AccountInfo expectedAccountInfo = new AccountInfo("demo@demo.com", wallets);

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

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

    List<CoinbaseUser> userList = users.getUsers();
    CoinbaseUser user = userList.get(0);

    AccountInfo accountInfo = CoinbaseAdapters.adaptAccountInfo(user);
    assertThat(accountInfo).isEqualsToByComparingFields(expectedAccountInfo);
  }
View Full Code Here

    for (String lcCurrency : funds.keySet()) {
      String currency = lcCurrency.toUpperCase();
      wallets.add(new Wallet(currency, funds.get(lcCurrency)));
    }
    return new AccountInfo(null, wallets);
  }
View Full Code Here

    for (String lcCurrency : funds.keySet()) {
      String currency = lcCurrency.toUpperCase();

      wallets.add(new Wallet(currency, funds.get(lcCurrency)));
    }
    return new AccountInfo(null, wallets);
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.dto.account.AccountInfo

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.