Enum Class Coin
- All Implemented Interfaces:
Serializable
,Comparable<Coin>
,Constable
Enum representing various cryptocurrencies supported by the library.
Holds details about each cryptocurrency like its code, name, precision (scale), minimum value, supported networks, base network, type of coin, and optionally, the associated smart contract address.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic Coin
Get the coin by its smart contract address and network.static Coin
Returns the enum constant of this class with the specified name.static Coin[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.static Collection
<Coin> Get all coins for the specified base network.static Collection
<Coin> Get all coins that are supported on the specified network.
-
Enum Constant Details
-
BTC
Bitcoin cryptocurrency. -
ETH
Ethereum cryptocurrency. -
USDT
USD Tether stable-coin. -
USDC
USD Coin stable-coin. -
DAI
Dai stable-coin.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
values
Get all coins for the specified base network.- Parameters:
netBase
- The base network.- Returns:
- A collection of coins that belong to the specified base network.
-
values
Get all coins that are supported on the specified network.- Parameters:
network
- The network.- Returns:
- A collection of coins that are supported on the specified network.
-
getCoin
Get the coin by its smart contract address and network.- Parameters:
smartContractAddress
- The smart contract address of the coin.network
- The network on which the coin is supported.- Returns:
- The coin associated with the provided smart contract address and network, or
null
if no such coin is found.
-