tx

package
v6.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 23 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(
	logger *log.Logger,
	chainDataDir,
	chainID,
	tmrpcEndpoint string,
	mnemonics map[string]string,
	gasAdjustment float64,
	encCfg testutil.TestEncodingConfig,
) (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) BankSend added in v6.1.0

func (c *Client) BankSend(fromIdx int, toAddress string, amount sdk.Coins) (*sdk.TxResponse, error)

BankSend creates and broadcasts bank send tx. `fromIdx` is an account index in the client keyring.

func (*Client) BroadcastTx

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

Broadcasts transaction. On success, increments the client sequence number.

func (*Client) GetAccSeq added in v6.4.0

func (c *Client) GetAccSeq() uint64

func (*Client) GovParamChange

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

func (*Client) GovSubmitParamProposal added in v6.1.0

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

func (*Client) GovSubmitProposal

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

func (*Client) GovVoteAllYes added in v6.1.0

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

GovVoteAllYes creates transactions (one for each account in the keyring) to approve a given proposal.

func (*Client) IncAccSeq added in v6.4.0

func (c *Client) IncAccSeq()

func (*Client) KeyringAddress added in v6.1.0

func (c *Client) KeyringAddress(idx int) sdk.AccAddress

Returns account address stored at give index

func (*Client) SenderAddr

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

func (*Client) SetAccSeq added in v6.3.0

func (c *Client) SetAccSeq(seq uint64)

func (*Client) WasmDeployContract added in v6.1.0

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

func (*Client) WasmExecContractWithAccSeq added in v6.1.0

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

func (*Client) WasmExecuteContract added in v6.1.0

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

func (*Client) WasmInitContract added in v6.1.0

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

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