/** * Returns the amount of the <code>currency</code> in this balance that may be withdrawn. Equal to * <code>available - borrowed</code>. * * @return the amount that is available to withdraw. */ public BigDecimal getAvailableForWithdrawal() { return getAvailable().subtract(getBorrowed()); }
private static void generic(AccountService accountService) throws IOException { // Get the account information AccountInfo accountInfo = accountService.getAccountInfo(); System.out.println("Account balances: (available / available for withdrawal / total)"); Wallet wallet = accountInfo.getWallet(); Map<Currency, Balance> balances = wallet.getBalances(); for (Map.Entry<Currency, Balance> entry : balances.entrySet()) { Balance balance = entry.getValue(); System.out.format( "%s balance: %s / %s / %s\n", entry.getKey().getCurrencyCode(), balance.getAvailable(), balance.getAvailableForWithdrawal(), balance.getTotal()); } }
private static void generic(AccountService accountService) throws IOException { AccountInfo accountInfo = accountService.getAccountInfo(); System.out.println("Wallet: " + accountInfo); System.out.println( "ETH balance: " + accountInfo.getWallet().getBalance(Currency.ETH).getAvailable()); }
private static void generic(AccountService accountService) throws IOException { // Get the account information AccountInfo accountInfo = accountService.getAccountInfo(); System.out.println("Wallet: " + accountInfo); System.out.println( "BTC balance: " + accountInfo.getWallet().getBalance(Currency.BTC).getAvailable()); }
private static void generic(AccountService accountService) throws IOException { AccountInfo accountInfo = accountService.getAccountInfo(); System.out.println("Wallet: " + accountInfo); System.out.println( "ETH balance: " + accountInfo.getWallet().getBalance(Currency.ETH).getAvailable()); }
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()); }
/** * Returns the amount of the <code>currency</code> in this balance that may be withdrawn. Equal to * <code>available - borrowed</code>. * * @return the amount that is available to withdraw. */ public BigDecimal getAvailableForWithdrawal() { return getAvailable().subtract(getBorrowed()); }
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()); }