Package org.bitcoinj.base
Interface Network
- All Known Implementing Classes:
BitcoinNetwork,MockAltNetwork
public interface Network
Interface for a generic Bitcoin-like cryptocurrency network. See
BitcoinNetwork for the Bitcoin implementation.-
Method Summary
Modifier and TypeMethodDescriptionbooleanexceedsMaxMoney(Monetary monetary) Check if an amount exceeds the maximum allowed for a network (if the network has one)booleanDoes this network have a fixed maximum number of coinsid()The dot-seperated string id for this network.intHeader byte of base58 encoded legacy P2PKH addresses for this network.intHeader byte of base58 encoded legacy P2SH addresses for this network.maxMoney()Maximum number of coins for this network as aMonetaryvalue.Human-readable part (HRP) of bech32 encoded segwit addresses for this network.The URI scheme for this network.
-
Method Details
-
id
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:
-
legacyP2SHHeader
int legacyP2SHHeader()Header byte of base58 encoded legacy P2SH addresses for this network.- Returns:
- header byte as an
int. - See Also:
-
segwitAddressHrp
String segwitAddressHrp()Human-readable part (HRP) of bech32 encoded segwit addresses for this network.- Returns:
- HRP (lowercase)
-
uriScheme
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
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
-