tx

package
v4.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 15 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(name, mnemonic string) (*keyring.Record, keyring.Keyring, error)

Types

type Client

type Client struct {
	ChainID       string
	TMRPCEndpoint string

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

func NewTxClient

func NewTxClient(
	chainID string,
	tmrpcEndpoint string,
	accountName string,
	accountMnemonic string,
) (c *Client, err error)

Initializes a cosmos sdk client context and transaction factory for signing and broadcasting transactions

func (*Client) BroadcastTx

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

func (*Client) TxSend

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

func (*Client) TxSubmitProposal

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

func (*Client) TxVoteYes

func (c *Client) TxVoteYes(proposalID uint64) (*sdk.TxResponse, error)

Jump to

Keyboard shortcuts

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