# AbiError.getSelector

Computes the [4-byte selector](https://solidity-by-example.org/function-selector/) for an [`AbiError.AbiError`](/api/AbiError/types#abierror).

## Imports

:::code-group
```ts [Named]
import { AbiError } from 'ox'
```

```ts [Entrypoint]
import * as AbiError from 'ox/AbiError'
```
:::

## Examples

```ts twoslash
import { AbiError } from 'ox'

const selector = AbiError.getSelector(
  'error BadSignatureV(uint8 v)'
)
// @log: '0x6352211e'
```

```ts twoslash
import { AbiError } from 'ox'

const selector = AbiError.getSelector({
  inputs: [{ name: 'v', type: 'uint8' }],
  name: 'BadSignatureV',
  type: 'error'
})
// @log: '0x6352211e'
```

## Definition

```ts
function getSelector(
  abiItem: string | AbiError,
): Hex.Hex
```

**Source:** [src/core/AbiError.ts](https://github.com/wevm/ox/blob/main/src/core/AbiError.ts#L837)

## Parameters

### abiItem

* **Type:** `string | AbiError`

The ABI item to compute the selector for.

#### abiItem.hash

* **Type:** `0x${string}`
* **Optional**

#### abiItem.overloads

* **Type:** `readonly any[]`
* **Optional**

## Return Type

The first 4 bytes of the [`Hash.keccak256`](/api/Hash/keccak256) hash of the error signature.

`Hex.Hex`
