java.lang.Object
java.lang.Enum<Coin>
com.barbantfintech.tools.common.cryptojdk.enums.Coin
All Implemented Interfaces:
Serializable, Comparable<Coin>, Constable

public enum Coin extends Enum<Coin>
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:
  • Enum Constant Details

    • BTC

      public static final Coin BTC
      Bitcoin cryptocurrency.
    • ETH

      public static final Coin ETH
      Ethereum cryptocurrency.
    • USDT

      public static final Coin USDT
      USD Tether stable-coin.
    • USDC

      public static final Coin USDC
      USD Coin stable-coin.
    • DAI

      public static final Coin DAI
      Dai stable-coin.
  • Method Details

    • values

      public static Coin[] 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

      public static Coin valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • values

      public static Collection<Coin> values(NetBase netBase)
      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

      public static Collection<Coin> values(Network network)
      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

      public static Coin getCoin(@NonNull @NonNull String smartContractAddress, Network network)
      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.