# Signature.assert

Asserts that a Signature is valid.

## Imports

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

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

## Examples

```ts twoslash
// @errors: 2322
import { Signature } from 'ox'

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
```

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

## 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`).
