Enum Class OmniNetwork

java.lang.Object
java.lang.Enum<OmniNetwork>
foundation.omni.net.OmniNetwork
All Implemented Interfaces:
Serializable, Comparable<OmniNetwork>, java.lang.constant.Constable, org.bitcoinj.base.Network

public enum OmniNetwork extends Enum<OmniNetwork> implements org.bitcoinj.base.Network
Definitions for Omni "safe" addresses. This should only be used for constructing addresses with bitcoinj, for other functions the BitcoinNetwork instances should be used.
See Also:
  • Enum Constant Details

  • Field Details

    • BITCOIN_SCHEME

      public static final String BITCOIN_SCHEME
      Scheme part for Bitcoin URIs.
      See Also:
    • addressParser

      public static final org.bitcoinj.base.AddressParser.AddressParserProvider addressParser
    • MAX_MONEY

      public static final org.bitcoinj.base.Coin MAX_MONEY
      The maximum money to be generated
    • ID_MAINNET

      public static final String ID_MAINNET
      The ID string for the main, production network where people trade things.
    • ID_TESTNET

      public static final String ID_TESTNET
      The ID string for the testnet.
    • ID_SIGNET

      public static final String ID_SIGNET
      The ID string for the signet.
    • ID_REGTEST

      public static final String ID_REGTEST
      The ID string for regtest mode.
    • ID_UNITTESTNET

      public static final String ID_UNITTESTNET
      The ID string for the Unit test network -- there is no corresponding enum.
      See Also:
  • Method Details

    • values

      public static OmniNetwork[] 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 OmniNetwork 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
    • toString

      public String toString()
      Return the canonical, lowercase, user-facing String for an enum
      Overrides:
      toString in class Enum<OmniNetwork>
      Returns:
      canonical lowercase value
    • id

      public String id()
      Return the network ID string (previously specified in NetworkParameters)
      Specified by:
      id in interface org.bitcoinj.base.Network
      Returns:
      The network ID string
    • legacyAddressHeader

      public int legacyAddressHeader()
      Header byte of base58 encoded legacy P2PKH addresses for this network.
      Specified by:
      legacyAddressHeader in interface org.bitcoinj.base.Network
      Returns:
      header byte as an int.
      See Also:
      • LegacyAddress.AddressHeader
    • legacyP2SHHeader

      public int legacyP2SHHeader()
      Header byte of base58 encoded legacy P2SH addresses for this network.
      Specified by:
      legacyP2SHHeader in interface org.bitcoinj.base.Network
      Returns:
      header byte as an int.
      See Also:
      • LegacyAddress.P2SHHeader
    • segwitAddressHrp

      public String segwitAddressHrp()
      Return the standard Bech32 SegwitAddress.SegwitHrp (as a String) for this network.
      Specified by:
      segwitAddressHrp in interface org.bitcoinj.base.Network
      Returns:
      The HRP as a (lowercase) string.
    • exodusAddress

      public org.bitcoinj.base.Address exodusAddress()
    • moneyManAddress

      public org.bitcoinj.base.Address moneyManAddress()
    • bitcoinNetwork

      public org.bitcoinj.base.BitcoinNetwork bitcoinNetwork()
    • of

      public static OmniNetwork of(org.bitcoinj.base.Network bitcoinNetwork)
    • uriScheme

      public String uriScheme()
      The URI scheme for Bitcoin.
      Specified by:
      uriScheme in interface org.bitcoinj.base.Network
      Returns:
      string containing the URI scheme
      See Also:
    • hasMaxMoney

      public boolean hasMaxMoney()
      Specified by:
      hasMaxMoney in interface org.bitcoinj.base.Network
    • maxMoney

      public org.bitcoinj.base.Coin maxMoney()
      Specified by:
      maxMoney in interface org.bitcoinj.base.Network
    • exceedsMaxMoney

      public boolean exceedsMaxMoney(org.bitcoinj.base.Monetary amount)
      Specified by:
      exceedsMaxMoney in interface org.bitcoinj.base.Network
    • fromString

      public static Optional<OmniNetwork> fromString(String nameString)
      Find the BitcoinNetwork from a name string, e.g. "mainnet", "testnet" or "signet". A number of common alternate names are allowed too, e.g. "main" or "prod".
      Parameters:
      nameString - A name string
      Returns:
      An Optional containing the matching enum or empty
    • fromIdString

      public static Optional<OmniNetwork> fromIdString(String idString)
      Find the BitcoinNetwork from an ID String

      Note: ID_UNITTESTNET is not supported as an enum

      Parameters:
      idString - specifies the network
      Returns:
      An Optional containing the matching enum or empty