Documentation ¶
Index ¶
- func BroadcastTx(clientCtx client.Context, txf tx.Factory, msgs ...sdk.Msg) (*sdk.TxResponse, error)
- func CreateAccountFromMnemonic(kb keyring.Keyring, name, mnemonic string) (*keyring.Record, error)
- type Client
- func (c *Client) BankSend(fromIdx int, toAddress string, amount sdk.Coins) (*sdk.TxResponse, error)
- func (c *Client) BroadcastTx(idx int, msgs ...sdk.Msg) (*sdk.TxResponse, error)
- func (c *Client) GetAccSeq() uint64
- func (c *Client) GovParamChange(title, description string, changes []proposal.ParamChange, deposit sdk.Coins) (*sdk.TxResponse, error)
- func (c *Client) GovSubmitParamProposal(changes []proposal.ParamChange, deposit sdk.Coins) (*sdk.TxResponse, error)
- func (c *Client) GovSubmitProposal(msgs []sdk.Msg) (*sdk.TxResponse, error)
- func (c *Client) GovVoteAllYes(proposalID uint64) error
- func (c *Client) IncAccSeq()
- func (c *Client) KeyringAddress(idx int) sdk.AccAddress
- func (c *Client) SenderAddr() sdk.AccAddress
- func (c *Client) SetAccSeq(seq uint64)
- func (c *Client) WasmDeployContract(contractPath string) (*sdk.TxResponse, error)
- func (c *Client) WasmExecContractWithAccSeq(contractAddr string, execMsg []byte, accSeq uint64) (*sdk.TxResponse, error)
- func (c *Client) WasmExecuteContract(contractAddr string, execMsg []byte) (*sdk.TxResponse, error)
- func (c *Client) WasmInitContract(storeCode uint64, initMsg []byte) (*sdk.TxResponse, error)
- func (c *Client) WithAsyncBlock() *Client
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.
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
BankSend creates and broadcasts bank send tx. `fromIdx` is an account index in the client keyring.
func (*Client) BroadcastTx ¶
Broadcasts transaction. On success, increments the client sequence number.
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 (*Client) GovVoteAllYes ¶ added in v6.1.0
GovVoteAllYes creates transactions (one for each account in the keyring) to approve a given proposal.
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) WasmDeployContract ¶ added in v6.1.0
func (c *Client) WasmDeployContract(contractPath string) (*sdk.TxResponse, error)