use of org.knowm.xchange.independentreserve.dto.account.IndependentReserveAccount in project XChange by knowm.
the class IndependentReserveAdapters method adaptWallet.
public static Wallet adaptWallet(IndependentReserveBalance independentReserveBalance) {
List<Balance> balances = new ArrayList<>();
for (IndependentReserveAccount balanceAccount : independentReserveBalance.getIndependentReserveAccounts()) {
Currency currency = Currency.getInstance(balanceAccount.getCurrencyCode().toUpperCase());
balances.add(new Balance(currency.getCommonlyUsedCurrency(), balanceAccount.getTotalBalance(), balanceAccount.getAvailableBalance()));
}
return Wallet.Builder.from(balances).build();
}
Aggregations