use of org.knowm.xchange.bitbay.dto.acount.BitbayBalance in project XChange by knowm.
the class BitbayAdapters method adaptAccountInfo.
public static AccountInfo adaptAccountInfo(String userName, BitbayAccountInfoResponse bitbayAccountInfo) {
List<Balance> balances = new ArrayList<>(bitbayAccountInfo.getBitbayBalances().size());
for (Map.Entry<String, BitbayBalance> entry : bitbayAccountInfo.getBitbayBalances().entrySet()) {
Currency currency = Currency.getInstance(entry.getKey());
BitbayBalance balance = entry.getValue();
balances.add(new Balance(currency, balance.getAvailable().add(balance.getLocked()), balance.getAvailable(), balance.getLocked()));
}
return new AccountInfo(userName, Wallet.Builder.from(balances).build());
}
Aggregations