Documentation ¶
Index ¶
- func MakeSignature(keybase crkeys.Keybase, name, passphrase string, msg StdSignMsg) (sig auth.StdSignature, err error)
- type StdSignMsg
- type TxBuilder
- func (bldr TxBuilder) AccountNumber() uint64
- func (bldr TxBuilder) BuildAndSign(name, passphrase string, msgs []sdk.Msg) ([]byte, error)
- func (bldr TxBuilder) BuildSignMsg(msgs []sdk.Msg) (StdSignMsg, error)
- func (bldr TxBuilder) BuildTxForSim(msgs []sdk.Msg) ([]byte, error)
- func (bldr TxBuilder) ChainID() string
- func (bldr TxBuilder) Fees() sdk.Coins
- func (bldr TxBuilder) Gas() uint64
- func (bldr TxBuilder) GasAdjustment() float64
- func (bldr TxBuilder) GasPrices() sdk.DecCoins
- func (bldr TxBuilder) Keybase() crkeys.Keybase
- func (bldr TxBuilder) Memo() string
- func (bldr TxBuilder) Sequence() uint64
- func (bldr TxBuilder) Sign(name, passphrase string, msg StdSignMsg) ([]byte, error)
- func (bldr TxBuilder) SignStdTx(name, passphrase string, stdTx auth.StdTx, appendSig bool) (signedStdTx auth.StdTx, err error)
- func (bldr TxBuilder) SimulateAndExecute() bool
- func (bldr TxBuilder) TxEncoder() sdk.TxEncoder
- func (bldr TxBuilder) WithAccountNumber(accnum uint64) TxBuilder
- func (bldr TxBuilder) WithChainID(chainID string) TxBuilder
- func (bldr TxBuilder) WithFees(fees string) TxBuilder
- func (bldr TxBuilder) WithGas(gas uint64) TxBuilder
- func (bldr TxBuilder) WithGasPrices(gasPrices string) TxBuilder
- func (bldr TxBuilder) WithKeybase(keybase crkeys.Keybase) TxBuilder
- func (bldr TxBuilder) WithMemo(memo string) TxBuilder
- func (bldr TxBuilder) WithSequence(sequence uint64) TxBuilder
- func (bldr TxBuilder) WithTxEncoder(txEncoder sdk.TxEncoder) TxBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeSignature ¶
func MakeSignature(keybase crkeys.Keybase, name, passphrase string, msg StdSignMsg) (sig auth.StdSignature, err error)
MakeSignature builds a StdSignature given keybase, key name, passphrase, and a StdSignMsg.
Types ¶
type StdSignMsg ¶
type StdSignMsg struct { ChainID string `json:"chain_id"` AccountNumber uint64 `json:"account_number"` Sequence uint64 `json:"sequence"` Fee auth.StdFee `json:"fee"` Msgs []sdk.Msg `json:"msgs"` Memo string `json:"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.
type TxBuilder ¶
type TxBuilder struct {
// contains filtered or unexported fields
}
TxBuilder implements a transaction context created in SDK modules.
func NewTxBuilder ¶ added in v0.30.0
func NewTxBuilder( txEncoder sdk.TxEncoder, accNumber, seq, gas uint64, gasAdj float64, simulateAndExecute bool, chainID, memo string, fees sdk.Coins, gasPrices sdk.DecCoins, ) TxBuilder
NewTxBuilder returns a new initialized TxBuilder.
func NewTxBuilderFromCLI ¶
func NewTxBuilderFromCLI() TxBuilder
NewTxBuilderFromCLI returns a new initialized TxBuilder with parameters from the command line using Viper.
func (TxBuilder) AccountNumber ¶
AccountNumber returns the account number
func (TxBuilder) BuildAndSign ¶
BuildAndSign builds a single message to be signed, and signs a transaction with the built message given a name, passphrase, and a set of messages.
func (TxBuilder) BuildSignMsg ¶ added in v0.31.0
func (bldr TxBuilder) BuildSignMsg(msgs []sdk.Msg) (StdSignMsg, error)
BuildSignMsg builds a single message to be signed from a TxBuilder given a set of messages. It returns an error if a fee is supplied but cannot be parsed.
func (TxBuilder) BuildTxForSim ¶ added in v0.31.0
BuildTxForSim creates a StdSignMsg and encodes a transaction with the StdSignMsg with a single empty StdSignature for tx simulation.
func (TxBuilder) GasAdjustment ¶
GasAdjustment returns the gas adjustment
func (TxBuilder) GasPrices ¶ added in v0.31.0
GasPrices returns the gas prices set for the transaction, if any.
func (TxBuilder) Sign ¶
func (bldr TxBuilder) Sign(name, passphrase string, msg StdSignMsg) ([]byte, error)
Sign signs a transaction given a name, passphrase, and a single message to signed. An error is returned if signing fails.
func (TxBuilder) SignStdTx ¶
func (bldr TxBuilder) SignStdTx(name, passphrase string, stdTx auth.StdTx, appendSig bool) (signedStdTx auth.StdTx, err error)
SignStdTx appends a signature to a StdTx and returns a copy of a it. If append is false, it replaces the signatures already attached with the new signature.
func (TxBuilder) SimulateAndExecute ¶ added in v0.31.0
SimulateAndExecute returns the option to simulate and then execute the transaction using the gas from the simulation results
func (TxBuilder) WithAccountNumber ¶
WithAccountNumber returns a copy of the context with an account number.
func (TxBuilder) WithChainID ¶
WithChainID returns a copy of the context with an updated chainID.
func (TxBuilder) WithFees ¶ added in v0.30.0
WithFees returns a copy of the context with an updated fee.
func (TxBuilder) WithGasPrices ¶ added in v0.30.0
WithGasPrices returns a copy of the context with updated gas prices.
func (TxBuilder) WithKeybase ¶ added in v0.31.0
WithKeybase returns a copy of the context with updated keybase.
func (TxBuilder) WithSequence ¶
WithSequence returns a copy of the context with an updated sequence number.