Documentation ¶
Index ¶
- func DefaultTxEncoder(cdc *codec.LegacyAmino) sdk.TxEncoder
- func MultiSignatureDataToAminoMultisignature(cdc *codec.LegacyAmino, mSig *signingtypes.MultiSignatureData) (multisig.AminoMultisignature, error)
- func NewStdTxSignModeHandler() signing.SignModeHandler
- func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- func SignatureDataToAminoSignature(cdc *codec.LegacyAmino, data signingtypes.SignatureData) ([]byte, error)
- func StdSignBytes(chainID string, accnum, sequence, timeout uint64, fee StdFee, msgs []sdk.Msg, ...) []byte
- func StdSignatureToSignatureV2(cdc *codec.LegacyAmino, sig StdSignature) (signing.SignatureV2, error)
- type LegacyMsg
- type StdFee
- type StdSignDoc
- type StdSignMsg
- type StdSignaturedeprecated
- type StdTx
- func (tx *StdTx) AsAny() *codectypes.Anydeprecated
- func (tx StdTx) FeeGranter() sdk.AccAddress
- func (tx StdTx) FeePayer() sdk.AccAddress
- func (tx StdTx) GetFee() sdk.Coins
- func (tx StdTx) GetGas() uint64
- func (tx StdTx) GetMemo() string
- func (tx StdTx) GetMsgs() []sdk.Msg
- func (tx StdTx) GetPubKeys() ([]cryptotypes.PubKey, error)
- func (tx StdTx) GetSignatures() [][]byte
- func (tx StdTx) GetSignaturesV2() ([]signing.SignatureV2, error)
- func (tx StdTx) GetSigners() []sdk.AccAddress
- func (tx StdTx) GetTimeoutHeight() uint64
- func (tx StdTx) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
- func (tx StdTx) ValidateBasic() error
- type StdTxBuilder
- func (s *StdTxBuilder) GetTx() authsigning.Tx
- func (s *StdTxBuilder) SetFeeAmount(amount sdk.Coins)
- func (s *StdTxBuilder) SetFeeGranter(_ sdk.AccAddress)
- func (s *StdTxBuilder) SetGasLimit(limit uint64)
- func (s *StdTxBuilder) SetMemo(memo string)
- func (s *StdTxBuilder) SetMsgs(msgs ...sdk.Msg) error
- func (s *StdTxBuilder) SetSignatures(signatures ...signing.SignatureV2) error
- func (s *StdTxBuilder) SetTimeoutHeight(height uint64)
- type StdTxConfig
- func (s StdTxConfig) MarshalSignatureJSON(sigs []signing.SignatureV2) ([]byte, error)
- func (s StdTxConfig) NewTxBuilder() client.TxBuilder
- func (s StdTxConfig) SignModeHandler() authsigning.SignModeHandler
- func (s StdTxConfig) TxDecoder() sdk.TxDecoder
- func (s StdTxConfig) TxEncoder() sdk.TxEncoder
- func (s StdTxConfig) TxJSONDecoder() sdk.TxDecoder
- func (s StdTxConfig) TxJSONEncoder() sdk.TxEncoder
- func (s StdTxConfig) UnmarshalSignatureJSON(bz []byte) ([]signing.SignatureV2, error)
- func (s StdTxConfig) WrapTxBuilder(newTx sdk.Tx) (client.TxBuilder, error)
- type Unmarshaler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultTxEncoder ¶
func DefaultTxEncoder(cdc *codec.LegacyAmino) sdk.TxEncoder
DefaultTxEncoder logic for standard transaction encoding
func MultiSignatureDataToAminoMultisignature ¶
func MultiSignatureDataToAminoMultisignature(cdc *codec.LegacyAmino, mSig *signingtypes.MultiSignatureData) (multisig.AminoMultisignature, error)
MultiSignatureDataToAminoMultisignature converts a MultiSignatureData to an AminoMultisignature. Only SIGN_MODE_LEGACY_AMINO_JSON is supported.
func NewStdTxSignModeHandler ¶
func NewStdTxSignModeHandler() signing.SignModeHandler
func RegisterLegacyAminoCodec ¶
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
func SignatureDataToAminoSignature ¶
func SignatureDataToAminoSignature(cdc *codec.LegacyAmino, data signingtypes.SignatureData) ([]byte, error)
SignatureDataToAminoSignature converts a SignatureData to amino-encoded signature bytes. Only SIGN_MODE_LEGACY_AMINO_JSON is supported.
func StdSignBytes ¶
func StdSignBytes(chainID string, accnum, sequence, timeout uint64, fee StdFee, msgs []sdk.Msg, memo string) []byte
StdSignBytes returns the bytes to sign for a transaction.
func StdSignatureToSignatureV2 ¶
func StdSignatureToSignatureV2(cdc *codec.LegacyAmino, sig StdSignature) (signing.SignatureV2, error)
StdSignatureToSignatureV2 converts a StdSignature to a SignatureV2
Types ¶
type LegacyMsg ¶ added in v0.43.0
type LegacyMsg interface { sdk.Msg // Get the canonical byte representation of the Msg. GetSignBytes() []byte // Return the message type. // Must be alphanumeric or empty. Route() string // Returns a human-readable string for the message, intended for utilization // within tags Type() string }
LegacyMsg defines the old interface a message must fulfill, containing Amino signing method and legacy router info. Deprecated: Please use `Msg` instead.
type StdFee ¶
type StdFee struct { Amount sdk.Coins `json:"amount" yaml:"amount"` Gas uint64 `json:"gas" yaml:"gas"` }
StdFee includes the amount of coins paid in fees and the maximum gas to be used by the transaction. The ratio yields an effective "gasprice", which must be above some miminum to be accepted into the mempool. [Deprecated]
func (StdFee) GasPrices ¶
GasPrices returns the gas prices for a StdFee.
NOTE: The gas prices returned are not the true gas prices that were originally part of the submitted transaction because the fee is computed as fee = ceil(gasWanted * gasPrices).
type StdSignDoc ¶
type StdSignDoc struct { AccountNumber uint64 `json:"account_number" yaml:"account_number"` Sequence uint64 `json:"sequence" yaml:"sequence"` TimeoutHeight uint64 `json:"timeout_height,omitempty" yaml:"timeout_height"` ChainID string `json:"chain_id" yaml:"chain_id"` Memo string `json:"memo" yaml:"memo"` Fee json.RawMessage `json:"fee" yaml:"fee"` Msgs []json.RawMessage `json:"msgs" yaml:"msgs"` }
StdSignDoc is replay-prevention structure. It includes the result of msg.GetSignBytes(), as well as the ChainID (prevent cross chain replay) and the Sequence numbers for each signature (prevent inchain replay and enforce tx ordering per account).
type StdSignMsg ¶
type StdSignMsg struct { ChainID string `json:"chain_id" yaml:"chain_id"` AccountNumber uint64 `json:"account_number" yaml:"account_number"` Sequence uint64 `json:"sequence" yaml:"sequence"` TimeoutHeight uint64 `json:"timeout_height" yaml:"timeout_height"` Fee StdFee `json:"fee" yaml:"fee"` Msgs []sdk.Msg `json:"msgs" yaml:"msgs"` Memo string `json:"memo" yaml:"memo"` }
StdSignMsg is a convenience structure for passing along a Msg with the other requirements for a StdSignDoc before it is signed. For use in the CLI.
func (StdSignMsg) UnpackInterfaces ¶
func (msg StdSignMsg) UnpackInterfaces(unpacker types.AnyUnpacker) error
type StdSignature
deprecated
type StdSignature struct { cryptotypes.PubKey `json:"pub_key" yaml:"pub_key"` // optional Signature []byte `json:"signature" yaml:"signature"` }
Deprecated: StdSignature represents a sig
func NewStdSignature ¶
func NewStdSignature(pk cryptotypes.PubKey, sig []byte) StdSignature
Deprecated
func SignatureV2ToStdSignature ¶
func SignatureV2ToStdSignature(cdc *codec.LegacyAmino, sig signing.SignatureV2) (StdSignature, error)
SignatureV2ToStdSignature converts a SignatureV2 to a StdSignature [Deprecated]
func (StdSignature) GetPubKey ¶
func (ss StdSignature) GetPubKey() cryptotypes.PubKey
GetPubKey returns the public key of a signature as a cryptotypes.PubKey using the Amino codec.
func (StdSignature) GetSignature ¶
func (ss StdSignature) GetSignature() []byte
GetSignature returns the raw signature bytes.
func (StdSignature) MarshalYAML ¶
func (ss StdSignature) MarshalYAML() (interface{}, error)
MarshalYAML returns the YAML representation of the signature.
func (StdSignature) UnpackInterfaces ¶ added in v0.41.4
func (ss StdSignature) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
type StdTx ¶
type StdTx struct { Msgs []sdk.Msg `json:"msg" yaml:"msg"` Fee StdFee `json:"fee" yaml:"fee"` Signatures []StdSignature `json:"signatures" yaml:"signatures"` Memo string `json:"memo" yaml:"memo"` TimeoutHeight uint64 `json:"timeout_height" yaml:"timeout_height"` }
StdTx is the legacy transaction format for wrapping a Msg with Fee and Signatures. It only works with Amino, please prefer the new protobuf Tx in types/tx. NOTE: the first signature is the fee payer (Signatures must not be nil). Deprecated
func (*StdTx) AsAny
deprecated
func (tx *StdTx) AsAny() *codectypes.Any
Deprecated: AsAny implements intoAny. It doesn't work for protobuf serialization, so it can't be saved into protobuf configured storage. We are using it only for API compatibility.
func (StdTx) FeeGranter ¶
func (tx StdTx) FeeGranter() sdk.AccAddress
FeeGranter always returns nil for StdTx
func (StdTx) FeePayer ¶
func (tx StdTx) FeePayer() sdk.AccAddress
FeePayer returns the address that is responsible for paying fee StdTx returns the first signer as the fee payer If no signers for tx, return empty address
func (StdTx) GetPubKeys ¶
func (tx StdTx) GetPubKeys() ([]cryptotypes.PubKey, error)
GetPubkeys returns the pubkeys of signers if the pubkey is included in the signature If pubkey is not included in the signature, then nil is in the slice instead
func (StdTx) GetSignatures ¶
GetSignatures returns the signature of signers who signed the Msg. CONTRACT: Length returned is same as length of pubkeys returned from MsgKeySigners, and the order matches. CONTRACT: If the signature is missing (ie the Msg is invalid), then the corresponding signature is .Empty().
func (StdTx) GetSignaturesV2 ¶
func (tx StdTx) GetSignaturesV2() ([]signing.SignatureV2, error)
GetSignaturesV2 implements SigVerifiableTx.GetSignaturesV2
func (StdTx) GetSigners ¶
func (tx StdTx) GetSigners() []sdk.AccAddress
GetSigners returns the addresses that must sign the transaction. Addresses are returned in a deterministic order. They are accumulated from the GetSigners method for each Msg in the order they appear in tx.GetMsgs(). Duplicate addresses will be omitted.
func (StdTx) GetTimeoutHeight ¶
GetTimeoutHeight returns the transaction's timeout height (if set).
func (StdTx) UnpackInterfaces ¶
func (tx StdTx) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
func (StdTx) ValidateBasic ¶
ValidateBasic does a simple and lightweight validation check that doesn't require access to any other information.
type StdTxBuilder ¶
type StdTxBuilder struct { StdTx // contains filtered or unexported fields }
StdTxBuilder wraps StdTx to implement to the context.TxBuilder interface. Note that this type just exists for backwards compatibility with amino StdTx and will not work for protobuf transactions.
func (*StdTxBuilder) GetTx ¶
func (s *StdTxBuilder) GetTx() authsigning.Tx
GetTx implements TxBuilder.GetTx
func (*StdTxBuilder) SetFeeAmount ¶
func (s *StdTxBuilder) SetFeeAmount(amount sdk.Coins)
func (*StdTxBuilder) SetFeeGranter ¶ added in v0.43.0
func (s *StdTxBuilder) SetFeeGranter(_ sdk.AccAddress)
SetFeeGranter does nothing for stdtx
func (*StdTxBuilder) SetGasLimit ¶
func (s *StdTxBuilder) SetGasLimit(limit uint64)
func (*StdTxBuilder) SetMemo ¶
func (s *StdTxBuilder) SetMemo(memo string)
SetMemo implements TxBuilder.SetMemo
func (*StdTxBuilder) SetMsgs ¶
func (s *StdTxBuilder) SetMsgs(msgs ...sdk.Msg) error
SetMsgs implements TxBuilder.SetMsgs
func (*StdTxBuilder) SetSignatures ¶
func (s *StdTxBuilder) SetSignatures(signatures ...signing.SignatureV2) error
SetSignatures implements TxBuilder.SetSignatures.
func (*StdTxBuilder) SetTimeoutHeight ¶
func (s *StdTxBuilder) SetTimeoutHeight(height uint64)
SetTimeoutHeight sets the transaction's height timeout.
type StdTxConfig ¶
type StdTxConfig struct {
Cdc *codec.LegacyAmino
}
StdTxConfig is a context.TxConfig for StdTx
func (StdTxConfig) MarshalSignatureJSON ¶
func (s StdTxConfig) MarshalSignatureJSON(sigs []signing.SignatureV2) ([]byte, error)
func (StdTxConfig) NewTxBuilder ¶
func (s StdTxConfig) NewTxBuilder() client.TxBuilder
NewTxBuilder implements TxConfig.NewTxBuilder
func (StdTxConfig) SignModeHandler ¶
func (s StdTxConfig) SignModeHandler() authsigning.SignModeHandler
func (StdTxConfig) TxDecoder ¶
func (s StdTxConfig) TxDecoder() sdk.TxDecoder
func (StdTxConfig) TxEncoder ¶
func (s StdTxConfig) TxEncoder() sdk.TxEncoder
MarshalTx implements TxConfig.MarshalTx
func (StdTxConfig) TxJSONDecoder ¶
func (s StdTxConfig) TxJSONDecoder() sdk.TxDecoder
func (StdTxConfig) TxJSONEncoder ¶
func (s StdTxConfig) TxJSONEncoder() sdk.TxEncoder
func (StdTxConfig) UnmarshalSignatureJSON ¶
func (s StdTxConfig) UnmarshalSignatureJSON(bz []byte) ([]signing.SignatureV2, error)
func (StdTxConfig) WrapTxBuilder ¶
WrapTxBuilder returns a StdTxBuilder from provided transaction
type Unmarshaler ¶
Unmarshaler is a generic type for Unmarshal functions