client

package
v0.0.0-...-535af14 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

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

func (c *Client) BroadcastTxAsync(tx signing.Tx) (*sdk.TxResponse, error)

BroadcastTxAsync allows to broadcast a transaction containing the given messages using the sync method

func (*Client) BroadcastTxCommit

func (c *Client) BroadcastTxCommit(tx signing.Tx) (*sdk.TxResponse, error)

BroadcastTxCommit allows to broadcast a transaction containing the given messages using the commit method

func (*Client) BroadcastTxSync

func (c *Client) BroadcastTxSync(tx signing.Tx) (*sdk.TxResponse, error)

BroadcastTxSync allows to broadcast a transaction containing the given messages using the sync method

func (*Client) GetAccount

func (c *Client) GetAccount(address string) (sdk.AccountI, error)

GetAccount returns the details of the account having the given address reading it from the chain

func (*Client) GetAccountPrefix

func (c *Client) GetAccountPrefix() string

GetAccountPrefix returns the account prefix to be used when serializing addresses as Bech32

func (*Client) GetBalances

func (c *Client) GetBalances(address string) (sdk.Coins, error)

GetBalances returns the balances of the account having the given address

func (*Client) GetChainID

func (c *Client) GetChainID() (string, error)

GetChainID returns the chain id associated to this client

func (*Client) GetCodec

func (c *Client) GetCodec() codec.Codec

GetCodec returns the codec associated to this client

func (*Client) GetFeeDenom

func (c *Client) GetFeeDenom() string

GetFeeDenom returns the denom used to pay for fees, based on the gas price inside the config

func (*Client) GetFees

func (c *Client) GetFees(gas int64) sdk.Coins

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

func (c *Client) GetRPCClient() rpcclient.Client

GetRPCClient returns the RPC client associated to this client

func (*Client) GetTxConfig

func (c *Client) GetTxConfig() sdkclient.TxConfig

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

func (c *Client) SimulateTx(tx signing.Tx) (uint64, error)

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

func (c *Client) WithGasAdjustment(gasAdjustment float64) *Client

WithGasAdjustment allows to set the gas adjustment factor to be used when simulating transactions

Jump to

Keyboard shortcuts

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