Class WrappedMainNetParams

java.lang.Object
org.bitcoinj.core.NetworkParameters
org.bitcoinj.params.AbstractBitcoinNetParams
org.bitcoinj.params.MainNetParams
com.barbantfintech.tools.common.cryptojdk.netparams.WrappedMainNetParams
All Implemented Interfaces:
IWrappedNetParams

public class WrappedMainNetParams extends org.bitcoinj.params.MainNetParams implements IWrappedNetParams
Wrapped implementation of MainNet parameters for the library.

This class extends the MainNetParams class and implements the IWrappedNetParams interface, providing the necessary network parameters for main network operations.

The class encapsulates the main network parameters and provides methods to retrieve network-specific information such as network ID, name, and coin ID.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bitcoinj.core.NetworkParameters

    org.bitcoinj.core.NetworkParameters.ProtocolVersion
  • Field Summary

    Fields inherited from class org.bitcoinj.params.MainNetParams

    MAINNET_MAJORITY_ENFORCE_BLOCK_UPGRADE, MAINNET_MAJORITY_REJECT_BLOCK_OUTDATED, MAINNET_MAJORITY_WINDOW

    Fields inherited from class org.bitcoinj.params.AbstractBitcoinNetParams

    BITCOIN_SCHEME, genesisBlock, REWARD_HALVING_INTERVAL

    Fields inherited from class org.bitcoinj.core.NetworkParameters

    addressHeader, addrSeeds, BIP16_ENFORCE_TIME, bip32HeaderP2PKHpriv, bip32HeaderP2PKHpub, bip32HeaderP2WPKHpriv, bip32HeaderP2WPKHpub, checkpoints, defaultSerializer, dnsSeeds, dumpedPrivateKeyHeader, httpSeeds, id, ID_MAINNET, ID_REGTEST, ID_TESTNET, ID_UNITTESTNET, interval, INTERVAL, majorityEnforceBlockUpgrade, majorityRejectBlockOutdated, majorityWindow, MAX_COINS, MAX_MONEY, maxTarget, p2shHeader, packetMagic, PAYMENT_PROTOCOL_ID_MAINNET, PAYMENT_PROTOCOL_ID_REGTEST, PAYMENT_PROTOCOL_ID_TESTNET, PAYMENT_PROTOCOL_ID_UNIT_TESTS, port, segwitAddressHrp, spendableCoinbaseDepth, subsidyDecreaseBlockCount, TARGET_SPACING, TARGET_TIMESPAN, targetTimespan
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    Returns the singleton instance of WrappedMainNetParams.
    void
    setBIP32Headers(String bech32, int pubKeyHash, int scriptHash, int wif, int p2pkhPub, int p2pkhPriv, int p2wpkhPub, int p2wpkhPriv)
    Sets the BIP32 headers for the network parameters.

    Methods inherited from class org.bitcoinj.params.MainNetParams

    getGenesisBlock, getPaymentProtocolId

    Methods inherited from class org.bitcoinj.params.AbstractBitcoinNetParams

    checkDifficultyTransitions, getBlockInflation, getMaxMoney, getMinNonDustOutput, getMonetaryFormat, getProtocolVersionNum, getSerializer, getUriScheme, hasMaxMoney, isDifficultyTransitionPoint, isRewardHalvingPoint

    Methods inherited from class org.bitcoinj.core.NetworkParameters

    allowEmptyPeerChain, equals, fromID, fromPmtProtocolID, getAddressHeader, getAddrSeeds, getBip32HeaderP2PKHpriv, getBip32HeaderP2PKHpub, getBip32HeaderP2WPKHpriv, getBip32HeaderP2WPKHpub, getBlockVerificationFlags, getDefaultSerializer, getDnsSeeds, getDumpedPrivateKeyHeader, getHttpSeeds, getId, getInterval, getMajorityEnforceBlockUpgrade, getMajorityRejectBlockOutdated, getMajorityWindow, getMaxTarget, getP2SHHeader, getPacketMagic, getPort, getSegwitAddressHrp, getSpendableCoinbaseDepth, getSubsidyDecreaseBlockCount, getTargetTimespan, getTransactionVerificationFlags, hashCode, isCheckpoint, passesCheckpoint

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WrappedMainNetParams

      public WrappedMainNetParams()
  • Method Details

    • get

      public static WrappedMainNetParams get()
      Returns the singleton instance of WrappedMainNetParams.

      This method ensures that only one instance of WrappedMainNetParams is created, and provides a global point of access to it.

      Returns:
      the singleton instance of WrappedMainNetParams.
    • setBIP32Headers

      public void setBIP32Headers(String bech32, int pubKeyHash, int scriptHash, int wif, int p2pkhPub, int p2pkhPriv, int p2wpkhPub, int p2wpkhPriv)
      Sets the BIP32 headers for the network parameters.

      This method configures several BIP32 headers required for different types of keys and addresses in the network.

      Specified by:
      setBIP32Headers in interface IWrappedNetParams
      Parameters:
      bech32 - the Bech32 human-readable part for segregated witness addresses.
      pubKeyHash - the public key hash.
      scriptHash - the script hash.
      wif - the Wallet Import Format (WIF).
      p2pkhPub - the public key for Pay-to-PubKeyHash (P2PKH) addresses.
      p2pkhPriv - the private key for Pay-to-PubKeyHash (P2PKH) addresses.
      p2wpkhPub - the public key for Pay-to-Witness-PubKeyHash (P2WPKH) addresses.
      p2wpkhPriv - the private key for Pay-to-Witness-PubKeyHash (P2WPKH) addresses.