public static Wallet adaptWallet(List<BankeraWallet> wallets) { List<Balance> balances = wallets .stream() .map( w -> new Balance.Builder() .total(new BigDecimal(w.getTotal())) .available(new BigDecimal(w.getBalance())) .frozen(new BigDecimal(w.getReserved())) .currency(new Currency(w.getCurrency())) .build()) .collect(Collectors.toList()); return new Wallet(balances); }
switch (livecoinBalance.getType()) { case "total": builder.total(value); break; case "available":
/** * @param exxAccountInformation * @return */ public static AccountInfo convertBalance(EXXAccountInformation exxAccountInformation) { List<Balance> balances = new ArrayList<Balance>(); Map<String, EXXBalance> exxBalances = exxAccountInformation.getBalances(); for (Map.Entry<String, EXXBalance> exxBalanceMap : exxBalances.entrySet()) { String pair = exxBalanceMap.getKey(); if (pair != null) { balances.add( new Balance.Builder() .currency(Currency.getInstance(pair)) .available(exxBalanceMap.getValue().getBalance()) .total(exxBalanceMap.getValue().getTotal()) .frozen(exxBalanceMap.getValue().getFreeze()) .build()); } } return new AccountInfo(new Wallet(balances)); }
public static Builder from(Balance balance) { return new Builder() .currency(balance.getCurrency()) .total(balance.getTotal()) .available(balance.getAvailable()) .frozen(balance.getFrozen()) .borrowed(balance.getBorrowed()) .loaned(balance.getLoaned()) .withdrawing(balance.getWithdrawing()) .depositing(balance.getDepositing()); }
.getAnyAssetBalance(currency) .getAvailable()) .total( coinsuperBalances .getData()
/** * Adapts a GatecoinBalance to a Wallet * * @param gatecoinBalances * @return The account info */ public static Wallet adaptWallet(GatecoinBalance[] gatecoinBalances) { ArrayList<Balance> balances = new ArrayList<>(); for (GatecoinBalance balance : gatecoinBalances) { Currency ccy = Currency.getInstance(balance.getCurrency()); balances.add( new Balance.Builder() .currency(ccy) .total(balance.getBalance()) .available(balance.getAvailableBalance()) .frozen(balance.getOpenOrder().negate()) .withdrawing(balance.getPendingOutgoing().negate()) .depositing(balance.getPendingIncoming().negate()) .build()); } return new Wallet(balances); }
public static Builder from(Balance balance) { return new Builder() .currency(balance.getCurrency()) .total(balance.getTotal()) .available(balance.getAvailable()) .frozen(balance.getFrozen()) .borrowed(balance.getBorrowed()) .loaned(balance.getLoaned()) .withdrawing(balance.getWithdrawing()) .depositing(balance.getDepositing()); }
private static Balance adaptBalance(BiboxCoin coin) { return new Balance.Builder() .currency(Currency.getInstance(coin.getSymbol())) .available(coin.getBalance()) .frozen(coin.getFreeze()) .total(coin.getBalance().add(coin.getFreeze())) .build(); }