Package org.bitcoinj.base
Interface Network
-
- All Known Implementing Classes:
BitcoinNetwork,MockAltNetwork
public interface NetworkInterface for a generic Bitcoin-like cryptocurrency network. SeeBitcoinNetworkfor the Bitcoin implementation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanexceedsMaxMoney(Monetary monetary)Check if an amount exceeds the maximum allowed for a network (if the network has one)booleanhasMaxMoney()Does this network have a fixed maximum number of coinsjava.lang.Stringid()The dot-seperated string id for this network.intlegacyAddressHeader()Header byte of base58 encoded legacy P2PKH addresses for this network.intlegacyP2SHHeader()Header byte of base58 encoded legacy P2SH addresses for this network.MonetarymaxMoney()Maximum number of coins for this network as aMonetaryvalue.java.lang.StringsegwitAddressHrp()Human-readable part (HRP) of bech32 encoded segwit addresses for this network.java.lang.StringuriScheme()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:
trueif this network has a fixed maximum number of coins
-
maxMoney
Monetary maxMoney()
Maximum number of coins for this network as aMonetaryvalue. 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
-
-