Signer.signTypedData is more
useful.
Constructors
new TypedDataEncoder()
types.
This performs all necessary checking that types are valid and do not violate the
EIP-712 structural constraints as well as computes the
primaryType.
Parameters
Returns
TypedDataEncoder
Source
hash/typed-data.ts:259Properties
Accessors
types
Returns
Record<string, TypedDataField[]>
Source
hash/typed-data.ts:244Methods
encode()
value for the types.
Parameters
Returns
string
The encoded value.
Source
hash/typed-data.ts:465encodeData()
value for the type.
Parameters
Returns
string
The encoded value.
Source
hash/typed-data.ts:444encodeType()
name.
Parameters
Returns
string
The full type.
Source
hash/typed-data.ts:431getEncoder()
type.
Parameters
Returns
Function
The encoder for the type.
Parameters
Returns
string
Source
hash/typed-data.ts:365hash()
value for the types.
Parameters
Returns
string
The hash of the value.
Source
hash/typed-data.ts:475hashStruct()
value for the type of name.
Parameters
Returns
string
The hash of the value.
Source
hash/typed-data.ts:455visit()
calback for each value in value, passing the type and component within value.
This is useful for replacing addresses or other transformation that may be desired on each component, based on
its type.
Parameters
Returns
any
The result of the callback.
Source
hash/typed-data.ts:528encode()
value for types with domain.
Parameters
Returns
string
The encoded value.
Source
hash/typed-data.ts:599from()
types.
Parameters
Returns
TypedDataEncoder
The encoder for the types.
Throws
If the types are invalid.Source
hash/typed-data.ts:539getPayload()
Parameters
Returns
any
The JSON-encoded payload.
Source
hash/typed-data.ts:633getPrimaryType()
types.
Parameters
Returns
string
The primary type.
Throws
If the types are invalid.Source
hash/typed-data.ts:550hash()
value for types with
domain.
Parameters
Returns
string
The hash of the value.
Source
hash/typed-data.ts:616hashDomain()
domain.
Parameters
Returns
string
The hash of the domain.
Throws
If the domain is invalid.Source
hash/typed-data.ts:573hashStruct()
value using types and name.
Parameters
Returns
string
The hash of the value.
