@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(Defined in: src/crypto/eip712.wasm.ts:253 Encode data for structprimaryType,message,types):Uint8Array
Parameters
primaryType
string
Name of struct type
message
Message
Message data
types
TypeDefinitions
Type definitions
Returns
Uint8Array
Encoded data
encodeType()
encodeType(Defined in: src/crypto/eip712.wasm.ts:110 Encode type string (e.g., “Mail(Person from,Person to,string contents)“)primaryType,types):string
Parameters
primaryType
string
Name of primary type
types
TypeDefinitions
Type definitions
Returns
string
Type encoding string
encodeValue()
encodeValue(Defined in: src/crypto/eip712.wasm.ts:170 Encode single valuetype,value,types):Uint8Array
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(Defined in: src/crypto/eip712.wasm.ts:407 Format typed data for displaytypedData):string
Parameters
typedData
TypedData
Returns
string
hashStruct()
hashStruct(Defined in: src/crypto/eip712.wasm.ts:295 Hash structprimaryType,message,types):HashType
Parameters
primaryType
string
Name of struct type
message
Message
Message data
types
TypeDefinitions
Type definitions
Returns
HashType
32-byte struct hash
hashType()
hashType(Defined in: src/crypto/eip712.wasm.ts:152 Hash type stringprimaryType,types):HashType
Parameters
primaryType
string
Name of primary type
types
TypeDefinitions
Type definitions
Returns
HashType
32-byte type hash
hashTypedData()
hashTypedData(Defined in: src/crypto/eip712.wasm.ts:314 Hash typed data (EIP-712 signing hash)typedData):HashType
Parameters
typedData
TypedData
Complete typed data structure
Returns
HashType
32-byte hash ready for signing
init()
init():Defined in: src/crypto/eip712.wasm.ts:420 Initialize WASM modules Must be called before using any Eip712Wasm functions.Promise<void>
Returns
Promise<void>
recoverAddress()
recoverAddress(Defined in: src/crypto/eip712.wasm.ts:354 Recover signer address from signaturesignature,typedData):AddressType
Parameters
signature
Signature
Signature to recover from
typedData
TypedData
Typed data that was signed
Returns
AddressType
Recovered address
signTypedData()
signTypedData(Defined in: src/crypto/eip712.wasm.ts:339 Sign typed data with private keytypedData,privateKey):Signature
Parameters
typedData
TypedData
Typed data to sign
privateKey
Uint8Array
32-byte private key
Returns
Signature
Signature (r, s, v)
validate()
validate(Defined in: src/crypto/eip712.wasm.ts:394 Validate typed data structuretypedData):boolean
Parameters
typedData
TypedData
Returns
boolean
verifyTypedData()
verifyTypedData(Defined in: src/crypto/eip712.wasm.ts:374 Verify typed data signature against addresssignature,typedData,address):boolean
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
