Options
All
  • Public
  • Public/Protected
  • All
Menu

Representation of Address.

There are 4 types of address:

  1. Public key based
  2. Multi public key based (m, n)
  3. Contract based
  4. ONT ID based

The value is stored as base58 or hex encoded, therefore always use toBase58() or serialize() according to requirements.

Hierarchy

  • Address

Index

Constructors

constructor

  • new Address(value: string): Address

Properties

value

value: string

Base58 or Hex encoded address

Methods

getB58Checksum

  • getB58Checksum(): string

serialize

  • serialize(): string

toBase58

  • toBase58(): string

toHexString

  • toHexString(): string

Static deserialize

Static fromMultiPubKeys

  • Generates (m, n) threshold address.

    m - threshold n - total number of public keys

    Parameters

    • m: number

      The threshold

    • publicKeys: PublicKey[]

      Public key

    Returns Address

Static fromOntid

  • fromOntid(ontid: string): Address
  • Generates identity based address.

    Parameters

    • ontid: string

      ONT ID in the form did:ont:AXmQDzzvpEtPkNwBEFsREzApTTDZFW6frD

    Returns Address

Static fromPubKey

Static fromVmCode

  • fromVmCode(vmCode: string): Address
  • Generates address from smart contract code.

    Parameters

    • vmCode: string

      Hex encoded smart contract code

    Returns Address

Static generateOntid

  • generateOntid(publicKey: PublicKey): string

Generated using TypeDoc