Skip to main content

Overview

Item.format formats a single ABI item (function/event/error/etc.) as a readable signature string.

Quick Start

import { Abi } from '@tevm/voltaire/Abi';

const fn = {
  type: 'function',
  name: 'balanceOf',
  inputs: [{ type: 'address', name: 'owner' }],
  outputs: [{ type: 'uint256' }],
  stateMutability: 'view'
} as const;

const formatted = Abi.Item.format(fn);
// "function balanceOf(address owner) returns (uint256) view"

See Also