Skip to content

AbiError.format

Formats an AbiError.AbiError into a Human Readable ABI Error.

Imports

Named
import { AbiError } from 'ox'

Examples

import { AbiError } from 'ox'
 
const formatted = AbiError.format({
  type: 'error',
  name: 'Example',
  inputs: [
    {
      name: 'spender',
      type: 'address',
    },
    {
      name: 'amount',
      type: 'uint256',
    },
  ],
})
 
const formatted: "error Example(address spender, uint256 amount)"
formatted

Definition

function format<abiError>(
  abiError: abiError | AbiError,
): abitype.FormatAbiItem<abiError>

Source: src/core/AbiError.ts

Parameters

abiError

  • Type: abiError | AbiError

The ABI Error to format.

Return Type

The formatted ABI Error.

abitype.FormatAbiItem<abiError>