tx

package
v6.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BroadcastTx

func BroadcastTx(clientCtx client.Context, txf tx.Factory, msgs ...sdk.Msg) (*sdk.TxResponse, error)

BroadcastTx attempts to generate, sign and broadcast a transaction with the given set of messages. It will also simulate gas requirements if necessary. It will return an error upon failure.

Note, BroadcastTx is copied from the SDK except it removes a few unnecessary things like prompting for confirmation and printing the response. Instead, we return the TxResponse.

func CreateAccountFromMnemonic

func CreateAccountFromMnemonic(kb keyring.Keyring, name, mnemonic string) (*keyring.Record, error)

Types

type Client

type Client struct {
	ChainID       string
	TMRPCEndpoint string

	ClientContext *client.Context
	// contains filtered or unexported fields
}

func NewClient

func NewClient(
	chainDataDir,
	chainID,
	tmrpcEndpoint string,
	mnemonics map[string]string,
	gasAdjustment float64,
	encCfg sdkparams.EncodingConfig,
) (c *Client, err error)

Initializes a cosmos sdk client context and transaction factory for signing and broadcasting transactions by passing chainDataDir and remaining func arguments Note: For signing the transactions accounts are created by names like this val0, val1....

func (*Client) BroadcastTx

func (c *Client) BroadcastTx(msgs ...sdk.Msg) (*sdk.TxResponse, error)

func (*Client) GovParamChange

func (c *Client) GovParamChange(title, description string, changes []proposal.ParamChange, deposit sdk.Coins,
) (*sdk.TxResponse, error)

func (*Client) GovSubmitProposal

func (c *Client) GovSubmitProposal(changes []proposal.ParamChange, deposit sdk.Coins) (*sdk.TxResponse, error)

func (*Client) SenderAddr

func (c *Client) SenderAddr() sdk.AccAddress

func (*Client) TxGovVoteYesAll

func (c *Client) TxGovVoteYesAll(proposalID uint64) error

TxGovVoteYesAll creates transactions (one for each registered account) to approve a given proposal.

func (*Client) TxSend

func (c *Client) TxSend(fromAddress, toAddress string, amount sdk.Coins) (*sdk.TxResponse, error)

func (*Client) TxSubmitProposalWithMsg

func (c *Client) TxSubmitProposalWithMsg(msgs []sdk.Msg) (*sdk.TxResponse, error)

func (*Client) TxSubmitWasmContract

func (c *Client) TxSubmitWasmContract(contractPath string) (*sdk.TxResponse, error)

func (*Client) TxWasmExecuteContract

func (c *Client) TxWasmExecuteContract(contractAddr string, execMsg []byte) (*sdk.TxResponse, error)

func (*Client) TxWasmExecuteContractByAccSeq

func (c *Client) TxWasmExecuteContractByAccSeq(contractAddr string, execMsg []byte,
	accSeq uint64,
) (*sdk.TxResponse, error)

func (*Client) TxWasmInstantiateContract

func (c *Client) TxWasmInstantiateContract(storeCode uint64, initMsg []byte) (*sdk.TxResponse, error)

func (*Client) WithAccSeq

func (c *Client) WithAccSeq(seq uint64) *Client

func (*Client) WithAsyncBlock

func (c *Client) WithAsyncBlock() *Client

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL