Documentation ¶
Index ¶
- Constants
- func EncodeTypedDataV4(ctx context.Context, payload *TypedData) (encoded ethtypes.HexBytes0xPrefix, err error)
- func HashStruct(ctx context.Context, typeName string, v interface{}, allTypes TypeSet) (result ethtypes.HexBytes0xPrefix, err error)
- type Type
- type TypeMember
- type TypeSet
- type TypedData
Constants ¶
View Source
const EIP712Domain = "EIP712Domain"
Variables ¶
This section is empty.
Functions ¶
func EncodeTypedDataV4 ¶
func HashStruct ¶ added in v1.1.14
func HashStruct(ctx context.Context, typeName string, v interface{}, allTypes TypeSet) (result ethtypes.HexBytes0xPrefix, err error)
HashStruct allows hashing of an individual structure, without the EIP-712 domain
Types ¶
type Type ¶
type Type []*TypeMember
type TypeMember ¶
func (*TypeMember) Encode ¶
func (tm *TypeMember) Encode() string
An individual member is encoded as:
> type ‖ " " ‖ name
type TypeSet ¶
func ABItoTypedDataV4 ¶
func ABItoTypedDataV4(ctx context.Context, tc abi.TypeComponent) (primaryType string, typeSet TypeSet, err error)
Convert an ABI tuple definition, into the EIP-712 structure that's embedded into the "eth_signTypedData" signing request payload. It's a much simpler structure that flattens out a map of types (requiring each type to be named by a struct definition)
Click to show internal directories.
Click to hide internal directories.