Represents an ABI (Application Binary Interface) item.

Hierarchy (view full)

Constructors

Properties

signature: AbiEvent | AbiFunction
stringSignature: string

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

  • Returns a string representation of a JSON object or a string.

    Parameters

    • formatType: "string" | "json" = 'string'

      Either JSON or String

    Returns string

    The string representation of the ABI item.

  • Checks if the current ABI object is equal to the given ABI object.

    Parameters

    • that: ABI

      The ABI object to compare with.

    Returns boolean

    True if the objects are equal, false otherwise. VeChainDataModel#isEqual

    The comparison is done by comparing the types and values of the ABI instances.

  • 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.

  • Type Parameters

    Parameters

    • ABIItemConstructor: (new (signature: string) => T)
        • new (signature): T
        • Parameters

          • signature: string

          Returns T

    • signature: string

    Returns T

  • Type Parameters

    Parameters

    • ABIItemConstructor: (new (signature: AbiFunction) => T)
        • new (signature): T
        • Parameters

          • signature: AbiFunction

          Returns T

    • signature: AbiFunction

    Returns T

  • Type Parameters

    Parameters

    • ABIItemConstructor: (new (signature: AbiEvent) => T)
        • new (signature): T
        • Parameters

          • signature: AbiEvent

          Returns T

    • signature: AbiEvent

    Returns T