Skip to main content
@tevm/voltaire
@tevm/voltaire / index / wasm / Eip712Wasm

Eip712Wasm

Namespaces

Type Aliases

Signature

Signature = Signature
Defined in: src/crypto/eip712.wasm.ts:54

Types

Types = TypeDefinitions
Defined in: src/crypto/eip712.wasm.ts:55

Functions

encodeData()

encodeData(primaryType, message, types): Uint8Array
Defined in: src/crypto/eip712.wasm.ts:253 Encode data for struct

Parameters

primaryType
string Name of struct type
message
Message Message data
types
TypeDefinitions Type definitions

Returns

Uint8Array Encoded data

encodeType()

encodeType(primaryType, types): string
Defined in: src/crypto/eip712.wasm.ts:110 Encode type string (e.g., “Mail(Person from,Person to,string contents)“)

Parameters

primaryType
string Name of primary type
types
TypeDefinitions Type definitions

Returns

string Type encoding string

encodeValue()

encodeValue(type, value, types): Uint8Array
Defined in: src/crypto/eip712.wasm.ts:170 Encode single value

Parameters

type
string Solidity type string
value
unknown Value to encode
types
TypeDefinitions Type definitions (for structs)

Returns

Uint8Array 32-byte encoded value

format()

format(typedData): string
Defined in: src/crypto/eip712.wasm.ts:407 Format typed data for display

Parameters

typedData
TypedData

Returns

string

hashStruct()

hashStruct(primaryType, message, types): HashType
Defined in: src/crypto/eip712.wasm.ts:295 Hash struct

Parameters

primaryType
string Name of struct type
message
Message Message data
types
TypeDefinitions Type definitions

Returns

HashType 32-byte struct hash

hashType()

hashType(primaryType, types): HashType
Defined in: src/crypto/eip712.wasm.ts:152 Hash type string

Parameters

primaryType
string Name of primary type
types
TypeDefinitions Type definitions

Returns

HashType 32-byte type hash

hashTypedData()

hashTypedData(typedData): HashType
Defined in: src/crypto/eip712.wasm.ts:314 Hash typed data (EIP-712 signing hash)

Parameters

typedData
TypedData Complete typed data structure

Returns

HashType 32-byte hash ready for signing

init()

init(): Promise<void>
Defined in: src/crypto/eip712.wasm.ts:420 Initialize WASM modules Must be called before using any Eip712Wasm functions.

Returns

Promise<void>

recoverAddress()

recoverAddress(signature, typedData): AddressType
Defined in: src/crypto/eip712.wasm.ts:354 Recover signer address from signature

Parameters

signature
Signature Signature to recover from
typedData
TypedData Typed data that was signed

Returns

AddressType Recovered address

signTypedData()

signTypedData(typedData, privateKey): Signature
Defined in: src/crypto/eip712.wasm.ts:339 Sign typed data with private key

Parameters

typedData
TypedData Typed data to sign
privateKey
Uint8Array 32-byte private key

Returns

Signature Signature (r, s, v)

validate()

validate(typedData): boolean
Defined in: src/crypto/eip712.wasm.ts:394 Validate typed data structure

Parameters

typedData
TypedData

Returns

boolean

verifyTypedData()

verifyTypedData(signature, typedData, address): boolean
Defined in: src/crypto/eip712.wasm.ts:374 Verify typed data signature against address

Parameters

signature
Signature Signature to verify
typedData
TypedData Typed data that was signed
address
AddressType Expected signer address

Returns

boolean True if signature is valid