Package org.bitcoinj.base
Interface Network
-
- All Known Implementing Classes:
BitcoinNetwork
,MockAltNetwork
public interface Network
Interface for a generic Bitcoin-like cryptocurrency network. SeeBitcoinNetwork
for the Bitcoin implementation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
exceedsMaxMoney(Monetary monetary)
Check if an amount exceeds the maximum allowed for a network (if the network has one)boolean
hasMaxMoney()
Does this network have a fixed maximum number of coinsjava.lang.String
id()
The dot-seperated string id for this network.int
legacyAddressHeader()
Header byte of base58 encoded legacy P2PKH addresses for this network.int
legacyP2SHHeader()
Header byte of base58 encoded legacy P2SH addresses for this network.Monetary
maxMoney()
Maximum number of coins for this network as aMonetary
value.java.lang.String
segwitAddressHrp()
Human-readable part (HRP) of bech32 encoded segwit addresses for this network.java.lang.String
uriScheme()
The URI scheme for this network.
-
-
-
Method Detail
-
id
java.lang.String id()
The dot-seperated string id for this network. For example"org.bitcoin.production"
- Returns:
- String ID for network
-
legacyAddressHeader
int legacyAddressHeader()
Header byte of base58 encoded legacy P2PKH addresses for this network.- Returns:
- header byte as an
int
. - See Also:
LegacyAddress.AddressHeader
-
legacyP2SHHeader
int legacyP2SHHeader()
Header byte of base58 encoded legacy P2SH addresses for this network.- Returns:
- header byte as an
int
. - See Also:
LegacyAddress.P2SHHeader
-
segwitAddressHrp
java.lang.String segwitAddressHrp()
Human-readable part (HRP) of bech32 encoded segwit addresses for this network.- Returns:
- HRP (lowercase)
-
uriScheme
java.lang.String uriScheme()
The URI scheme for this network. SeeBitcoinNetwork.uriScheme()
.- Returns:
- The URI scheme for this network
-
hasMaxMoney
boolean hasMaxMoney()
Does this network have a fixed maximum number of coins- Returns:
true
if this network has a fixed maximum number of coins
-
maxMoney
Monetary maxMoney()
Maximum number of coins for this network as aMonetary
value. Where not applicable, a very large number of coins is returned instead (e.g. the main coin issue for Dogecoin).- Returns:
- Maximum number of coins for this network
-
exceedsMaxMoney
boolean exceedsMaxMoney(Monetary monetary)
Check if an amount exceeds the maximum allowed for a network (if the network has one)- Parameters:
monetary
- A monetary amount- Returns:
- true if too big, false if an allowed amount
-
-