org.knowm.xchange.dto.account.Balance.getAvailable()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(169)

本文整理了Java中org.knowm.xchange.dto.account.Balance.getAvailable()方法的一些代码示例,展示了Balance.getAvailable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Balance.getAvailable()方法的具体详情如下:
包路径:org.knowm.xchange.dto.account.Balance
类名称:Balance
方法名:getAvailable

Balance.getAvailable介绍

[英]Returns the amount of the currency in this balance that is available to trade.
[中]返回此余额中可用于交易的currency金额。

代码示例

代码示例来源:origin: knowm/XChange

/**
 * 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());
}

代码示例来源:origin: knowm/XChange

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());
 }
}

代码示例来源:origin: knowm/XChange

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());
}

代码示例来源:origin: knowm/XChange

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());
}

代码示例来源:origin: knowm/XChange

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());
}

代码示例来源:origin: knowm/XChange

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());
}

代码示例来源:origin: org.knowm.xchange/xchange-core

/**
 * 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());
}

代码示例来源:origin: org.knowm.xchange/xchange-core

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());
}

相关文章