# AbiEvent.assertArgs

Asserts that the provided arguments match the decoded log arguments.

## Imports

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

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

## Examples

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

const abiEvent = AbiEvent.from(
  'event Transfer(address indexed from, address indexed to, uint256 value)'
)

const args = AbiEvent.decode(abiEvent, {
  data: '0x0000000000000000000000000000000000000000000000000000000000000001',
  topics: [
    '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
    '0x000000000000000000000000a5cc3c03994db5b0d9a5eedd10cabab0813678ac',
    '0x000000000000000000000000a5cc3c03994db5b0d9a5eedd10cabab0813678ac'
  ]
})

AbiEvent.assertArgs(abiEvent, args, {
  from: '0xa5cc3c03994db5b0d9a5eedd10cabab0813678ad',
  to: '0xa5cc3c03994db5b0d9a5eedd10cabab0813678ac',
  value: 1n
})

// @error: AbiEvent.ArgsMismatchError: Given arguments to not match the arguments decoded from the log.
// @error: Event: event Transfer(address indexed from, address indexed to, uint256 value)
// @error: Expected Arguments:
// @error:   from:   0xa5cc3c03994db5b0d9a5eedd10cabab0813678ac
// @error:   to:     0xa5cc3c03994db5b0d9a5eedd10cabab0813678ad
// @error:   value:  1
// @error: Given Arguments:
// @error:   from:   0xa5cc3c03994db5b0d9a5eedd10cabab0813678ad
// @error:   to:     0xa5cc3c03994db5b0d9a5eedd10cabab0813678ac
// @error:   value:  1
```

## Definition

```ts
function assertArgs<abiEvent>(
  abiEvent: abiEvent | AbiEvent,
  args: unknown,
  matchArgs: IsNarrowable<abiEvent, AbiEvent> extends true ? abiEvent['inputs'] extends readonly [] ? never : internal.ParametersToPrimitiveTypes<abiEvent['inputs'], {
    EnableUnion: true;
    IndexedOnly: false;
    Required: false;
}> : unknown,
): void
```

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

## Parameters

### abiEvent

* **Type:** `abiEvent | AbiEvent`

ABI Event to check.

### args

* **Type:** `unknown`

Decoded arguments.

### matchArgs

* **Type:** `IsNarrowable<abiEvent, AbiEvent> extends true ? abiEvent['inputs'] extends readonly [] ? never : internal.ParametersToPrimitiveTypes<abiEvent['inputs'], {
    EnableUnion: true;
    IndexedOnly: false;
    Required: false;
  }> : unknown`

The arguments to check.

## Return Type

`void`
