client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Callback

func Callback(ctx context.Context, d time.Duration, fn func() error)

Callback execute the callback for each time duration.

Types

type Client

type Client struct {
	cosmosclient.Client
}

Client gex client.

func New

func New(ctx context.Context, host string) (Client, error)

New creates a new Client.

func (Client) BlockCallback

func (c Client) BlockCallback(ctx context.Context, fn func(height int64) error)

BlockCallback execute the callback for each new block.

func (Client) ConsensusParams

func (c Client) ConsensusParams(ctx context.Context, fn func(coretypes.ResultConsensusParams) error)

ConsensusParams fetch the consensus parameters for each new block.

func (Client) Health

func (c Client) Health(ctx context.Context, fn func(*coretypes.ResultHealth, error) error)

Health fetch the health information for each new block.

func (Client) NetInfo

func (c Client) NetInfo(ctx context.Context, fn func(coretypes.ResultNetInfo) error)

NetInfo fetch the network information for each new block.

func (Client) NewBlock

func (c Client) NewBlock(ctx context.Context, fn func(types.EventDataNewBlock) error) error

NewBlock listen the new block event from the websocket subscriber.

func (Client) NewRoundStep

func (c Client) NewRoundStep(ctx context.Context, fn func(types.EventDataRoundState) error) error

NewRoundStep listen the new round step event from the websocket subscriber.

func (Client) Subscribe

func (c Client) Subscribe(ctx context.Context, subscriber, query string, fn func(coretypes.ResultEvent) error) error

Subscribe listen websocket events based in the query.

func (Client) Tx

func (c Client) Tx(ctx context.Context, fn func(types.EventDataTx) error) error

Tx listen the new transaction event from the websocket subscriber.

func (Client) Validators

func (c Client) Validators(ctx context.Context, fn func(coretypes.ResultValidators) error)

Validators fetch the validators information for each new block.

Jump to

Keyboard shortcuts

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