Class Wallet

java.lang.Object
org.knowm.xchange.dto.account.Wallet
All Implemented Interfaces:
Serializable

public final class Wallet
extends Object
implements Serializable
DTO representing a wallet

A wallet has a set of current balances in various currencies held on the exchange.

See Also:
Serialized Form
  • Constructor Details

    • Wallet

      public Wallet​(String id, String name, Collection<Balance> balances, Set<Wallet.WalletFeature> features, BigDecimal maxLeverage, BigDecimal currentLeverage)
      Constructs a Wallet.
      Parameters:
      id - the wallet id
      name - a descriptive name for the wallet
      balances - the balances, the currencies of the balances should not be duplicated.
      features - all the features that wallet supports

      maxLeverage and currentLeverage are BigDecimal.ZERO for the default constructor

  • Method Details

    • getId

      public String getId()
      Returns:
      The wallet id
    • getName

      public String getName()
      Returns:
      A descriptive name for the wallet
    • getBalances

      public Map<Currency,​Balance> getBalances()
      Returns:
      The available balances (amount and currency)
    • getFeatures

      public Set<Wallet.WalletFeature> getFeatures()
      Returns:
      All wallet operation features
    • getMaxLeverage

      public BigDecimal getMaxLeverage()
      Returns:
      Max leverage of wallet
    • getCurrentLeverage

      public BigDecimal getCurrentLeverage()
      Returns:
      current leverage of wallet
    • getBalance

      public Balance getBalance​(Currency currency)
      Returns the balance for the specified currency.
      Parameters:
      currency - a Currency.
      Returns:
      the balance of the specified currency, or a zero balance if currency not present
    • equals

      public boolean equals​(Object object)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object