Documentation ¶
Index ¶
- func GetEIP712BytesForMsg(signDocBytes []byte) ([]byte, error)
- func GetEIP712TypedDataForMsg(signDocBytes []byte) (apitypes.TypedData, error)
- func SetEncodingConfig(cfg params.EncodingConfig)
- func WrapTxToTypedData(cdc codectypes.AnyUnpacker, chainID uint64, msg sdk.Msg, data []byte, ...) (apitypes.TypedData, error)
- type FeeDelegationOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEIP712BytesForMsg ¶
Get the EIP-712 object bytes for the given SignDoc bytes by first decoding the bytes into an EIP-712 object, then hashing the EIP-712 object to create the bytes to be signed. See https://eips.ethereum.org/EIPS/eip-712 for more.
func GetEIP712TypedDataForMsg ¶
GetEIP712TypedDataForMsg returns the EIP-712 TypedData representation for either Amino or Protobuf encoded signature doc bytes.
func SetEncodingConfig ¶
func SetEncodingConfig(cfg params.EncodingConfig)
SetEncodingConfig set the encoding config to the singleton codecs (Amino and Protobuf). The process of unmarshaling SignDoc bytes into a SignDoc object requires having a codec populated with all relevant message types. As a result, we must call this method on app initialization with the app's encoding config.
func WrapTxToTypedData ¶
func WrapTxToTypedData( cdc codectypes.AnyUnpacker, chainID uint64, msg sdk.Msg, data []byte, feeDelegation *FeeDelegationOptions, ) (apitypes.TypedData, error)
WrapTxToTypedData is an ultimate method that wraps Amino-encoded Cosmos Tx JSON data into an EIP712-compatible TypedData request.
Types ¶
type FeeDelegationOptions ¶
type FeeDelegationOptions struct {
FeePayer sdk.AccAddress
}