> ## Documentation Index
> Fetch the complete documentation index at: https://voltaire.tevm.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# crypto/EIP712

> Auto-generated API documentation

[**@tevm/voltaire**](../index.mdx)

***

[@tevm/voltaire](../index.mdx) / crypto/EIP712

# crypto/EIP712

## Classes

### Eip712EncodingError

Defined in: [src/crypto/EIP712/errors.js:45](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/errors.js#L45)

EIP-712 encoding error

#### Example

```javascript theme={null}
throw new Eip712EncodingError('Failed to encode value', {
  code: 'EIP712_ENCODING_ERROR',
  context: { type: 'address', value: '0x...' },
  docsPath: '/crypto/eip712/encode-value#error-handling',
  cause: originalError
})
```

#### Extends

* [`Eip712Error`](#eip712error)

#### Constructors

##### Constructor

> **new Eip712EncodingError**(`message`, `options?`): [`Eip712EncodingError`](#eip712encodingerror)

Defined in: [src/crypto/EIP712/errors.js:50](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/errors.js#L50)

###### Parameters

###### message

`string`

###### options?

###### cause?

`Error`

###### code?

`string`

###### context?

`Record`\<`string`, `unknown`>

###### docsPath?

`string`

###### Returns

[`Eip712EncodingError`](#eip712encodingerror)

###### Overrides

[`Eip712Error`](#eip712error).[`constructor`](#constructor-1)

#### Properties

##### cause?

> `optional` **cause**: `Error`

Defined in: [src/primitives/errors/AbstractError.ts:56](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L56)

Root cause of this error (for error chaining)

###### Inherited from

[`Eip712Error`](#eip712error).[`cause`](#cause-1)

##### code

> **code**: `string`

Defined in: [src/primitives/errors/AbstractError.ts:39](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L39)

Machine-readable error code for programmatic handling

###### Example

```ts theme={null}
'INVALID_FORMAT', 'INVALID_LENGTH'
```

###### Inherited from

[`Eip712Error`](#eip712error).[`code`](#code-1)

##### context?

> `optional` **context**: `Record`\<`string`, `unknown`>

Defined in: [src/primitives/errors/AbstractError.ts:45](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L45)

Additional context metadata for debugging

###### Example

```ts theme={null}
{ value: '0x123', expected: '20 bytes' }
```

###### Inherited from

[`Eip712Error`](#eip712error).[`context`](#context-1)

##### docsPath?

> `optional` **docsPath**: `string`

Defined in: [src/primitives/errors/AbstractError.ts:51](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L51)

Path to documentation for this error

###### Example

```ts theme={null}
'/primitives/address/from-hex#error-handling'
```

###### Inherited from

[`Eip712Error`](#eip712error).[`docsPath`](#docspath-1)

##### name

> **name**: `string`

Defined in: [src/crypto/EIP712/errors.js:57](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/errors.js#L57)

###### Inherited from

[`Eip712Error`](#eip712error).[`name`](#name-1)

#### Methods

##### getErrorChain()

> **getErrorChain**(): `string`

Defined in: [src/primitives/errors/AbstractError.ts:94](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L94)

Get full error chain as string for logging

###### Returns

`string`

###### Inherited from

[`Eip712Error`](#eip712error).[`getErrorChain`](#geterrorchain-2)

##### toJSON()

> **toJSON**(): `Record`\<`string`, `unknown`>

Defined in: [src/primitives/errors/AbstractError.ts:110](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L110)

Serialize error to JSON for logging/telemetry

###### Returns

`Record`\<`string`, `unknown`>

###### Inherited from

[`Eip712Error`](#eip712error).[`toJSON`](#tojson-2)

***

### Eip712Error

Defined in: [src/crypto/EIP712/errors.js:16](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/errors.js#L16)

Base EIP-712 error

#### Example

```javascript theme={null}
throw new Eip712Error('EIP-712 operation failed', {
  code: 'EIP712_ERROR',
  context: { operation: 'sign' },
  docsPath: '/crypto/eip712#error-handling',
  cause: originalError
})
```

#### Extends

* [`CryptoError`](../index/index.mdx#cryptoerror)

#### Extended by

* [`Eip712EncodingError`](#eip712encodingerror)
* [`Eip712TypeNotFoundError`](#eip712typenotfounderror)
* [`Eip712InvalidMessageError`](#eip712invalidmessageerror)

#### Constructors

##### Constructor

> **new Eip712Error**(`message`, `options?`): [`Eip712Error`](#eip712error)

Defined in: [src/crypto/EIP712/errors.js:21](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/errors.js#L21)

###### Parameters

###### message

`string`

###### options?

###### cause?

`Error`

###### code?

`string`

###### context?

`Record`\<`string`, `unknown`>

###### docsPath?

`string`

###### Returns

[`Eip712Error`](#eip712error)

###### Overrides

[`CryptoError`](../index/index.mdx#cryptoerror).[`constructor`](../index/index.mdx#constructor-1)

#### Properties

##### cause?

> `optional` **cause**: `Error`

Defined in: [src/primitives/errors/AbstractError.ts:56](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L56)

Root cause of this error (for error chaining)

###### Inherited from

[`CryptoError`](../index/index.mdx#cryptoerror).[`cause`](../index/index.mdx#cause-1)

##### code

> **code**: `string`

Defined in: [src/primitives/errors/AbstractError.ts:39](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L39)

Machine-readable error code for programmatic handling

###### Example

```ts theme={null}
'INVALID_FORMAT', 'INVALID_LENGTH'
```

###### Inherited from

[`CryptoError`](../index/index.mdx#cryptoerror).[`code`](../index/index.mdx#code-1)

##### context?

> `optional` **context**: `Record`\<`string`, `unknown`>

Defined in: [src/primitives/errors/AbstractError.ts:45](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L45)

Additional context metadata for debugging

###### Example

```ts theme={null}
{ value: '0x123', expected: '20 bytes' }
```

###### Inherited from

[`CryptoError`](../index/index.mdx#cryptoerror).[`context`](../index/index.mdx#context-1)

##### docsPath?

> `optional` **docsPath**: `string`

Defined in: [src/primitives/errors/AbstractError.ts:51](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L51)

Path to documentation for this error

###### Example

```ts theme={null}
'/primitives/address/from-hex#error-handling'
```

###### Inherited from

[`CryptoError`](../index/index.mdx#cryptoerror).[`docsPath`](../index/index.mdx#docspath-1)

##### name

> **name**: `string`

Defined in: [src/crypto/EIP712/errors.js:28](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/errors.js#L28)

###### Inherited from

`CryptoError.name`

#### Methods

##### getErrorChain()

> **getErrorChain**(): `string`

Defined in: [src/primitives/errors/AbstractError.ts:94](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L94)

Get full error chain as string for logging

###### Returns

`string`

###### Inherited from

[`CryptoError`](../index/index.mdx#cryptoerror).[`getErrorChain`](../index/index.mdx#geterrorchain-2)

##### toJSON()

> **toJSON**(): `Record`\<`string`, `unknown`>

Defined in: [src/primitives/errors/AbstractError.ts:110](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L110)

Serialize error to JSON for logging/telemetry

###### Returns

`Record`\<`string`, `unknown`>

###### Inherited from

[`CryptoError`](../index/index.mdx#cryptoerror).[`toJSON`](../index/index.mdx#tojson-2)

***

### Eip712InvalidMessageError

Defined in: [src/crypto/EIP712/errors.js:103](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/errors.js#L103)

EIP-712 invalid message error

#### Example

```javascript theme={null}
throw new Eip712InvalidMessageError('Missing required field', {
  code: 'EIP712_INVALID_MESSAGE',
  context: { field: 'name' },
  docsPath: '/crypto/eip712/encode-data#error-handling',
  cause: originalError
})
```

#### Extends

* [`Eip712Error`](#eip712error)

#### Constructors

##### Constructor

> **new Eip712InvalidMessageError**(`message`, `options?`): [`Eip712InvalidMessageError`](#eip712invalidmessageerror)

Defined in: [src/crypto/EIP712/errors.js:108](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/errors.js#L108)

###### Parameters

###### message

`string`

###### options?

###### cause?

`Error`

###### code?

`string`

###### context?

`Record`\<`string`, `unknown`>

###### docsPath?

`string`

###### Returns

[`Eip712InvalidMessageError`](#eip712invalidmessageerror)

###### Overrides

[`Eip712Error`](#eip712error).[`constructor`](#constructor-1)

#### Properties

##### cause?

> `optional` **cause**: `Error`

Defined in: [src/primitives/errors/AbstractError.ts:56](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L56)

Root cause of this error (for error chaining)

###### Inherited from

[`Eip712Error`](#eip712error).[`cause`](#cause-1)

##### code

> **code**: `string`

Defined in: [src/primitives/errors/AbstractError.ts:39](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L39)

Machine-readable error code for programmatic handling

###### Example

```ts theme={null}
'INVALID_FORMAT', 'INVALID_LENGTH'
```

###### Inherited from

[`Eip712Error`](#eip712error).[`code`](#code-1)

##### context?

> `optional` **context**: `Record`\<`string`, `unknown`>

Defined in: [src/primitives/errors/AbstractError.ts:45](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L45)

Additional context metadata for debugging

###### Example

```ts theme={null}
{ value: '0x123', expected: '20 bytes' }
```

###### Inherited from

[`Eip712Error`](#eip712error).[`context`](#context-1)

##### docsPath?

> `optional` **docsPath**: `string`

Defined in: [src/primitives/errors/AbstractError.ts:51](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L51)

Path to documentation for this error

###### Example

```ts theme={null}
'/primitives/address/from-hex#error-handling'
```

###### Inherited from

[`Eip712Error`](#eip712error).[`docsPath`](#docspath-1)

##### name

> **name**: `string`

Defined in: [src/crypto/EIP712/errors.js:115](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/errors.js#L115)

###### Inherited from

[`Eip712Error`](#eip712error).[`name`](#name-1)

#### Methods

##### getErrorChain()

> **getErrorChain**(): `string`

Defined in: [src/primitives/errors/AbstractError.ts:94](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L94)

Get full error chain as string for logging

###### Returns

`string`

###### Inherited from

[`Eip712Error`](#eip712error).[`getErrorChain`](#geterrorchain-2)

##### toJSON()

> **toJSON**(): `Record`\<`string`, `unknown`>

Defined in: [src/primitives/errors/AbstractError.ts:110](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L110)

Serialize error to JSON for logging/telemetry

###### Returns

`Record`\<`string`, `unknown`>

###### Inherited from

[`Eip712Error`](#eip712error).[`toJSON`](#tojson-2)

***

### Eip712TypeNotFoundError

Defined in: [src/crypto/EIP712/errors.js:74](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/errors.js#L74)

EIP-712 type not found error

#### Example

```javascript theme={null}
throw new Eip712TypeNotFoundError('Type Person not found', {
  code: 'EIP712_TYPE_NOT_FOUND',
  context: { type: 'Person' },
  docsPath: '/crypto/eip712/encode-type#error-handling',
  cause: originalError
})
```

#### Extends

* [`Eip712Error`](#eip712error)

#### Constructors

##### Constructor

> **new Eip712TypeNotFoundError**(`message`, `options?`): [`Eip712TypeNotFoundError`](#eip712typenotfounderror)

Defined in: [src/crypto/EIP712/errors.js:79](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/errors.js#L79)

###### Parameters

###### message

`string`

###### options?

###### cause?

`Error`

###### code?

`string`

###### context?

`Record`\<`string`, `unknown`>

###### docsPath?

`string`

###### Returns

[`Eip712TypeNotFoundError`](#eip712typenotfounderror)

###### Overrides

[`Eip712Error`](#eip712error).[`constructor`](#constructor-1)

#### Properties

##### cause?

> `optional` **cause**: `Error`

Defined in: [src/primitives/errors/AbstractError.ts:56](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L56)

Root cause of this error (for error chaining)

###### Inherited from

[`Eip712Error`](#eip712error).[`cause`](#cause-1)

##### code

> **code**: `string`

Defined in: [src/primitives/errors/AbstractError.ts:39](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L39)

Machine-readable error code for programmatic handling

###### Example

```ts theme={null}
'INVALID_FORMAT', 'INVALID_LENGTH'
```

###### Inherited from

[`Eip712Error`](#eip712error).[`code`](#code-1)

##### context?

> `optional` **context**: `Record`\<`string`, `unknown`>

Defined in: [src/primitives/errors/AbstractError.ts:45](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L45)

Additional context metadata for debugging

###### Example

```ts theme={null}
{ value: '0x123', expected: '20 bytes' }
```

###### Inherited from

[`Eip712Error`](#eip712error).[`context`](#context-1)

##### docsPath?

> `optional` **docsPath**: `string`

Defined in: [src/primitives/errors/AbstractError.ts:51](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L51)

Path to documentation for this error

###### Example

```ts theme={null}
'/primitives/address/from-hex#error-handling'
```

###### Inherited from

[`Eip712Error`](#eip712error).[`docsPath`](#docspath-1)

##### name

> **name**: `string`

Defined in: [src/crypto/EIP712/errors.js:86](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/errors.js#L86)

###### Inherited from

[`Eip712Error`](#eip712error).[`name`](#name-1)

#### Methods

##### getErrorChain()

> **getErrorChain**(): `string`

Defined in: [src/primitives/errors/AbstractError.ts:94](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L94)

Get full error chain as string for logging

###### Returns

`string`

###### Inherited from

[`Eip712Error`](#eip712error).[`getErrorChain`](#geterrorchain-2)

##### toJSON()

> **toJSON**(): `Record`\<`string`, `unknown`>

Defined in: [src/primitives/errors/AbstractError.ts:110](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/errors/AbstractError.ts#L110)

Serialize error to JSON for logging/telemetry

###### Returns

`Record`\<`string`, `unknown`>

###### Inherited from

[`Eip712Error`](#eip712error).[`toJSON`](#tojson-2)

## Type Aliases

### BrandedEIP712

> **BrandedEIP712** = [`TypedData`](#typeddata) & `object`

Defined in: [src/crypto/EIP712/EIP712Type.ts:73](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L73)

Branded EIP-712 TypedData type

#### Type Declaration

##### \[brand]

> `readonly` **\[brand]**: `"EIP712"`

***

### Domain

> **Domain** = `object`

Defined in: [src/crypto/EIP712/EIP712Type.ts:8](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L8)

EIP-712 Domain separator fields

#### Properties

##### chainId?

> `optional` **chainId**: `bigint`

Defined in: [src/crypto/EIP712/EIP712Type.ts:11](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L11)

##### name?

> `optional` **name**: `string`

Defined in: [src/crypto/EIP712/EIP712Type.ts:9](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L9)

##### salt?

> `optional` **salt**: [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Defined in: [src/crypto/EIP712/EIP712Type.ts:13](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L13)

##### verifyingContract?

> `optional` **verifyingContract**: [`AddressType`](../primitives/Address.mdx#addresstype)

Defined in: [src/crypto/EIP712/EIP712Type.ts:12](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L12)

##### version?

> `optional` **version**: `string`

Defined in: [src/crypto/EIP712/EIP712Type.ts:10](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L10)

***

### Message

> **Message** = `object`

Defined in: [src/crypto/EIP712/EIP712Type.ts:47](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L47)

Message data (object with arbitrary structure matching types)

#### Index Signature

\[`key`: `string`]: [`MessageValue`](#messagevalue)

***

### MessageValue

> **MessageValue** = `string` | `bigint` | `number` | `boolean` | [`AddressType`](../primitives/Address.mdx#addresstype) | `Uint8Array` | [`MessageValue`](#messagevalue)\[] | \{\[`key`: `string`]: [`MessageValue`](#messagevalue); }

Defined in: [src/crypto/EIP712/EIP712Type.ts:34](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L34)

Message value (can be primitive or nested object)

***

### Signature

> **Signature** = `object`

Defined in: [src/crypto/EIP712/EIP712Type.ts:64](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L64)

ECDSA Signature

#### Properties

##### r

> **r**: `Uint8Array`

Defined in: [src/crypto/EIP712/EIP712Type.ts:65](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L65)

##### s

> **s**: `Uint8Array`

Defined in: [src/crypto/EIP712/EIP712Type.ts:66](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L66)

##### v

> **v**: `number`

Defined in: [src/crypto/EIP712/EIP712Type.ts:67](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L67)

***

### TypedData

> **TypedData** = `object`

Defined in: [src/crypto/EIP712/EIP712Type.ts:54](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L54)

Complete EIP-712 typed data structure

#### Properties

##### domain

> **domain**: [`Domain`](#domain)

Defined in: [src/crypto/EIP712/EIP712Type.ts:55](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L55)

##### message

> **message**: [`Message`](#message)

Defined in: [src/crypto/EIP712/EIP712Type.ts:58](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L58)

##### primaryType

> **primaryType**: `string`

Defined in: [src/crypto/EIP712/EIP712Type.ts:57](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L57)

##### types

> **types**: [`TypeDefinitions`](#typedefinitions)

Defined in: [src/crypto/EIP712/EIP712Type.ts:56](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L56)

***

### TypeDefinitions

> **TypeDefinitions** = `object`

Defined in: [src/crypto/EIP712/EIP712Type.ts:27](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L27)

Type definitions mapping type names to their properties

#### Index Signature

\[`typeName`: `string`]: readonly [`TypeProperty`](#typeproperty)\[]

***

### TypeProperty

> **TypeProperty** = `object`

Defined in: [src/crypto/EIP712/EIP712Type.ts:19](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L19)

Type property definition

#### Properties

##### name

> **name**: `string`

Defined in: [src/crypto/EIP712/EIP712Type.ts:20](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L20)

##### type

> **type**: `string`

Defined in: [src/crypto/EIP712/EIP712Type.ts:21](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712Type.ts#L21)

## Variables

### \_signTypedData()

> `const` **\_signTypedData**: (`typedData`, `privateKey`) => [`Signature`](#signature)

Defined in: [src/crypto/EIP712/EIP712.js:76](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712.js#L76)

#### Parameters

##### typedData

[`TypedData`](#typeddata)

##### privateKey

`Uint8Array`

#### Returns

[`Signature`](#signature)

***

### EIP712

> `const` **EIP712**: `object`

Defined in: [src/crypto/EIP712/EIP712.js:157](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712.js#L157)

EIP-712 Typed Data Signing

Complete implementation of EIP-712 typed structured data hashing and signing.

#### Type Declaration

##### Domain

> **Domain**: `object`

###### Domain.hash()

> **hash**: (`domain`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype) = `hashDomain`

###### Parameters

###### domain

[`Domain`](#domain)

###### Returns

[`HashType`](../index/namespaces/HashType.mdx#hashtype)

##### encodeData()

> **encodeData**: (`primaryType`, `data`, `types`) => `Uint8Array`

###### Parameters

###### primaryType

`string`

###### data

[`Message`](#message)

###### types

[`TypeDefinitions`](#typedefinitions)

###### Returns

`Uint8Array`

##### EncodeData()

> **EncodeData**: (`deps`) => (`primaryType`, `data`, `types`) => `Uint8Array`

Factory: Encode struct data according to EIP-712.

###### Parameters

###### deps

Crypto dependencies

###### encodeValue

(`type`, `value`, `types`) => `Uint8Array`

Encode value function

###### hashType

(`primaryType`, `types`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Hash type function

###### Returns

Function that encodes data

> (`primaryType`, `data`, `types`): `Uint8Array`

###### Parameters

###### primaryType

`string`

###### data

[`Message`](#message)

###### types

[`TypeDefinitions`](#typedefinitions)

###### Returns

`Uint8Array`

###### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

###### Since

0.0.0

###### Throws

If primaryType is not found in types

###### Throws

If required field is missing from data

###### Example

```javascript theme={null}
import { EncodeData } from './crypto/EIP712/encodeData.js';
import { HashType } from './hashType.js';
import { EncodeValue } from './encodeValue.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
const hashType = HashType({ keccak256 });
const encodeValue = EncodeValue({ keccak256, hashStruct });
const encodeData = EncodeData({ hashType, encodeValue });
const types = { Person: [{ name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }] };
const encoded = encodeData('Person', { name: 'Alice', wallet: '0x...' }, types);
```

##### encodeType()

> **encodeType**: (`primaryType`, `types`) => `string`

Encode type string for EIP-712 hashing.

Produces type encoding like "Mail(Person from,Person to,string contents)Person(string name,address wallet)"

###### Parameters

###### primaryType

`string`

Primary type name to encode

###### types

[`TypeDefinitions`](#typedefinitions)

Type definitions mapping

###### Returns

`string`

Encoded type string with primary type followed by referenced types in alphabetical order

###### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

###### Since

0.0.0

###### Throws

If primaryType or any referenced type is not found

###### Example

```javascript theme={null}
import * as EIP712 from './crypto/EIP712/index.js';
const types = { Mail: [{ name: 'from', type: 'Person' }], Person: [{ name: 'name', type: 'string' }] };
const typeString = EIP712.encodeType('Mail', types);
// Returns: "Mail(Person from)Person(string name)"
```

##### encodeValue()

> **encodeValue**: (`type`, `value`, `types`) => `Uint8Array`

###### Parameters

###### type

`string`

###### value

[`MessageValue`](#messagevalue)

###### types

[`TypeDefinitions`](#typedefinitions)

###### Returns

`Uint8Array`

##### EncodeValue()

> **EncodeValue**: (`deps`) => (`type`, `value`, `types`) => `Uint8Array`

Factory: Encode single value to 32 bytes according to EIP-712.

Handles primitive types, arrays, strings, bytes, and custom structs.
Addresses must be pre-validated BrandedAddress types.

###### Parameters

###### deps

Crypto dependencies

###### hashStruct

(`type`, `data`, `types`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Hash struct function

###### keccak256

(`data`) => `Uint8Array`

Keccak256 hash function

###### Returns

Function that encodes value

> (`type`, `value`, `types`): `Uint8Array`

###### Parameters

###### type

`string`

###### value

[`MessageValue`](#messagevalue)

###### types

[`TypeDefinitions`](#typedefinitions)

###### Returns

`Uint8Array`

###### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

###### Since

0.0.0

###### Throws

If type is unsupported or value format is invalid

###### Example

```javascript theme={null}
import { EncodeValue } from './crypto/EIP712/encodeValue.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
import { HashStruct } from './hashStruct.js';
const hashStruct = HashStruct({ keccak256, encodeData });
const encodeValue = EncodeValue({ keccak256, hashStruct });
const encoded = encodeValue('uint256', 42n, types);
```

##### format()

> **format**: (`typedData`) => `string`

Format typed data for human-readable display.

###### Parameters

###### typedData

[`TypedData`](#typeddata)

Typed data to format

###### Returns

`string`

Human-readable multi-line string representation

###### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as EIP712 from './crypto/EIP712/index.js';
const formatted = EIP712.format(typedData);
console.log(formatted);
```

##### HashDomain()

> **HashDomain**: (`deps`) => (`domain`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Factory: Hash EIP-712 domain separator.

Only includes fields that are defined in the domain object.

###### Parameters

###### deps

Crypto dependencies

###### hashStruct

(`primaryType`, `data`, `types`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Hash struct function

###### Returns

Function that hashes domain

> (`domain`): [`HashType`](../index/namespaces/HashType.mdx#hashtype)

###### Parameters

###### domain

[`Domain`](#domain)

###### Returns

[`HashType`](../index/namespaces/HashType.mdx#hashtype)

###### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

###### Since

0.0.0

###### Throws

If domain type encoding fails

###### Example

```javascript theme={null}
import { Hash as HashDomain } from './crypto/EIP712/Domain/hash.js';
import { HashStruct } from '../hashStruct.js';
import { hash as keccak256 } from '../../Keccak256/hash.js';
const hashStruct = HashStruct({ keccak256, encodeData });
const hashDomain = HashDomain({ hashStruct });
const domain = { name: 'MyApp', version: '1', chainId: 1n };
const domainHash = hashDomain(domain);
```

##### hashStruct()

> **hashStruct**: (`primaryType`, `data`, `types`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

###### Parameters

###### primaryType

`string`

###### data

[`Message`](#message)

###### types

[`TypeDefinitions`](#typedefinitions)

###### Returns

[`HashType`](../index/namespaces/HashType.mdx#hashtype)

##### HashStruct()

> **HashStruct**: (`deps`) => (`primaryType`, `data`, `types`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Factory: Hash struct according to EIP-712 specification.

Computes keccak256 of the encoded struct data.

###### Parameters

###### deps

Crypto dependencies

###### encodeData

(`primaryType`, `data`, `types`) => `Uint8Array`

Encode data function

###### keccak256

(`data`) => `Uint8Array`

Keccak256 hash function

###### Returns

Function that hashes struct

> (`primaryType`, `data`, `types`): [`HashType`](../index/namespaces/HashType.mdx#hashtype)

###### Parameters

###### primaryType

`string`

###### data

[`Message`](#message)

###### types

[`TypeDefinitions`](#typedefinitions)

###### Returns

[`HashType`](../index/namespaces/HashType.mdx#hashtype)

###### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

###### Since

0.0.0

###### Throws

If type is not found

###### Throws

If message data is invalid

###### Example

```javascript theme={null}
import { HashStruct } from './crypto/EIP712/hashStruct.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
import { EncodeData } from './encodeData.js';
const encodeData = EncodeData({ hashType, encodeValue });
const hashStruct = HashStruct({ keccak256, encodeData });
const types = { Person: [{ name: 'name', type: 'string' }] };
const hash = hashStruct('Person', { name: 'Alice' }, types);
```

##### hashType()

> **hashType**: (`primaryType`, `types`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

###### Parameters

###### primaryType

`string`

###### types

[`TypeDefinitions`](#typedefinitions)

###### Returns

[`HashType`](../index/namespaces/HashType.mdx#hashtype)

##### HashType()

> **HashType**: (`deps`) => (`primaryType`, `types`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Factory: Hash type string according to EIP-712.

Computes keccak256 of the encoded type string.

###### Parameters

###### deps

Crypto dependencies

###### keccak256

(`data`) => `Uint8Array`

Keccak256 hash function

###### Returns

Function that hashes type string

> (`primaryType`, `types`): [`HashType`](../index/namespaces/HashType.mdx#hashtype)

###### Parameters

###### primaryType

`string`

###### types

[`TypeDefinitions`](#typedefinitions)

###### Returns

[`HashType`](../index/namespaces/HashType.mdx#hashtype)

###### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

###### Since

0.0.0

###### Throws

If type is not found

###### Example

```javascript theme={null}
import { HashType } from './crypto/EIP712/hashType.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
const hashType = HashType({ keccak256 });
const types = { Mail: [{ name: 'contents', type: 'string' }] };
const typeHash = hashType('Mail', types);
```

##### hashTypedData()

> **hashTypedData**: (`typedData`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

###### Parameters

###### typedData

[`TypedData`](#typeddata)

###### Returns

[`HashType`](../index/namespaces/HashType.mdx#hashtype)

##### HashTypedData()

> **HashTypedData**: (`deps`) => (`typedData`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Factory: Hash typed data according to EIP-712 specification.

Computes: keccak256("\x19\x01" ‖ domainSeparator ‖ hashStruct(message))

###### Parameters

###### deps

Crypto dependencies

###### hashDomain

(`domain`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Hash domain function

###### hashStruct

(`primaryType`, `data`, `types`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Hash struct function

###### keccak256

(`data`) => `Uint8Array`

Keccak256 hash function

###### Returns

Function that hashes typed data

> (`typedData`): [`HashType`](../index/namespaces/HashType.mdx#hashtype)

###### Parameters

###### typedData

[`TypedData`](#typeddata)

###### Returns

[`HashType`](../index/namespaces/HashType.mdx#hashtype)

###### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

###### Since

0.0.0

###### Throws

If types are not found

###### Throws

If message data is invalid

###### Example

```javascript theme={null}
import { HashTypedData } from './crypto/EIP712/hashTypedData.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
import { Hash as HashDomain } from './Domain/hash.js';
import { HashStruct } from './hashStruct.js';
const hashDomain = HashDomain({ hashStruct });
const hashStruct = HashStruct({ keccak256, encodeData });
const hashTypedData = HashTypedData({ keccak256, hashDomain, hashStruct });
const hash = hashTypedData(typedData);
```

##### recoverAddress()

> **recoverAddress**: (`signature`, `typedData`) => [`AddressType`](../primitives/Address.mdx#addresstype)

###### Parameters

###### signature

[`Signature`](#signature)

###### typedData

[`TypedData`](#typeddata)

###### Returns

[`AddressType`](../primitives/Address.mdx#addresstype)

##### RecoverAddress()

> **RecoverAddress**: (`deps`) => (`signature`, `typedData`) => [`AddressType`](../primitives/Address.mdx#addresstype)

Factory: Recover Ethereum address from EIP-712 typed data signature.

Uses ECDSA public key recovery to determine the signer's address.

###### Parameters

###### deps

Crypto dependencies

###### hashTypedData

(`typedData`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Hash typed data function

###### keccak256

(`data`) => `Uint8Array`

Keccak256 hash function

###### recoverPublicKey

(`signature`, `hash`, `recoveryBit`) => `Uint8Array`

Secp256k1 public key recovery function

###### Returns

Function that recovers address

> (`signature`, `typedData`): [`AddressType`](../primitives/Address.mdx#addresstype)

###### Parameters

###### signature

[`Signature`](#signature)

###### typedData

[`TypedData`](#typeddata)

###### Returns

[`AddressType`](../primitives/Address.mdx#addresstype)

###### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

###### Since

0.0.0

###### Throws

If signature recovery fails or public key format is invalid

###### Example

```javascript theme={null}
import { RecoverAddress } from './crypto/EIP712/recoverAddress.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
import { recoverPublicKey } from '../Secp256k1/recoverPublicKey.js';
import { HashTypedData } from './hashTypedData.js';
const hashTypedData = HashTypedData({ keccak256, hashDomain, hashStruct });
const recoverAddress = RecoverAddress({ keccak256, recoverPublicKey, hashTypedData });
const address = recoverAddress(signature, typedData);
```

##### signTypedData()

> **signTypedData**: (`typedData`, `privateKey`) => [`Signature`](#signature)

###### Parameters

###### typedData

`any`

###### privateKey

`any`

###### Returns

[`Signature`](#signature)

##### SignTypedData()

> **SignTypedData**: (`deps`) => (`typedData`, `privateKey`) => [`Signature`](#signature)

Factory: Sign EIP-712 typed data with ECDSA private key.

Produces a signature that can be verified against the signer's address.

###### Parameters

###### deps

Crypto dependencies

###### hashTypedData

(`typedData`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Hash typed data function

###### sign

(`hash`, `privateKey`) => [`Signature`](#signature)

Secp256k1 sign function

###### Returns

Function that signs typed data

> (`typedData`, `privateKey`): [`Signature`](#signature)

###### Parameters

###### typedData

[`TypedData`](#typeddata)

###### privateKey

`Uint8Array`

###### Returns

[`Signature`](#signature)

###### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

###### Since

0.0.0

###### Throws

If private key length is invalid or signing fails

###### Example

```javascript theme={null}
import { SignTypedData } from './crypto/EIP712/signTypedData.js';
import { HashTypedData } from './hashTypedData.js';
import { sign } from '../Secp256k1/sign.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
const hashTypedData = HashTypedData({ keccak256, hashDomain, hashStruct });
const signTypedData = SignTypedData({ hashTypedData, sign });
const privateKey = new Uint8Array(32);
const signature = signTypedData(typedData, privateKey);
```

##### validate()

> **validate**: (`typedData`) => `void`

Validate typed data structure against EIP-712 specification.

Checks domain, types, primaryType, and message structure.

###### Parameters

###### typedData

[`TypedData`](#typeddata)

Typed data to validate

###### Returns

`void`

###### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

###### Since

0.0.0

###### Throws

If structure is invalid or missing required fields

###### Example

```javascript theme={null}
import * as EIP712 from './crypto/EIP712/index.js';
EIP712.validate(typedData); // Throws if invalid
```

##### verifyTypedData()

> **verifyTypedData**: (`signature`, `typedData`, `address`) => `boolean`

###### Parameters

###### signature

[`Signature`](#signature)

###### typedData

[`TypedData`](#typeddata)

###### address

[`AddressType`](../primitives/Address.mdx#addresstype)

###### Returns

`boolean`

##### VerifyTypedData()

> **VerifyTypedData**: (`deps`) => (`signature`, `typedData`, `address`) => `boolean`

Factory: Verify EIP-712 typed data signature against expected signer address.

Uses constant-time comparison to prevent timing attacks.

###### Parameters

###### deps

Crypto dependencies

###### recoverAddress

(`signature`, `typedData`) => [`AddressType`](../primitives/Address.mdx#addresstype)

Recover address function

###### Returns

Function that verifies signature

> (`signature`, `typedData`, `address`): `boolean`

###### Parameters

###### signature

[`Signature`](#signature)

###### typedData

[`TypedData`](#typeddata)

###### address

[`AddressType`](../primitives/Address.mdx#addresstype)

###### Returns

`boolean`

###### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import { VerifyTypedData } from './crypto/EIP712/verifyTypedData.js';
import { RecoverAddress } from './recoverAddress.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
import { recoverPublicKey } from '../Secp256k1/recoverPublicKey.js';
const recoverAddress = RecoverAddress({ keccak256, recoverPublicKey, hashTypedData });
const verifyTypedData = VerifyTypedData({ recoverAddress });
const valid = verifyTypedData(signature, typedData, signerAddress);
```

#### Example

```typescript theme={null}
import { EIP712 } from './EIP712.js';

// Define typed data
const typedData = {
  domain: {
    name: 'MyApp',
    version: '1',
    chainId: 1n,
    verifyingContract: contractAddress,
  },
  types: {
    Person: [
      { name: 'name', type: 'string' },
      { name: 'wallet', type: 'address' },
    ],
    Mail: [
      { name: 'from', type: 'Person' },
      { name: 'to', type: 'Person' },
      { name: 'contents', type: 'string' },
    ],
  },
  primaryType: 'Mail',
  message: {
    from: { name: 'Alice', wallet: '0x...' },
    to: { name: 'Bob', wallet: '0x...' },
    contents: 'Hello!',
  },
};

// Hash typed data
const hash = EIP712.hashTypedData(typedData);

// Sign typed data
const signature = EIP712.signTypedData(typedData, privateKey);

// Verify signature
const valid = EIP712.verifyTypedData(signature, typedData, address);
```

***

### encodeData()

> `const` **encodeData**: (`primaryType`, `data`, `types`) => `Uint8Array`

Defined in: [src/crypto/EIP712/EIP712.js:54](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712.js#L54)

#### Parameters

##### primaryType

`string`

##### data

[`Message`](#message)

##### types

[`TypeDefinitions`](#typedefinitions)

#### Returns

`Uint8Array`

***

### encodeValue()

> `const` **encodeValue**: (`type`, `value`, `types`) => `Uint8Array`

Defined in: [src/crypto/EIP712/EIP712.js:49](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712.js#L49)

#### Parameters

##### type

`string`

##### value

[`MessageValue`](#messagevalue)

##### types

[`TypeDefinitions`](#typedefinitions)

#### Returns

`Uint8Array`

***

### hashDomain()

> `const` **hashDomain**: (`domain`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Defined in: [src/crypto/EIP712/EIP712.js:57](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712.js#L57)

#### Parameters

##### domain

[`Domain`](#domain)

#### Returns

[`HashType`](../index/namespaces/HashType.mdx#hashtype)

***

### hashStruct

> **hashStruct**: `any`

Defined in: [src/crypto/EIP712/EIP712.js:48](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712.js#L48)

***

### hashType()

> `const` **hashType**: (`primaryType`, `types`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Defined in: [src/crypto/EIP712/EIP712.js:43](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712.js#L43)

#### Parameters

##### primaryType

`string`

##### types

[`TypeDefinitions`](#typedefinitions)

#### Returns

[`HashType`](../index/namespaces/HashType.mdx#hashtype)

***

### hashTypedData()

> `const` **hashTypedData**: (`typedData`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Defined in: [src/crypto/EIP712/EIP712.js:58](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712.js#L58)

#### Parameters

##### typedData

[`TypedData`](#typeddata)

#### Returns

[`HashType`](../index/namespaces/HashType.mdx#hashtype)

***

### recoverAddress()

> `const` **recoverAddress**: (`signature`, `typedData`) => [`AddressType`](../primitives/Address.mdx#addresstype)

Defined in: [src/crypto/EIP712/EIP712.js:70](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712.js#L70)

#### Parameters

##### signature

[`Signature`](#signature)

##### typedData

[`TypedData`](#typeddata)

#### Returns

[`AddressType`](../primitives/Address.mdx#addresstype)

***

### verifyTypedData()

> `const` **verifyTypedData**: (`signature`, `typedData`, `address`) => `boolean`

Defined in: [src/crypto/EIP712/EIP712.js:77](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712.js#L77)

#### Parameters

##### signature

[`Signature`](#signature)

##### typedData

[`TypedData`](#typeddata)

##### address

[`AddressType`](../primitives/Address.mdx#addresstype)

#### Returns

`boolean`

## Functions

### EncodeData()

> **EncodeData**(`deps`): (`primaryType`, `data`, `types`) => `Uint8Array`

Defined in: [src/crypto/EIP712/encodeData.js:30](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/encodeData.js#L30)

Factory: Encode struct data according to EIP-712.

#### Parameters

##### deps

Crypto dependencies

###### encodeValue

(`type`, `value`, `types`) => `Uint8Array`

Encode value function

###### hashType

(`primaryType`, `types`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Hash type function

#### Returns

Function that encodes data

> (`primaryType`, `data`, `types`): `Uint8Array`

##### Parameters

###### primaryType

`string`

###### data

[`Message`](#message)

###### types

[`TypeDefinitions`](#typedefinitions)

##### Returns

`Uint8Array`

#### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

#### Since

0.0.0

#### Throws

If primaryType is not found in types

#### Throws

If required field is missing from data

#### Example

```javascript theme={null}
import { EncodeData } from './crypto/EIP712/encodeData.js';
import { HashType } from './hashType.js';
import { EncodeValue } from './encodeValue.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
const hashType = HashType({ keccak256 });
const encodeValue = EncodeValue({ keccak256, hashStruct });
const encodeData = EncodeData({ hashType, encodeValue });
const types = { Person: [{ name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }] };
const encoded = encodeData('Person', { name: 'Alice', wallet: '0x...' }, types);
```

***

### encodeType()

> **encodeType**(`primaryType`, `types`): `string`

Defined in: [src/crypto/EIP712/encodeType.js:22](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/encodeType.js#L22)

Encode type string for EIP-712 hashing.

Produces type encoding like "Mail(Person from,Person to,string contents)Person(string name,address wallet)"

#### Parameters

##### primaryType

`string`

Primary type name to encode

##### types

[`TypeDefinitions`](#typedefinitions)

Type definitions mapping

#### Returns

`string`

Encoded type string with primary type followed by referenced types in alphabetical order

#### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

#### Since

0.0.0

#### Throws

If primaryType or any referenced type is not found

#### Example

```javascript theme={null}
import * as EIP712 from './crypto/EIP712/index.js';
const types = { Mail: [{ name: 'from', type: 'Person' }], Person: [{ name: 'name', type: 'string' }] };
const typeString = EIP712.encodeType('Mail', types);
// Returns: "Mail(Person from)Person(string name)"
```

***

### EncodeValue()

> **EncodeValue**(`deps`): (`type`, `value`, `types`) => `Uint8Array`

Defined in: [src/crypto/EIP712/encodeValue.js:26](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/encodeValue.js#L26)

Factory: Encode single value to 32 bytes according to EIP-712.

Handles primitive types, arrays, strings, bytes, and custom structs.
Addresses must be pre-validated BrandedAddress types.

#### Parameters

##### deps

Crypto dependencies

###### hashStruct

(`type`, `data`, `types`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Hash struct function

###### keccak256

(`data`) => `Uint8Array`

Keccak256 hash function

#### Returns

Function that encodes value

> (`type`, `value`, `types`): `Uint8Array`

##### Parameters

###### type

`string`

###### value

[`MessageValue`](#messagevalue)

###### types

[`TypeDefinitions`](#typedefinitions)

##### Returns

`Uint8Array`

#### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

#### Since

0.0.0

#### Throws

If type is unsupported or value format is invalid

#### Example

```javascript theme={null}
import { EncodeValue } from './crypto/EIP712/encodeValue.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
import { HashStruct } from './hashStruct.js';
const hashStruct = HashStruct({ keccak256, encodeData });
const encodeValue = EncodeValue({ keccak256, hashStruct });
const encoded = encodeValue('uint256', 42n, types);
```

***

### format()

> **format**(`typedData`): `string`

Defined in: [src/crypto/EIP712/format.js:16](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/format.js#L16)

Format typed data for human-readable display.

#### Parameters

##### typedData

[`TypedData`](#typeddata)

Typed data to format

#### Returns

`string`

Human-readable multi-line string representation

#### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as EIP712 from './crypto/EIP712/index.js';
const formatted = EIP712.format(typedData);
console.log(formatted);
```

***

### HashDomain()

> **HashDomain**(`deps`): (`domain`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Defined in: [src/crypto/EIP712/Domain/hash.js:35](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/Domain/hash.js#L35)

Factory: Hash EIP-712 domain separator.

Only includes fields that are defined in the domain object.

#### Parameters

##### deps

Crypto dependencies

###### hashStruct

(`primaryType`, `data`, `types`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Hash struct function

#### Returns

Function that hashes domain

> (`domain`): [`HashType`](../index/namespaces/HashType.mdx#hashtype)

##### Parameters

###### domain

[`Domain`](#domain)

##### Returns

[`HashType`](../index/namespaces/HashType.mdx#hashtype)

#### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

#### Since

0.0.0

#### Throws

If domain type encoding fails

#### Example

```javascript theme={null}
import { Hash as HashDomain } from './crypto/EIP712/Domain/hash.js';
import { HashStruct } from '../hashStruct.js';
import { hash as keccak256 } from '../../Keccak256/hash.js';
const hashStruct = HashStruct({ keccak256, encodeData });
const hashDomain = HashDomain({ hashStruct });
const domain = { name: 'MyApp', version: '1', chainId: 1n };
const domainHash = hashDomain(domain);
```

***

### HashStruct()

> **HashStruct**(`deps`): (`primaryType`, `data`, `types`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Defined in: [src/crypto/EIP712/hashStruct.js:25](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/hashStruct.js#L25)

Factory: Hash struct according to EIP-712 specification.

Computes keccak256 of the encoded struct data.

#### Parameters

##### deps

Crypto dependencies

###### encodeData

(`primaryType`, `data`, `types`) => `Uint8Array`

Encode data function

###### keccak256

(`data`) => `Uint8Array`

Keccak256 hash function

#### Returns

Function that hashes struct

> (`primaryType`, `data`, `types`): [`HashType`](../index/namespaces/HashType.mdx#hashtype)

##### Parameters

###### primaryType

`string`

###### data

[`Message`](#message)

###### types

[`TypeDefinitions`](#typedefinitions)

##### Returns

[`HashType`](../index/namespaces/HashType.mdx#hashtype)

#### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

#### Since

0.0.0

#### Throws

If type is not found

#### Throws

If message data is invalid

#### Example

```javascript theme={null}
import { HashStruct } from './crypto/EIP712/hashStruct.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
import { EncodeData } from './encodeData.js';
const encodeData = EncodeData({ hashType, encodeValue });
const hashStruct = HashStruct({ keccak256, encodeData });
const types = { Person: [{ name: 'name', type: 'string' }] };
const hash = hashStruct('Person', { name: 'Alice' }, types);
```

***

### HashType()

> **HashType**(`deps`): (`primaryType`, `types`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Defined in: [src/crypto/EIP712/hashType.js:23](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/hashType.js#L23)

Factory: Hash type string according to EIP-712.

Computes keccak256 of the encoded type string.

#### Parameters

##### deps

Crypto dependencies

###### keccak256

(`data`) => `Uint8Array`

Keccak256 hash function

#### Returns

Function that hashes type string

> (`primaryType`, `types`): [`HashType`](../index/namespaces/HashType.mdx#hashtype)

##### Parameters

###### primaryType

`string`

###### types

[`TypeDefinitions`](#typedefinitions)

##### Returns

[`HashType`](../index/namespaces/HashType.mdx#hashtype)

#### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

#### Since

0.0.0

#### Throws

If type is not found

#### Example

```javascript theme={null}
import { HashType } from './crypto/EIP712/hashType.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
const hashType = HashType({ keccak256 });
const types = { Mail: [{ name: 'contents', type: 'string' }] };
const typeHash = hashType('Mail', types);
```

***

### HashTypedData()

> **HashTypedData**(`deps`): (`typedData`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Defined in: [src/crypto/EIP712/hashTypedData.js:27](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/hashTypedData.js#L27)

Factory: Hash typed data according to EIP-712 specification.

Computes: keccak256("\x19\x01" ‖ domainSeparator ‖ hashStruct(message))

#### Parameters

##### deps

Crypto dependencies

###### hashDomain

(`domain`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Hash domain function

###### hashStruct

(`primaryType`, `data`, `types`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Hash struct function

###### keccak256

(`data`) => `Uint8Array`

Keccak256 hash function

#### Returns

Function that hashes typed data

> (`typedData`): [`HashType`](../index/namespaces/HashType.mdx#hashtype)

##### Parameters

###### typedData

[`TypedData`](#typeddata)

##### Returns

[`HashType`](../index/namespaces/HashType.mdx#hashtype)

#### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

#### Since

0.0.0

#### Throws

If types are not found

#### Throws

If message data is invalid

#### Example

```javascript theme={null}
import { HashTypedData } from './crypto/EIP712/hashTypedData.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
import { Hash as HashDomain } from './Domain/hash.js';
import { HashStruct } from './hashStruct.js';
const hashDomain = HashDomain({ hashStruct });
const hashStruct = HashStruct({ keccak256, encodeData });
const hashTypedData = HashTypedData({ keccak256, hashDomain, hashStruct });
const hash = hashTypedData(typedData);
```

***

### RecoverAddress()

> **RecoverAddress**(`deps`): (`signature`, `typedData`) => [`AddressType`](../primitives/Address.mdx#addresstype)

Defined in: [src/crypto/EIP712/recoverAddress.js:27](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/recoverAddress.js#L27)

Factory: Recover Ethereum address from EIP-712 typed data signature.

Uses ECDSA public key recovery to determine the signer's address.

#### Parameters

##### deps

Crypto dependencies

###### hashTypedData

(`typedData`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Hash typed data function

###### keccak256

(`data`) => `Uint8Array`

Keccak256 hash function

###### recoverPublicKey

(`signature`, `hash`, `recoveryBit`) => `Uint8Array`

Secp256k1 public key recovery function

#### Returns

Function that recovers address

> (`signature`, `typedData`): [`AddressType`](../primitives/Address.mdx#addresstype)

##### Parameters

###### signature

[`Signature`](#signature)

###### typedData

[`TypedData`](#typeddata)

##### Returns

[`AddressType`](../primitives/Address.mdx#addresstype)

#### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

#### Since

0.0.0

#### Throws

If signature recovery fails or public key format is invalid

#### Example

```javascript theme={null}
import { RecoverAddress } from './crypto/EIP712/recoverAddress.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
import { recoverPublicKey } from '../Secp256k1/recoverPublicKey.js';
import { HashTypedData } from './hashTypedData.js';
const hashTypedData = HashTypedData({ keccak256, hashDomain, hashStruct });
const recoverAddress = RecoverAddress({ keccak256, recoverPublicKey, hashTypedData });
const address = recoverAddress(signature, typedData);
```

***

### signTypedData()

> **signTypedData**(`typedData`, `privateKey`): [`Signature`](#signature)

Defined in: [src/crypto/EIP712/EIP712.js:80](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/EIP712.js#L80)

#### Parameters

##### typedData

`any`

##### privateKey

`any`

#### Returns

[`Signature`](#signature)

***

### SignTypedData()

> **SignTypedData**(`deps`): (`typedData`, `privateKey`) => [`Signature`](#signature)

Defined in: [src/crypto/EIP712/signTypedData.js:25](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/signTypedData.js#L25)

Factory: Sign EIP-712 typed data with ECDSA private key.

Produces a signature that can be verified against the signer's address.

#### Parameters

##### deps

Crypto dependencies

###### hashTypedData

(`typedData`) => [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Hash typed data function

###### sign

(`hash`, `privateKey`) => [`Signature`](#signature)

Secp256k1 sign function

#### Returns

Function that signs typed data

> (`typedData`, `privateKey`): [`Signature`](#signature)

##### Parameters

###### typedData

[`TypedData`](#typeddata)

###### privateKey

`Uint8Array`

##### Returns

[`Signature`](#signature)

#### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

#### Since

0.0.0

#### Throws

If private key length is invalid or signing fails

#### Example

```javascript theme={null}
import { SignTypedData } from './crypto/EIP712/signTypedData.js';
import { HashTypedData } from './hashTypedData.js';
import { sign } from '../Secp256k1/sign.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
const hashTypedData = HashTypedData({ keccak256, hashDomain, hashStruct });
const signTypedData = SignTypedData({ hashTypedData, sign });
const privateKey = new Uint8Array(32);
const signature = signTypedData(typedData, privateKey);
```

***

### validate()

> **validate**(`typedData`): `void`

Defined in: [src/crypto/EIP712/validate.js:19](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/validate.js#L19)

Validate typed data structure against EIP-712 specification.

Checks domain, types, primaryType, and message structure.

#### Parameters

##### typedData

[`TypedData`](#typeddata)

Typed data to validate

#### Returns

`void`

#### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

#### Since

0.0.0

#### Throws

If structure is invalid or missing required fields

#### Example

```javascript theme={null}
import * as EIP712 from './crypto/EIP712/index.js';
EIP712.validate(typedData); // Throws if invalid
```

***

### VerifyTypedData()

> **VerifyTypedData**(`deps`): (`signature`, `typedData`, `address`) => `boolean`

Defined in: [src/crypto/EIP712/verifyTypedData.js:23](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/crypto/EIP712/verifyTypedData.js#L23)

Factory: Verify EIP-712 typed data signature against expected signer address.

Uses constant-time comparison to prevent timing attacks.

#### Parameters

##### deps

Crypto dependencies

###### recoverAddress

(`signature`, `typedData`) => [`AddressType`](../primitives/Address.mdx#addresstype)

Recover address function

#### Returns

Function that verifies signature

> (`signature`, `typedData`, `address`): `boolean`

##### Parameters

###### signature

[`Signature`](#signature)

###### typedData

[`TypedData`](#typeddata)

###### address

[`AddressType`](../primitives/Address.mdx#addresstype)

##### Returns

`boolean`

#### See

[https://voltaire.tevm.sh/crypto](https://voltaire.tevm.sh/crypto) for crypto documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import { VerifyTypedData } from './crypto/EIP712/verifyTypedData.js';
import { RecoverAddress } from './recoverAddress.js';
import { hash as keccak256 } from '../Keccak256/hash.js';
import { recoverPublicKey } from '../Secp256k1/recoverPublicKey.js';
const recoverAddress = RecoverAddress({ keccak256, recoverPublicKey, hashTypedData });
const verifyTypedData = VerifyTypedData({ recoverAddress });
const valid = verifyTypedData(signature, typedData, signerAddress);
```
