Class AddressVerificator

Constructors

Methods

  • Checks if the given address is a valid P2PKH or P2SH address.

    Parameters

    • addy: string

      The address to check.

    • network: Network

      The network to validate against.

    Returns boolean

    • True if the address is a valid P2PKH or P2SH address, false otherwise.

    This method is useful for validating legacy addresses (P2PKH or P2SH) without

  • Checks if the given address is a valid P2PKH address.

    Parameters

    • inAddress: string

      The address to check.

    • network: Network

      The network to validate against.

    Returns boolean

    • True if the address is a valid P2PKH address, false otherwise.

    This method is useful for validating legacy addresses (P2PKH) without

  • Checks if the given address is a valid P2PKH address.

    Parameters

    • inAddress: string

      The address to check.

    • network: Network

      The network to validate against.

    Returns boolean

    • True if the address is a valid P2PKH address, false otherwise.

    This method is useful for validating legacy addresses (P2PKH) without

  • Checks if the input is a valid hexadecimal public key (P2PK). Public keys can be compressed (66 characters) or uncompressed (130 characters).

    Parameters

    • input: string

      The input string to check.

    • network: Network

      The Bitcoin network to validate against (mainnet, testnet, etc.).

    Returns boolean

    • True if the input is a valid public key, false otherwise.
  • Validates if a given Bitcoin address is of the specified type and network.

    • P2PKH (Legacy address starting with '1' for mainnet or 'm/n' for testnet)
    • P2SH (Legacy address starting with '3' for mainnet or '2' for testnet)
    • P2SH-P2WPKH (Wrapped SegWit)
    • P2PK (Pay to PubKey, technically treated similarly to P2PKH)
    • P2WPKH (SegWit address starting with 'bc1q' for mainnet or 'tb1q' for testnet)
    • P2TR (Taproot address starting with 'bc1p' for mainnet or 'tb1p' for testnet)

    Parameters

    • addy: string

      The Bitcoin address to validate.

    • network: Network

      The Bitcoin network to validate against (mainnet, testnet, etc.).

    Returns null | AddressTypes

    • The type of the valid Bitcoin address, or null if invalid.