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 Type
    Method
    Description
    boolean
    Check if an amount exceeds the maximum allowed for a network (if the network has one)
    boolean
    Does this network have a fixed maximum number of coins
    id()
    The dot-seperated string id for this network.
    int
    Header byte of base58 encoded legacy P2PKH addresses for this network.
    int
    Header byte of base58 encoded legacy P2SH addresses for this network.
    Maximum number of coins for this network as a Monetary value.
    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. See BitcoinNetwork.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 a Monetary 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