sdkclient

package
v6.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainHeightListener

type ChainHeightListener struct {
	Logger zerolog.Logger

	HeightChanged chan (int64)
	// contains filtered or unexported fields
}

ChainHeightListener is used to cache the chain height of the current node which is being updated each time the node sends an event of EventNewBlockHeader. It starts a goroutine to subscribe to blockchain new block event and update the cached height.

func NewChainHeightListener

func NewChainHeightListener(
	ctx context.Context,
	rpcClient tmrpcclient.Client,
	logger zerolog.Logger,
) (*ChainHeightListener, error)

NewChainHeight returns a new ChainHeight struct that starts a new goroutine subscribed to EventNewBlockHeader.

func (*ChainHeightListener) GetHeight

func (chainHeight *ChainHeightListener) GetHeight() (int64, error)

GetHeight returns the last chain height available.

type Client

type Client struct {
	Query *query.Client
	Tx    *tx.Client
}

Client provides basic capabilities to connect to a Cosmos SDK based chain and execute transactions and queries. The object should be extended by another struct to provide chain specific transactions and queries. Example: https://github.com/umee-network/umee/blob/main/client Accounts are generated using the list of mnemonics. Each string must be a sequence of words, eg: `["w11 w12 w13", "w21 w22 w23"]`. Keyring names for created accounts will be: val1, val2....

func NewClient

func NewClient(
	chainDataDir,
	chainID,
	tmrpcEndpoint,
	grpcEndpoint string,
	mnemonics map[string]string,
	gasAdjustment float64,
	encCfg sdkparams.EncodingConfig,
) (uc Client, err error)

func (Client) NewChainHeightListener

func (c Client) NewChainHeightListener(ctx context.Context, logger zerolog.Logger) (*ChainHeightListener, error)

func (Client) QueryTimeout

func (c Client) QueryTimeout() time.Duration

func (Client) TmClient

func (c Client) TmClient() rpcclient.Client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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