Class Address

A Value Object to facilitate Address conversions.

Methods

  • Gets as extended Reed Solomon representation carrying the public key as suffix in base36 encoding

    This method requires that the address was created from a public key or extended address.

    Parameters

    • withPrefix: boolean = true

      If false, the address without prefix will be returned. Default: true

    Returns string

    Extended Reed Solomon Address Format

    if no public key is available

    Address.getReedSolomonAddress

  • Tries to create the address from whatever input is given

    Parameters

    • anyValidAddress: string

      Any valid address, may it be Reed Solomon address, numeric ID, or public key

    • prefix: string = AddressPrefix.MainNet

      An optional prefix, which can be used to substitute the default AddressPrefix.MainNet

    Returns Address

    The new address, if the input was valid

    when no valid format

  • Creates an Account Address object from public key

    Parameters

    • publicKey: string

      The public key of that address (in hex format)

    • prefix: string = AddressPrefix.MainNet

      The Reed-Solomon Address prefix

    Returns Address

  • Creates an Account Address object from extended Reed-Solomon address

    Parameters

    • address: string

      The Reed-Solomon address in simple or extended format (with base36 suffix)

    Returns Address

    Error if the passed address is invalid