Documentation ¶
Index ¶
- func NewResponseFormatBroadcastTxCommit(res *coretypes.ResultBroadcastTxCommit) *sdk.TxResponse
- type Client
- func (c *Client) BroadcastTxAsync(tx signing.Tx) (*sdk.TxResponse, error)
- func (c *Client) BroadcastTxCommit(tx signing.Tx) (*sdk.TxResponse, error)
- func (c *Client) BroadcastTxSync(tx signing.Tx) (*sdk.TxResponse, error)
- func (c *Client) GetAccount(address string) (sdk.AccountI, error)
- func (c *Client) GetAccountPrefix() string
- func (c *Client) GetBalances(address string) (sdk.Coins, error)
- func (c *Client) GetChainID() (string, error)
- func (c *Client) GetCodec() codec.Codec
- func (c *Client) GetFeeDenom() string
- func (c *Client) GetFees(gas int64) sdk.Coins
- func (c *Client) GetGRPConn() grpc.ClientConnInterface
- func (c *Client) GetRPCClient() rpcclient.Client
- func (c *Client) GetTxConfig() sdkclient.TxConfig
- func (c *Client) ParseAddress(address string) (sdk.AccAddress, error)
- func (c *Client) SimulateTx(tx signing.Tx) (uint64, error)
- func (c *Client) WithGasAdjustment(gasAdjustment float64) *Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewResponseFormatBroadcastTxCommit ¶
func NewResponseFormatBroadcastTxCommit(res *coretypes.ResultBroadcastTxCommit) *sdk.TxResponse
NewResponseFormatBroadcastTxCommit returns a TxResponse given a ResultBroadcastTxCommit from tendermint. Note: This is a backport from Cosmos SDK v0.45.x since it was removed inside Cosmos SDK v0.47.x
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a Cosmos client that should be used to interact with a chain
func NewClient ¶
func NewClient( bech32Prefix string, gasPrice sdk.DecCoin, rpcClient *rpchttp.HTTP, grpcConn grpc.ClientConnInterface, txConfig sdkclient.TxConfig, codec codec.Codec, ) *Client
NewClient allows to build a new Client instance
func NewClientFromConfig ¶
func NewClientFromConfig(config *types.ChainConfig, txConfig sdkclient.TxConfig, codec codec.Codec) (*Client, error)
NewClientFromConfig returns a new Client instance based on the given configuration
func (*Client) BroadcastTxAsync ¶
BroadcastTxAsync allows to broadcast a transaction containing the given messages using the sync method
func (*Client) BroadcastTxCommit ¶
BroadcastTxCommit allows to broadcast a transaction containing the given messages using the commit method
func (*Client) BroadcastTxSync ¶
BroadcastTxSync allows to broadcast a transaction containing the given messages using the sync method
func (*Client) GetAccount ¶
GetAccount returns the details of the account having the given address reading it from the chain
func (*Client) GetAccountPrefix ¶
GetAccountPrefix returns the account prefix to be used when serializing addresses as Bech32
func (*Client) GetBalances ¶
GetBalances returns the balances of the account having the given address
func (*Client) GetChainID ¶
GetChainID returns the chain id associated to this client
func (*Client) GetFeeDenom ¶
GetFeeDenom returns the denom used to pay for fees, based on the gas price inside the config
func (*Client) GetFees ¶
GetFees returns the fees that should be paid to perform a transaction with the given gas
func (*Client) GetGRPConn ¶
func (c *Client) GetGRPConn() grpc.ClientConnInterface
GetGRPConn returns the gRPC connection associated to this client
func (*Client) GetRPCClient ¶
GetRPCClient returns the RPC client associated to this client
func (*Client) GetTxConfig ¶
GetTxConfig returns the transaction configuration associated to this client
func (*Client) ParseAddress ¶
func (c *Client) ParseAddress(address string) (sdk.AccAddress, error)
ParseAddress parses the given address as an sdk.AccAddress instance
func (*Client) SimulateTx ¶
SimulateTx simulates the execution of the given transaction, and returns the adjusted amount of gas that should be used in order to properly execute it
func (*Client) WithGasAdjustment ¶
WithGasAdjustment allows to set the gas adjustment factor to be used when simulating transactions