Package com.xeiam.xchange.dto.account

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


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

    AccountInfo adaptedAccountInfo = CryptoTradeAdapters.adaptAccountInfo("test", accountInfo);

    assertThat(adaptedAccountInfo.getUsername()).isEqualTo("test");

    List<Wallet> wallets = adaptedAccountInfo.getWallets();
    assertThat(wallets.size()).isEqualTo(11);
    for (Wallet wallet : wallets) {
      if (wallet.getCurrency().equals(Currencies.BTC))
        assertThat(wallet.getBalance()).isEqualTo(new BigDecimal("12098.91081965"));
    }
View Full Code Here


      if ("exchange".equals(balance.getType())) {
        wallets.add(new Wallet(balance.getCurrency().toUpperCase(), balance.getAmount()));
      }
    }

    return new AccountInfo(null, wallets);
  }
View Full Code Here

    Wallet cnyLoan = new Wallet(CNY, a.getLoanCnyDisplay(), "loan");
    Wallet btcLoan = new Wallet(BTC, a.getLoanBtcDisplay(), "loan");
    Wallet ltcLoan = new Wallet(LTC, a.getLoanLtcDisplay(), "loan");

    List<Wallet> wallets = Arrays.asList(cny, btc, ltc, cnyLoan, btcLoan, ltcLoan);
    return new AccountInfo(null, wallets);
  }
View Full Code Here

    List<Wallet> wallets = new ArrayList<Wallet>();
    for (Entry<String, BigDecimal> fundsEntry : accountInfo.getFunds().entrySet())
      wallets.add(new Wallet(fundsEntry.getKey().toUpperCase(), fundsEntry.getValue()));

    return new AccountInfo(userName, wallets);
  }
View Full Code Here

   * @return
   */
  public static AccountInfo adaptAccountInfo(ANXAccountInfo anxAccountInfo) {

    // Adapt to XChange DTOs
    AccountInfo accountInfo = new AccountInfo(anxAccountInfo.getLogin(), anxAccountInfo.getTradeFee(), ANXAdapters.adaptWallets(anxAccountInfo.getWallets()));
    return accountInfo;
  }
View Full Code Here

   * Adapts a BTCChinaAccountInfoResponse to AccountInfo Object
   */
  public static AccountInfo adaptAccountInfo(BTCChinaResponse<BTCChinaAccountInfo> response) {

    BTCChinaAccountInfo result = response.getResult();
    return new AccountInfo(result.getProfile().getUsername(), result.getProfile().getTradeFee(), BTCChinaAdapters.adaptWallets(result.getBalances(), result.getFrozens()));
  }
View Full Code Here

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

    Wallet btcLoan = new Wallet(BTC, getOrZero("btc", funds.getBorrow()), "loan");
    Wallet ltcLoan = new Wallet(LTC, getOrZero("ltc", funds.getBorrow()), "loan");

    List<Wallet> wallets = Arrays.asList(base, btc, ltc, baseLoan, btcLoan, ltcLoan);

    return new AccountInfo(null, wallets);
  }
View Full Code Here

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

    AccountInfo accountInfo = BTERAdapters.adaptAccountInfo(funds);

    assertThat(accountInfo.getWallets()).hasSize(4);
    assertThat(accountInfo.getBalance(Currencies.BTC)).isEqualTo("0.00010165");
  }
View Full Code Here

    raw(krakenExchange);
  }

  private static void generic(Exchange krakenExchange) throws IOException {

    AccountInfo accountInfo = krakenExchange.getPollingAccountService().getAccountInfo();
    System.out.println("Account Info: " + accountInfo.toString());
  }
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.