client

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: MIT Imports: 17 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResponseFormatBroadcastTxCommit added in v0.6.0

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 {
	Codec     codec.Codec
	RPCClient rpcclient.Client
	GRPCConn  *grpc.ClientConn

	AuthClient authtypes.QueryClient
	TxClient   sdktx.ServiceClient

	GasPrice      sdk.DecCoin
	GasAdjustment float64
	// contains filtered or unexported fields
}

Client represents a Cosmos client that should be used to interact with a chain

func NewClient

func NewClient(config *types.ChainConfig, codec codec.Codec) (*Client, error)

NewClient returns a new Client instance

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) (authtypes.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) GetChainID

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

GetChainID returns the chain id 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) ParseAddress

func (n *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

Jump to

Keyboard shortcuts

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