Documentation
¶
Index ¶
- Variables
- func FlattenPayloadMessages(payload gjson.Result) (gjson.Result, int, error)
- func GetEIP712BytesForMsg(signDocBytes []byte) ([]byte, error)
- func GetEIP712TypedDataForMsg(signDocBytes []byte) (apitypes.TypedData, error)
- func LegacyGetEIP712BytesForMsg(signDocBytes []byte) ([]byte, error)
- func LegacyGetEIP712TypedDataForMsg(signDocBytes []byte, eip155ChainID uint64) (apitypes.TypedData, error)
- func LegacyWrapTxToTypedData(cdc codectypes.AnyUnpacker, chainID uint64, msg sdk.Msg, data []byte, ...) (apitypes.TypedData, error)
- func PreprocessLedgerTx(evmChainID uint64, keyType cosmoskr.KeyType, txBuilder client.TxBuilder) error
- func RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func SetEncodingConfig(cdc *codec.LegacyAmino, interfaceRegistry types.InterfaceRegistry, ...)
- func WrapTxToTypedData(chainID uint64, data []byte) (apitypes.TypedData, error)
- type ExtensionOptionsWeb3Tx
- func (*ExtensionOptionsWeb3Tx) Descriptor() ([]byte, []int)
- func (m *ExtensionOptionsWeb3Tx) Marshal() (dAtA []byte, err error)
- func (m *ExtensionOptionsWeb3Tx) MarshalTo(dAtA []byte) (int, error)
- func (m *ExtensionOptionsWeb3Tx) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ExtensionOptionsWeb3Tx) ProtoMessage()
- func (m *ExtensionOptionsWeb3Tx) Reset()
- func (m *ExtensionOptionsWeb3Tx) Size() (n int)
- func (m *ExtensionOptionsWeb3Tx) String() string
- func (m *ExtensionOptionsWeb3Tx) Unmarshal(dAtA []byte) error
- func (m *ExtensionOptionsWeb3Tx) XXX_DiscardUnknown()
- func (m *ExtensionOptionsWeb3Tx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ExtensionOptionsWeb3Tx) XXX_Merge(src proto.Message)
- func (m *ExtensionOptionsWeb3Tx) XXX_Size() int
- func (m *ExtensionOptionsWeb3Tx) XXX_Unmarshal(b []byte) error
- type FeeDelegationOptions
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func FlattenPayloadMessages ¶
FlattenPayloadMessages flattens the input payload's messages, representing them as key-value pairs of "msg{i}": {Msg}, rather than as an array of Msgs. We do this to support messages with different schemas.
func GetEIP712BytesForMsg ¶
GetEIP712BytesForMsg returns the EIP-712 object bytes for the given SignDoc bytes by decoding the bytes into an EIP-712 object, then converting via WrapTxToTypedData. 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 LegacyGetEIP712BytesForMsg ¶
LegacyGetEIP712BytesForMsg returns the EIP-712 object bytes for the given SignDoc bytes by decoding the bytes into an EIP-712 object, then converting via LegacyWrapTxToTypedData. See https://eips.ethereum.org/EIPS/eip-712 for more.
func LegacyGetEIP712TypedDataForMsg ¶
func LegacyGetEIP712TypedDataForMsg(signDocBytes []byte, eip155ChainID uint64) (apitypes.TypedData, error)
LegacyGetEIP712TypedDataForMsg returns the EIP-712 TypedData representation for either Amino or Protobuf encoded signature doc bytes.
func LegacyWrapTxToTypedData ¶
func LegacyWrapTxToTypedData( cdc codectypes.AnyUnpacker, chainID uint64, msg sdk.Msg, data []byte, feeDelegation *FeeDelegationOptions, ) (apitypes.TypedData, error)
LegacyWrapTxToTypedData is an ultimate method that wraps Amino-encoded Cosmos Tx JSON data into an EIP712-compatible TypedData request.
func PreprocessLedgerTx ¶
func PreprocessLedgerTx(evmChainID uint64, keyType cosmoskr.KeyType, txBuilder client.TxBuilder) error
PreprocessLedgerTx reformats Ledger-signed Cosmos transactions to match the fork expected by Cosmos EVM by including the signature in a Web3Tx extension and sending a blank signature in the body.
func RegisterInterfaces ¶ added in v0.5.0
func RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces registers the CometBFT concrete client-related implementations and interfaces.
func SetEncodingConfig ¶
func SetEncodingConfig(cdc *codec.LegacyAmino, interfaceRegistry types.InterfaceRegistry, evmChainID uint64)
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.
Types ¶
type ExtensionOptionsWeb3Tx ¶ added in v0.5.0
type ExtensionOptionsWeb3Tx struct {
// typed_data_chain_id is used only in EIP712 Domain and should match
// Ethereum network ID in a Web3 provider (e.g. Metamask).
TypedDataChainID uint64 `protobuf:"varint,1,opt,name=typed_data_chain_id,json=typedDataChainId,proto3" json:"typedDataChainID,omitempty"`
// fee_payer is an account address for the fee payer. It will be validated
// during EIP712 signature checking.
FeePayer string `protobuf:"bytes,2,opt,name=fee_payer,json=feePayer,proto3" json:"feePayer,omitempty"`
// fee_payer_sig is a signature data from the fee paying account,
// allows to perform fee delegation when using EIP712 Domain.
FeePayerSig []byte `protobuf:"bytes,3,opt,name=fee_payer_sig,json=feePayerSig,proto3" json:"feePayerSig,omitempty"`
}
ExtensionOptionsWeb3Tx is an extension option that specifies the typed chain id, the fee payer as well as its signature data.
func (*ExtensionOptionsWeb3Tx) Descriptor ¶ added in v0.5.0
func (*ExtensionOptionsWeb3Tx) Descriptor() ([]byte, []int)
func (*ExtensionOptionsWeb3Tx) Marshal ¶ added in v0.5.0
func (m *ExtensionOptionsWeb3Tx) Marshal() (dAtA []byte, err error)
func (*ExtensionOptionsWeb3Tx) MarshalTo ¶ added in v0.5.0
func (m *ExtensionOptionsWeb3Tx) MarshalTo(dAtA []byte) (int, error)
func (*ExtensionOptionsWeb3Tx) MarshalToSizedBuffer ¶ added in v0.5.0
func (m *ExtensionOptionsWeb3Tx) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ExtensionOptionsWeb3Tx) ProtoMessage ¶ added in v0.5.0
func (*ExtensionOptionsWeb3Tx) ProtoMessage()
func (*ExtensionOptionsWeb3Tx) Reset ¶ added in v0.5.0
func (m *ExtensionOptionsWeb3Tx) Reset()
func (*ExtensionOptionsWeb3Tx) Size ¶ added in v0.5.0
func (m *ExtensionOptionsWeb3Tx) Size() (n int)
func (*ExtensionOptionsWeb3Tx) String ¶ added in v0.5.0
func (m *ExtensionOptionsWeb3Tx) String() string
func (*ExtensionOptionsWeb3Tx) Unmarshal ¶ added in v0.5.0
func (m *ExtensionOptionsWeb3Tx) Unmarshal(dAtA []byte) error
func (*ExtensionOptionsWeb3Tx) XXX_DiscardUnknown ¶ added in v0.5.0
func (m *ExtensionOptionsWeb3Tx) XXX_DiscardUnknown()
func (*ExtensionOptionsWeb3Tx) XXX_Marshal ¶ added in v0.5.0
func (m *ExtensionOptionsWeb3Tx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ExtensionOptionsWeb3Tx) XXX_Merge ¶ added in v0.5.0
func (m *ExtensionOptionsWeb3Tx) XXX_Merge(src proto.Message)
func (*ExtensionOptionsWeb3Tx) XXX_Size ¶ added in v0.5.0
func (m *ExtensionOptionsWeb3Tx) XXX_Size() int
func (*ExtensionOptionsWeb3Tx) XXX_Unmarshal ¶ added in v0.5.0
func (m *ExtensionOptionsWeb3Tx) XXX_Unmarshal(b []byte) error
type FeeDelegationOptions ¶
type FeeDelegationOptions struct {
FeePayer sdk.AccAddress
}