> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# AbiItem.getSignatureHash

:::info
`AbiItem.getSignatureHash` is a re-export of ox's [`AbiItem.getSignatureHash`](https://oxlib.sh/api/AbiItem/getSignatureHash). Refer to the ox documentation for the full reference.
:::

Computes the signature hash for an [`AbiItem.AbiItem`](/docs/utilities/abiitem/types#abiitem).

Useful for computing Event Topic values.

## Imports

```ts
import { AbiItem } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { AbiItem } from 'viem/utils'

const hash = AbiItem.getSignatureHash(
  'event Transfer(address indexed from, address indexed to, uint256 amount)'
)
// @log: '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
```

```ts twoslash
// @noErrors
import { Abi, AbiItem } from 'viem/utils'

const erc20Abi = Abi.from([...])

const hash = AbiItem.getSignatureHash(erc20Abi, 'Transfer')
// @log: '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
```

```ts twoslash
// @noErrors
import { AbiItem } from 'viem/utils'

const hash = AbiItem.getSignatureHash({
  name: 'Transfer',
  type: 'event',
  inputs: [
    { name: 'from', type: 'address', indexed: true },
    { name: 'to', type: 'address', indexed: true },
    { name: 'amount', type: 'uint256', indexed: false }
  ]
})
// @log: '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
```

## Definition

```ts
function getSignatureHash<abi, name>(
  abi: abi | Abi.Abi | readonly unknown[],
  name: name,
): Hex.Hex
```

## Parameters

### abi

* **Type:** `abi | Abi.Abi | readonly unknown[]`

### name

* **Type:** `name`

## Return Type

The [`Hash.keccak256`](/docs/utilities/hash/keccak256) hash of the ABI item's signature.

`Hex.Hex`
