> ## Documentation Index
> Fetch the complete documentation index at: https://voltaire.tevm.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Abi.format

> Format ABI item to human-readable signature string

<Card title="Try it Live" icon="play" href="https://playground.tevm.sh?example=primitives/abi.ts">
  Run ABI examples in the interactive playground
</Card>

## Overview

`Abi.format` renders ABI items as human-readable strings. It includes parameter names, return types (for functions), and state mutability when relevant.

## Quick Start

```typescript theme={null}
import { Abi } from '@tevm/voltaire/Abi';

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

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

## Formatting Events and Errors

```typescript theme={null}
const event = {
  type: 'event',
  name: 'Transfer',
  inputs: [
    { type: 'address', name: 'from', indexed: true },
    { type: 'address', name: 'to', indexed: true },
    { type: 'uint256', name: 'value' }
  ]
} as const;

const error = {
  type: 'error',
  name: 'InsufficientBalance',
  inputs: [
    { type: 'uint256', name: 'balance' },
    { type: 'uint256', name: 'required' }
  ]
} as const;

Abi.format(event);
// "event Transfer(address indexed from, address indexed to, uint256 value)"

Abi.format(error);
// "error InsufficientBalance(uint256 balance, uint256 required)"
```

## Format All Items in an ABI

```typescript theme={null}
const abi = Abi([fn, event, error] as const);
const formatted = abi.format();
// ["function ...", "event ...", "error ..."]
```

## See Also

* [formatWithArgs](/primitives/abi/format-with-args) - Format with concrete argument values
* [Item.format](/primitives/abi/item-format) - Item namespace formatter
