@tevm/voltaire / crypto/EIP712
crypto/EIP712
Classes
Eip712EncodingError
Defined in: src/crypto/EIP712/errors.js:45 EIP-712 encoding errorExample
Extends
Constructors
Constructor
new Eip712EncodingError(Defined in: src/crypto/EIP712/errors.js:50message,options?):Eip712EncodingError
Parameters
message
string
options?
cause?
Error
code?
string
context?
Record<string, unknown>
docsPath?
string
Returns
Eip712EncodingError
Overrides
Eip712Error.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
Eip712Error.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
Eip712Error.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
Eip712Error.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
Eip712Error.docsPath
name
name: string
Defined in: src/crypto/EIP712/errors.js:57
Inherited from
Eip712Error.name
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
Eip712Error.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
Eip712Error.toJSON
Eip712Error
Defined in: src/crypto/EIP712/errors.js:16 Base EIP-712 errorExample
Extends
Extended by
Constructors
Constructor
new Eip712Error(Defined in: src/crypto/EIP712/errors.js:21message,options?):Eip712Error
Parameters
message
string
options?
cause?
Error
code?
string
context?
Record<string, unknown>
docsPath?
string
Returns
Eip712Error
Overrides
CryptoError.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
CryptoError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
CryptoError.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
CryptoError.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
CryptoError.docsPath
name
name: string
Defined in: src/crypto/EIP712/errors.js:28
Inherited from
CryptoError.name
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
CryptoError.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
CryptoError.toJSON
Eip712InvalidMessageError
Defined in: src/crypto/EIP712/errors.js:103 EIP-712 invalid message errorExample
Extends
Constructors
Constructor
new Eip712InvalidMessageError(Defined in: src/crypto/EIP712/errors.js:108message,options?):Eip712InvalidMessageError
Parameters
message
string
options?
cause?
Error
code?
string
context?
Record<string, unknown>
docsPath?
string
Returns
Eip712InvalidMessageError
Overrides
Eip712Error.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
Eip712Error.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
Eip712Error.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
Eip712Error.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
Eip712Error.docsPath
name
name: string
Defined in: src/crypto/EIP712/errors.js:115
Inherited from
Eip712Error.name
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
Eip712Error.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
Eip712Error.toJSON
Eip712TypeNotFoundError
Defined in: src/crypto/EIP712/errors.js:74 EIP-712 type not found errorExample
Extends
Constructors
Constructor
new Eip712TypeNotFoundError(Defined in: src/crypto/EIP712/errors.js:79message,options?):Eip712TypeNotFoundError
Parameters
message
string
options?
cause?
Error
code?
string
context?
Record<string, unknown>
docsPath?
string
Returns
Eip712TypeNotFoundError
Overrides
Eip712Error.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
Eip712Error.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
Eip712Error.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
Eip712Error.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
Eip712Error.docsPath
name
name: string
Defined in: src/crypto/EIP712/errors.js:86
Inherited from
Eip712Error.name
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
Eip712Error.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
Eip712Error.toJSON
Type Aliases
BrandedEIP712
BrandedEIP712 =Defined in: src/crypto/EIP712/EIP712Type.ts:73 Branded EIP-712 TypedData typeTypedData&object
Type Declaration
[brand]
readonly[brand]:"EIP712"
Domain
Domain = object
Defined in: src/crypto/EIP712/EIP712Type.ts:8
EIP-712 Domain separator fields
Properties
chainId?
Defined in: src/crypto/EIP712/EIP712Type.ts:11optionalchainId:bigint
name?
Defined in: src/crypto/EIP712/EIP712Type.ts:9optionalname:string
salt?
Defined in: src/crypto/EIP712/EIP712Type.ts:13optionalsalt:HashType
verifyingContract?
Defined in: src/crypto/EIP712/EIP712Type.ts:12optionalverifyingContract:AddressType
version?
Defined in: src/crypto/EIP712/EIP712Type.ts:10optionalversion:string
Message
Message = object
Defined in: src/crypto/EIP712/EIP712Type.ts:47
Message data (object with arbitrary structure matching types)
Index Signature
[key: string]: MessageValue
MessageValue
MessageValue =Defined in: src/crypto/EIP712/EIP712Type.ts:34 Message value (can be primitive or nested object)string|bigint|number|boolean|AddressType|Uint8Array|MessageValue[] | {[key:string]:MessageValue; }
Signature
Signature = object
Defined in: src/crypto/EIP712/EIP712Type.ts:64
ECDSA Signature
Properties
r
r: Uint8Array
Defined in: src/crypto/EIP712/EIP712Type.ts:65
s
s: Uint8Array
Defined in: src/crypto/EIP712/EIP712Type.ts:66
v
v: number
Defined in: src/crypto/EIP712/EIP712Type.ts:67
TypedData
TypedData = object
Defined in: src/crypto/EIP712/EIP712Type.ts:54
Complete EIP-712 typed data structure
Properties
domain
domain: Domain
Defined in: src/crypto/EIP712/EIP712Type.ts:55
message
message: Message
Defined in: src/crypto/EIP712/EIP712Type.ts:58
primaryType
primaryType: string
Defined in: src/crypto/EIP712/EIP712Type.ts:57
types
types: TypeDefinitions
Defined in: src/crypto/EIP712/EIP712Type.ts:56
TypeDefinitions
TypeDefinitions = object
Defined in: src/crypto/EIP712/EIP712Type.ts:27
Type definitions mapping type names to their properties
Index Signature
[typeName: string]: readonly TypeProperty[]
TypeProperty
TypeProperty = object
Defined in: src/crypto/EIP712/EIP712Type.ts:19
Type property definition
Properties
name
name: string
Defined in: src/crypto/EIP712/EIP712Type.ts:20
type
type: string
Defined in: src/crypto/EIP712/EIP712Type.ts:21
Variables
_signTypedData()
Defined in: src/crypto/EIP712/EIP712.js:76const_signTypedData: (typedData,privateKey) =>Signature
Parameters
typedData
TypedData
privateKey
Uint8Array
Returns
Signature
EIP712
Defined in: src/crypto/EIP712/EIP712.js:157 EIP-712 Typed Data Signing Complete implementation of EIP-712 typed structured data hashing and signing.constEIP712:object
Type Declaration
Domain
Domain: object
Domain.hash()
hash: (domain) =>HashType=hashDomain
Parameters
domain
Domain
Returns
HashType
encodeData()
encodeData: (primaryType,data,types) =>Uint8Array
Parameters
primaryType
string
data
Message
types
TypeDefinitions
Returns
Uint8Array
EncodeData()
EncodeData: (Factory: Encode struct data according to EIP-712.deps) => (primaryType,data,types) =>Uint8Array
Parameters
deps
Crypto dependenciesencodeValue
(type, value, types) => Uint8Array
Encode value function
hashType
(primaryType, types) => HashType
Hash type function
Returns
Function that encodes data(primaryType,data,types):Uint8Array
Parameters
primaryType
string
data
Message
types
TypeDefinitions
Returns
Uint8Array
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If primaryType is not found in typesThrows
If required field is missing from dataExample
encodeType()
encodeType: (Encode type string for EIP-712 hashing. Produces type encoding like “Mail(Person from,Person to,string contents)Person(string name,address wallet)“primaryType,types) =>string
Parameters
primaryType
string
Primary type name to encode
types
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 for crypto documentationSince
0.0.0Throws
If primaryType or any referenced type is not foundExample
encodeValue()
encodeValue: (type,value,types) =>Uint8Array
Parameters
type
string
value
MessageValue
types
TypeDefinitions
Returns
Uint8Array
EncodeValue()
EncodeValue: (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.deps) => (type,value,types) =>Uint8Array
Parameters
deps
Crypto dependencieshashStruct
(type, data, types) => HashType
Hash struct function
keccak256
(data) => Uint8Array
Keccak256 hash function
Returns
Function that encodes value(type,value,types):Uint8Array
Parameters
type
string
value
MessageValue
types
TypeDefinitions
Returns
Uint8Array
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If type is unsupported or value format is invalidExample
format()
format: (Format typed data for human-readable display.typedData) =>string
Parameters
typedData
TypedData
Typed data to format
Returns
string
Human-readable multi-line string representation
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
Example
HashDomain()
HashDomain: (Factory: Hash EIP-712 domain separator. Only includes fields that are defined in the domain object.deps) => (domain) =>HashType
Parameters
deps
Crypto dependencieshashStruct
(primaryType, data, types) => HashType
Hash struct function
Returns
Function that hashes domain(domain):HashType
Parameters
domain
Domain
Returns
HashType
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If domain type encoding failsExample
hashStruct()
hashStruct: (primaryType,data,types) =>HashType
Parameters
primaryType
string
data
Message
types
TypeDefinitions
Returns
HashType
HashStruct()
HashStruct: (Factory: Hash struct according to EIP-712 specification. Computes keccak256 of the encoded struct data.deps) => (primaryType,data,types) =>HashType
Parameters
deps
Crypto dependenciesencodeData
(primaryType, data, types) => Uint8Array
Encode data function
keccak256
(data) => Uint8Array
Keccak256 hash function
Returns
Function that hashes struct(primaryType,data,types):HashType
Parameters
primaryType
string
data
Message
types
TypeDefinitions
Returns
HashType
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If type is not foundThrows
If message data is invalidExample
hashType()
hashType: (primaryType,types) =>HashType
Parameters
primaryType
string
types
TypeDefinitions
Returns
HashType
HashType()
HashType: (Factory: Hash type string according to EIP-712. Computes keccak256 of the encoded type string.deps) => (primaryType,types) =>HashType
Parameters
deps
Crypto dependencieskeccak256
(data) => Uint8Array
Keccak256 hash function
Returns
Function that hashes type string(primaryType,types):HashType
Parameters
primaryType
string
types
TypeDefinitions
Returns
HashType
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If type is not foundExample
hashTypedData()
hashTypedData: (typedData) =>HashType
Parameters
typedData
TypedData
Returns
HashType
HashTypedData()
HashTypedData: (Factory: Hash typed data according to EIP-712 specification. Computes: keccak256(“\x19\x01” ‖ domainSeparator ‖ hashStruct(message))deps) => (typedData) =>HashType
Parameters
deps
Crypto dependencieshashDomain
(domain) => HashType
Hash domain function
hashStruct
(primaryType, data, types) => HashType
Hash struct function
keccak256
(data) => Uint8Array
Keccak256 hash function
Returns
Function that hashes typed data(typedData):HashType
Parameters
typedData
TypedData
Returns
HashType
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If types are not foundThrows
If message data is invalidExample
recoverAddress()
recoverAddress: (signature,typedData) =>AddressType
Parameters
signature
Signature
typedData
TypedData
Returns
AddressType
RecoverAddress()
RecoverAddress: (Factory: Recover Ethereum address from EIP-712 typed data signature. Uses ECDSA public key recovery to determine the signer’s address.deps) => (signature,typedData) =>AddressType
Parameters
deps
Crypto dependencieshashTypedData
(typedData) => 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
Parameters
signature
Signature
typedData
TypedData
Returns
AddressType
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If signature recovery fails or public key format is invalidExample
signTypedData()
signTypedData: (typedData,privateKey) =>Signature
Parameters
typedData
any
privateKey
any
Returns
Signature
SignTypedData()
SignTypedData: (Factory: Sign EIP-712 typed data with ECDSA private key. Produces a signature that can be verified against the signer’s address.deps) => (typedData,privateKey) =>Signature
Parameters
deps
Crypto dependencieshashTypedData
(typedData) => HashType
Hash typed data function
sign
(hash, privateKey) => Signature
Secp256k1 sign function
Returns
Function that signs typed data(typedData,privateKey):Signature
Parameters
typedData
TypedData
privateKey
Uint8Array
Returns
Signature
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If private key length is invalid or signing failsExample
validate()
validate: (Validate typed data structure against EIP-712 specification. Checks domain, types, primaryType, and message structure.typedData) =>void
Parameters
typedData
TypedData
Typed data to validate
Returns
void
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If structure is invalid or missing required fieldsExample
verifyTypedData()
verifyTypedData: (signature,typedData,address) =>boolean
Parameters
signature
Signature
typedData
TypedData
address
AddressType
Returns
boolean
VerifyTypedData()
VerifyTypedData: (Factory: Verify EIP-712 typed data signature against expected signer address. Uses constant-time comparison to prevent timing attacks.deps) => (signature,typedData,address) =>boolean
Parameters
deps
Crypto dependenciesrecoverAddress
(signature, typedData) => AddressType
Recover address function
Returns
Function that verifies signature(signature,typedData,address):boolean
Parameters
signature
Signature
typedData
TypedData
address
AddressType
Returns
boolean
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
Example
Example
encodeData()
Defined in: src/crypto/EIP712/EIP712.js:54constencodeData: (primaryType,data,types) =>Uint8Array
Parameters
primaryType
string
data
Message
types
TypeDefinitions
Returns
Uint8Array
encodeValue()
Defined in: src/crypto/EIP712/EIP712.js:49constencodeValue: (type,value,types) =>Uint8Array
Parameters
type
string
value
MessageValue
types
TypeDefinitions
Returns
Uint8Array
hashDomain()
Defined in: src/crypto/EIP712/EIP712.js:57consthashDomain: (domain) =>HashType
Parameters
domain
Domain
Returns
HashType
hashStruct
hashStruct: any
Defined in: src/crypto/EIP712/EIP712.js:48
hashType()
Defined in: src/crypto/EIP712/EIP712.js:43consthashType: (primaryType,types) =>HashType
Parameters
primaryType
string
types
TypeDefinitions
Returns
HashType
hashTypedData()
Defined in: src/crypto/EIP712/EIP712.js:58consthashTypedData: (typedData) =>HashType
Parameters
typedData
TypedData
Returns
HashType
recoverAddress()
Defined in: src/crypto/EIP712/EIP712.js:70constrecoverAddress: (signature,typedData) =>AddressType
Parameters
signature
Signature
typedData
TypedData
Returns
AddressType
verifyTypedData()
Defined in: src/crypto/EIP712/EIP712.js:77constverifyTypedData: (signature,typedData,address) =>boolean
Parameters
signature
Signature
typedData
TypedData
address
AddressType
Returns
boolean
Functions
EncodeData()
EncodeData(Defined in: src/crypto/EIP712/encodeData.js:30 Factory: Encode struct data according to EIP-712.deps): (primaryType,data,types) =>Uint8Array
Parameters
deps
Crypto dependenciesencodeValue
(type, value, types) => Uint8Array
Encode value function
hashType
(primaryType, types) => HashType
Hash type function
Returns
Function that encodes data(primaryType,data,types):Uint8Array
Parameters
primaryType
string
data
Message
types
TypeDefinitions
Returns
Uint8Array
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If primaryType is not found in typesThrows
If required field is missing from dataExample
encodeType()
encodeType(Defined in: src/crypto/EIP712/encodeType.js:22 Encode type string for EIP-712 hashing. Produces type encoding like “Mail(Person from,Person to,string contents)Person(string name,address wallet)“primaryType,types):string
Parameters
primaryType
string
Primary type name to encode
types
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 for crypto documentationSince
0.0.0Throws
If primaryType or any referenced type is not foundExample
EncodeValue()
EncodeValue(Defined in: src/crypto/EIP712/encodeValue.js:26 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.deps): (type,value,types) =>Uint8Array
Parameters
deps
Crypto dependencieshashStruct
(type, data, types) => HashType
Hash struct function
keccak256
(data) => Uint8Array
Keccak256 hash function
Returns
Function that encodes value(type,value,types):Uint8Array
Parameters
type
string
value
MessageValue
types
TypeDefinitions
Returns
Uint8Array
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If type is unsupported or value format is invalidExample
format()
format(Defined in: src/crypto/EIP712/format.js:16 Format typed data for human-readable display.typedData):string
Parameters
typedData
TypedData
Typed data to format
Returns
string
Human-readable multi-line string representation
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
Example
HashDomain()
HashDomain(Defined in: src/crypto/EIP712/Domain/hash.js:35 Factory: Hash EIP-712 domain separator. Only includes fields that are defined in the domain object.deps): (domain) =>HashType
Parameters
deps
Crypto dependencieshashStruct
(primaryType, data, types) => HashType
Hash struct function
Returns
Function that hashes domain(domain):HashType
Parameters
domain
Domain
Returns
HashType
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If domain type encoding failsExample
HashStruct()
HashStruct(Defined in: src/crypto/EIP712/hashStruct.js:25 Factory: Hash struct according to EIP-712 specification. Computes keccak256 of the encoded struct data.deps): (primaryType,data,types) =>HashType
Parameters
deps
Crypto dependenciesencodeData
(primaryType, data, types) => Uint8Array
Encode data function
keccak256
(data) => Uint8Array
Keccak256 hash function
Returns
Function that hashes struct(primaryType,data,types):HashType
Parameters
primaryType
string
data
Message
types
TypeDefinitions
Returns
HashType
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If type is not foundThrows
If message data is invalidExample
HashType()
HashType(Defined in: src/crypto/EIP712/hashType.js:23 Factory: Hash type string according to EIP-712. Computes keccak256 of the encoded type string.deps): (primaryType,types) =>HashType
Parameters
deps
Crypto dependencieskeccak256
(data) => Uint8Array
Keccak256 hash function
Returns
Function that hashes type string(primaryType,types):HashType
Parameters
primaryType
string
types
TypeDefinitions
Returns
HashType
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If type is not foundExample
HashTypedData()
HashTypedData(Defined in: src/crypto/EIP712/hashTypedData.js:27 Factory: Hash typed data according to EIP-712 specification. Computes: keccak256(“\x19\x01” ‖ domainSeparator ‖ hashStruct(message))deps): (typedData) =>HashType
Parameters
deps
Crypto dependencieshashDomain
(domain) => HashType
Hash domain function
hashStruct
(primaryType, data, types) => HashType
Hash struct function
keccak256
(data) => Uint8Array
Keccak256 hash function
Returns
Function that hashes typed data(typedData):HashType
Parameters
typedData
TypedData
Returns
HashType
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If types are not foundThrows
If message data is invalidExample
RecoverAddress()
RecoverAddress(Defined in: src/crypto/EIP712/recoverAddress.js:27 Factory: Recover Ethereum address from EIP-712 typed data signature. Uses ECDSA public key recovery to determine the signer’s address.deps): (signature,typedData) =>AddressType
Parameters
deps
Crypto dependencieshashTypedData
(typedData) => 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
Parameters
signature
Signature
typedData
TypedData
Returns
AddressType
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If signature recovery fails or public key format is invalidExample
signTypedData()
signTypedData(Defined in: src/crypto/EIP712/EIP712.js:80typedData,privateKey):Signature
Parameters
typedData
any
privateKey
any
Returns
Signature
SignTypedData()
SignTypedData(Defined in: src/crypto/EIP712/signTypedData.js:25 Factory: Sign EIP-712 typed data with ECDSA private key. Produces a signature that can be verified against the signer’s address.deps): (typedData,privateKey) =>Signature
Parameters
deps
Crypto dependencieshashTypedData
(typedData) => HashType
Hash typed data function
sign
(hash, privateKey) => Signature
Secp256k1 sign function
Returns
Function that signs typed data(typedData,privateKey):Signature
Parameters
typedData
TypedData
privateKey
Uint8Array
Returns
Signature
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If private key length is invalid or signing failsExample
validate()
validate(Defined in: src/crypto/EIP712/validate.js:19 Validate typed data structure against EIP-712 specification. Checks domain, types, primaryType, and message structure.typedData):void
Parameters
typedData
TypedData
Typed data to validate
Returns
void
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If structure is invalid or missing required fieldsExample
VerifyTypedData()
VerifyTypedData(Defined in: src/crypto/EIP712/verifyTypedData.js:23 Factory: Verify EIP-712 typed data signature against expected signer address. Uses constant-time comparison to prevent timing attacks.deps): (signature,typedData,address) =>boolean
Parameters
deps
Crypto dependenciesrecoverAddress
(signature, typedData) => AddressType
Recover address function
Returns
Function that verifies signature(signature,typedData,address):boolean
Parameters
signature
Signature
typedData
TypedData
address
AddressType
Returns
boolean

