Package foundation.omni.net
Enum Class OmniNetwork
- All Implemented Interfaces:
Serializable
,Comparable<OmniNetwork>
,java.lang.constant.Constable
,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:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.bitcoinj.base.AddressParser.AddressParserProvider
static final String
Scheme part for Bitcoin URIs.static final String
The ID string for the main, production network where people trade things.static final String
The ID string for regtest mode.static final String
The ID string for the signet.static final String
The ID string for the testnet.static final String
The ID string for the Unit test network -- there is no correspondingenum
.static final org.bitcoinj.base.Coin
The maximum money to be generated -
Method Summary
Modifier and TypeMethodDescriptionorg.bitcoinj.base.BitcoinNetwork
boolean
exceedsMaxMoney
(org.bitcoinj.base.Monetary amount) org.bitcoinj.base.Address
static Optional
<OmniNetwork> fromIdString
(String idString) Find theBitcoinNetwork
from an ID Stringstatic Optional
<OmniNetwork> fromString
(String nameString) Find theBitcoinNetwork
from a name string, e.g.boolean
id()
Return the network ID string (previously specified inNetworkParameters
)int
Header byte of base58 encoded legacy P2PKH addresses for this network.int
Header byte of base58 encoded legacy P2SH addresses for this network.org.bitcoinj.base.Coin
maxMoney()
org.bitcoinj.base.Address
static OmniNetwork
of
(org.bitcoinj.base.Network bitcoinNetwork) Return the standard Bech32SegwitAddress.SegwitHrp
(as aString
) for this network.toString()
Return the canonical, lowercase, user-facingString
for anenum
The URI scheme for Bitcoin.static OmniNetwork
Returns the enum constant of this class with the specified name.static OmniNetwork[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MAINNET
-
TESTNET
-
SIGNET
-
REGTEST
-
-
Field Details
-
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_MONEYThe maximum money to be generated -
ID_MAINNET
The ID string for the main, production network where people trade things. -
ID_TESTNET
The ID string for the testnet. -
ID_SIGNET
The ID string for the signet. -
ID_REGTEST
The ID string for regtest mode. -
ID_UNITTESTNET
The ID string for the Unit test network -- there is no correspondingenum
.- See Also:
-
-
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
-
toString
Return the canonical, lowercase, user-facingString
for anenum
- Overrides:
toString
in classEnum<OmniNetwork>
- Returns:
- canonical lowercase value
-
id
Return the network ID string (previously specified inNetworkParameters
)- Specified by:
id
in interfaceorg.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 interfaceorg.bitcoinj.base.Network
- Returns:
- header byte as an
int
. - See Also:
-
legacyP2SHHeader
public int legacyP2SHHeader()Header byte of base58 encoded legacy P2SH addresses for this network.- Specified by:
legacyP2SHHeader
in interfaceorg.bitcoinj.base.Network
- Returns:
- header byte as an
int
. - See Also:
-
segwitAddressHrp
Return the standard Bech32SegwitAddress.SegwitHrp
(as aString
) for this network.- Specified by:
segwitAddressHrp
in interfaceorg.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
-
uriScheme
The URI scheme for Bitcoin.- Specified by:
uriScheme
in interfaceorg.bitcoinj.base.Network
- Returns:
- string containing the URI scheme
- See Also:
-
hasMaxMoney
public boolean hasMaxMoney()- Specified by:
hasMaxMoney
in interfaceorg.bitcoinj.base.Network
-
maxMoney
public org.bitcoinj.base.Coin maxMoney()- Specified by:
maxMoney
in interfaceorg.bitcoinj.base.Network
-
exceedsMaxMoney
public boolean exceedsMaxMoney(org.bitcoinj.base.Monetary amount) - Specified by:
exceedsMaxMoney
in interfaceorg.bitcoinj.base.Network
-
fromString
Find theBitcoinNetwork
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
Find theBitcoinNetwork
from an ID StringNote:
ID_UNITTESTNET
is not supported as an enum- Parameters:
idString
- specifies the network- Returns:
- An
Optional
containing the matching enum or empty
-