Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Address

A Value Object to facilitate Address conversions.

Hierarchy

  • Address

Index

Methods

equals

  • equals(address: Address): boolean

getNumericId

  • getNumericId(): string

getPublicKey

  • getPublicKey(): string

getReedSolomonAddress

  • getReedSolomonAddress(withPrefix?: boolean): string

getReedSolomonAddressExtended

  • getReedSolomonAddressExtended(withPrefix?: boolean): string
  • 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.

    throws

    if no public key is available

    see

    Address.getReedSolomonAddress

    Parameters

    • Default value withPrefix: boolean = true

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

    Returns string

    Extended Reed Solomon Address Format

Static create

  • create(anyValidAddress: string, prefix?: string): Address
  • Tries to create the address from whatever input is given

    throws

    when no valid format

    Parameters

    • anyValidAddress: string

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

    • Default value 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

Static fromNumericId

  • fromNumericId(numericId: string, prefix?: string): Address

Static fromPublicKey

  • fromPublicKey(publicKey: string, prefix?: string): Address
  • Creates an Account Address object from public key

    Parameters

    • publicKey: string

      The public key of that address (in hex format)

    • Default value prefix: string = AddressPrefix.MainNet

      The Reed-Solomon Address prefix

    Returns Address

Static fromReedSolomonAddress

  • fromReedSolomonAddress(address: string): Address
  • Creates an Account Address object from extended Reed-Solomon address

    throws

    Error if the passed address is invalid

    Parameters

    • address: string

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

    Returns Address