> **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.

# Signature.assert

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

Asserts that a Signature is valid.

## Imports

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

## Examples

```ts twoslash
// @noErrors
// @errors: 2322
import { Signature } from 'viem/utils'

Signature.assert({
  r: '-0x6e1c1f59ee1cf25b75a8d57b3c89e7e6b3b1da823df8b3b89497f30c1f000000',
  s: '0x4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db8',
  yParity: 1
})
// @error: InvalidSignatureRError:
// @error: Value `-0x...` is an invalid r value.
// @error: r must be a positive integer less than 2^256.
```

## Definition

```ts
function assert(
  signature: ExactPartial<Signature>,
  options?: assert.Options,
): asserts signature is Signature
```

## Parameters

### signature

* **Type:** `ExactPartial<Signature>`

The signature object to assert.

### options

* **Type:** `assert.Options`
* **Optional**

#### options.recovered

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

Whether or not the signature should be recovered (contain `yParity`).
