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) BroadcastTx(msgs ...sdk.Msg) (*sdk.TxResponse, error)
- func (c *Client) GovParamChange(title, description string, changes []proposal.ParamChange, deposit sdk.Coins) (*sdk.TxResponse, error)
- func (c *Client) GovSubmitProposal(changes []proposal.ParamChange, deposit sdk.Coins) (*sdk.TxResponse, error)
- func (c *Client) SenderAddr() sdk.AccAddress
- func (c *Client) TxGovVoteYesAll(proposalID uint64) error
- func (c *Client) TxSend(fromAddress, toAddress string, amount sdk.Coins) (*sdk.TxResponse, error)
- func (c *Client) TxSubmitProposalWithMsg(msgs []sdk.Msg) (*sdk.TxResponse, error)
- func (c *Client) TxSubmitWasmContract(contractPath string) (*sdk.TxResponse, error)
- func (c *Client) TxWasmExecuteContract(contractAddr string, execMsg []byte) (*sdk.TxResponse, error)
- func (c *Client) TxWasmExecuteContractByAccSeq(contractAddr string, execMsg []byte, accSeq uint64) (*sdk.TxResponse, error)
- func (c *Client) TxWasmInstantiateContract(storeCode uint64, initMsg []byte) (*sdk.TxResponse, error)
- func (c *Client) WithAccSeq(seq uint64) *Client
- 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( 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 (*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 ¶
TxGovVoteYesAll creates transactions (one for each registered account) to approve a given proposal.
func (*Client) TxSubmitProposalWithMsg ¶
func (*Client) TxSubmitWasmContract ¶
func (c *Client) TxSubmitWasmContract(contractPath string) (*sdk.TxResponse, error)