Represents an ABI (Application Binary Interface).

Hierarchy (view full)

Implements

Constructors

  • ABI constructor from types and values.

    Parameters

    • types: string | AbiParameter[] = []

      A list of ABI types representing the types of the values.

    • values: unknown[] = []

      An array of values according to the specified ABI types.

    Returns ABI

Accessors

  • get bi(): bigint
  • Throws an exception because the ABI cannot be represented as a big integer.

    Returns bigint

    The BigInt representation of the ABI.

    The ABI cannot be represented as a bigint. VeChainDataModel#bi

    The conversion to BigInt is not supported for an ABI.

  • get bytes(): Uint8Array
  • Encodes the values according to the specified ABI types when creating the ABI instance.

    Returns Uint8Array

    The ABI-encoded bytes representing the given values.

  • get n(): number
  • Throws an exception because the ABI cannot be represented as a number.

    Returns number

    The number representation of the ABI.

    The mnemonic cannot be represented as a number. VeChainDataModel#n

    The conversion to number is not supported for an ABI.

Methods

  • Recursively parses an object and collects the values of each attribute into an array, with nested arrays for nested objects.

    Parameters

    • obj: object

      The object to parse.

    Returns unknown[]

    An array of values from the object, with nested arrays for nested objects.

  • Instantiates an ABI object from the given types and values.

    Parameters

    • types: string | AbiParameter[]

      ABI parameters representing the types of the values.

    • values: unknown[]

      ABI values.

    Returns ABI

    The ABI object with the given types and values.

  • Decodes the ABI values from the given ABI types and encoded data.

    Parameters

    • types: string | AbiParameter[]

      The list of ABI types representing the types of the values to decode.

    • dataEncoded: string | Uint8Array

      The encoded data to decode.

    Returns ABI

    An ABI instance with the decoded values.