# AbiEvent.extractLogs

Extracts and decodes Logs that match an ABI Event in an ABI.

## Imports

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

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

## Examples

```ts twoslash
import { Abi, AbiEvent } from 'ox'

const abi = Abi.from([
  'event Transfer(address indexed from, address indexed to, uint256 value)'
])

const logs = AbiEvent.extractLogs(abi, [
  {
    data: '0x0000000000000000000000000000000000000000000000000000000000000001',
    topics: [
      '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
      '0x000000000000000000000000a5cc3c03994db5b0d9a5eedd10cabab0813678ac',
      '0x000000000000000000000000a5cc3c03994db5b0d9a5eedd10cabab0813678ac'
    ]
  }
])
// @log: [{
// @log:   eventName: 'Transfer',
// @log:   args: {
// @log:     from: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
// @log:     to: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
// @log:     value: 1n,
// @log:   },
// @log:   topics: [...],
// @log:   data: '0x...',
// @log: }]
```

## Definition

```ts
function extractLogs<abi, logs, eventName, strict>(
  abi: abi | Abi.Abi | readonly unknown[],
  logs: logs | readonly extractLogs.Log[],
  options?: extractLogs.Options<abi, eventName, strict>,
): extractLogs.ReturnType<extractLogs.ExtractEvent<abi, eventName>, logs[number], strict>[]
```

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

## Parameters

### abi

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

The ABI to extract events from.

### logs

* **Type:** `logs | readonly extractLogs.Log[]`

Logs to extract.

### options

* **Type:** `extractLogs.Options<abi, eventName, strict>`
* **Optional**

Extraction options.

#### options.args

* **Type:** `abiEvent["inputs"] extends readonly [] ? never : ParametersToPrimitiveTypes`
* **Optional**

Arguments to match against decoded event arguments.

#### options.checksumAddress

* **Type:** `boolean`
* **Optional**

Whether decoded addresses should be checksummed.

#### options.eventName

* **Type:** `eventName | Name[]`
* **Optional**

Event name, or event names, to extract.

#### options.strict

* **Type:** `boolean | strict`
* **Optional**

Whether to strictly decode log topics and data.

## Return Type

The extracted logs.

`extractLogs.ReturnType<extractLogs.ExtractEvent<abi, eventName>, logs[number], strict>[]`
