Documentation ¶
Index ¶
- func MakeSignature(name, passphrase string, msg StdSignMsg) (sig auth.StdSignature, err error)
- type StdSignMsg
- type TxBuilder
- func (bldr TxBuilder) Build(msgs []sdk.Msg) (StdSignMsg, error)
- func (bldr TxBuilder) BuildAndSign(name, passphrase string, msgs []sdk.Msg) ([]byte, error)
- func (bldr TxBuilder) BuildWithPubKey(name string, msgs []sdk.Msg) ([]byte, error)
- 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) WithAccountNumber(accnum int64) TxBuilder
- func (bldr TxBuilder) WithChainID(chainID string) TxBuilder
- func (bldr TxBuilder) WithCodec(cdc *codec.Codec) TxBuilder
- func (bldr TxBuilder) WithMemo(memo string) TxBuilder
- func (bldr TxBuilder) WithSequence(sequence int64) TxBuilder
- func (bldr TxBuilder) WithSource(source int64) TxBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeSignature ¶
func MakeSignature(name, passphrase string, msg StdSignMsg) (sig auth.StdSignature, err error)
MakeSignature builds a StdSignature given key name, passphrase, and a StdSignMsg.
Types ¶
type StdSignMsg ¶
type StdSignMsg struct { ChainID string `json:"chain_id"` AccountNumber int64 `json:"account_number"` Sequence int64 `json:"sequence"` Msgs []sdk.Msg `json:"msgs"` Memo string `json:"memo"` Source int64 `json:"source"` Data []byte `json:"data"` }
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 { Codec *codec.Codec AccountNumber int64 Sequence int64 ChainID string Memo string Source int64 }
TxBuilder implements a transaction context created in SDK modules.
func NewTxBuilderFromCLI ¶
func NewTxBuilderFromCLI() TxBuilder
NewTxBuilderFromCLI returns a new initialized TxBuilder with parameters from the command line using Viper.
func (TxBuilder) Build ¶
func (bldr TxBuilder) Build(msgs []sdk.Msg) (StdSignMsg, error)
Build builds a single message to be signed from a TxBuilder given a set of messages.
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) BuildWithPubKey ¶
BuildWithPubKey builds a single message to be signed from a TxBuilder given a set of messages and attach the public key associated to the given name.
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) 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) WithSequence ¶
WithSequence returns a copy of the context with an updated sequence number.
func (TxBuilder) WithSource ¶
WithSource returns a copy of the context with an updated source.