Package org.knowm.xchange.dto.account
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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Wallet.Builder
static class
Wallet.WalletFeature
-
Constructor Summary
Constructors Constructor Description Wallet(String id, String name, Collection<Balance> balances, Set<Wallet.WalletFeature> features, BigDecimal maxLeverage, BigDecimal currentLeverage)
Constructs aWallet
. -
Method Summary
Modifier and Type Method Description Collection<Balance>
balances()
boolean
equals(Object object)
Balance
getBalance(Currency currency)
Returns the balance for the specified currency.Map<Currency,Balance>
getBalances()
BigDecimal
getCurrentLeverage()
Set<Wallet.WalletFeature>
getFeatures()
String
getId()
BigDecimal
getMaxLeverage()
String
getName()
int
hashCode()
String
toString()
-
Constructor Details
-
Wallet
public Wallet(String id, String name, Collection<Balance> balances, Set<Wallet.WalletFeature> features, BigDecimal maxLeverage, BigDecimal currentLeverage)Constructs aWallet
.- Parameters:
id
- the wallet idname
- a descriptive name for the walletbalances
- the balances, the currencies of the balances should not be duplicated.features
- all the features that wallet supportsmaxLeverage and currentLeverage are BigDecimal.ZERO for the default constructor
-
-
Method Details
-
getId
- Returns:
- The wallet id
-
getName
- Returns:
- A descriptive name for the wallet
-
balances
- Returns:
- The available colletion of balances
-
getBalances
- Returns:
- The available balances (amount and currency)
-
getFeatures
- Returns:
- All wallet operation features
-
getMaxLeverage
- Returns:
- Max leverage of wallet
-
getCurrentLeverage
- Returns:
- current leverage of wallet
-
getBalance
Returns the balance for the specified currency.- Parameters:
currency
- aCurrency
.- Returns:
- the balance of the specified currency, or a zero balance if currency not present
-
equals
-
hashCode
public int hashCode() -
toString
-