client

package
v0.0.0-...-51e039b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns not found status.

Types

type AddTokenRoundTripper

type AddTokenRoundTripper struct {
	// contains filtered or unexported fields
}

func (AddTokenRoundTripper) RoundTrip

func (rt AddTokenRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

type ClientOption

type ClientOption func(*ClientOptions)

func WithBlockHeight

func WithBlockHeight(blockHeight int64) ClientOption

type ClientOptions

type ClientOptions struct {
	// contains filtered or unexported fields
}

type ClientProxy

type ClientProxy struct {
	// contains filtered or unexported fields
}

ClientProxy is a wrapper for various clients.

func NewClientProxy

func NewClientProxy(rpcURL, rpcToken, grpcURL, grpcToken string, insecure bool) (*ClientProxy, error)

NewClientProxy creates a new Client with the given configuration.

func (*ClientProxy) Balance

func (cp *ClientProxy) Balance(ctx context.Context, address string, denom string) (sdktypes.Coin, error)

Balance returns balance of a given account for staking denom.

func (*ClientProxy) Balances

func (cp *ClientProxy) Balances(ctx context.Context, address string) (sdktypes.Coins, error)

Balances returns all balances of a given account.

func (*ClientProxy) BaseAccountInfo

func (cp *ClientProxy) BaseAccountInfo(ctx context.Context, address string) (authtypes.BaseAccount, error)

BaseAccountInfo returns base account information

func (*ClientProxy) Block

func (cp *ClientProxy) Block(ctx context.Context, height int64) (*tmctypes.ResultBlock, error)

Block returns block information for the height.

func (*ClientProxy) BroadcastTx

func (cp *ClientProxy) BroadcastTx(ctx context.Context, txBytes []byte, mode sdktx.BroadcastMode) (*tx.BroadcastTxResponse, error)

BroadcastTx broadcasts transaction.

func (*ClientProxy) Close

func (cp *ClientProxy) Close() error

Close sloses the node stop execution to the RPC and GRPC clients.

func (*ClientProxy) LatestBlockHeight

func (cp *ClientProxy) LatestBlockHeight(ctx context.Context) (int64, error)

LatestBlockHeight returns the latest block height on the network.

func (*ClientProxy) NetworkChainID

func (cp *ClientProxy) NetworkChainID(ctx context.Context) (string, error)

NetworkChainID returns network chain id.

func (*ClientProxy) Status

func (cp *ClientProxy) Status(ctx context.Context) (*tmctypes.ResultStatus, error)

Status returns the status of the blockchain network.

func (*ClientProxy) SubscribeNewBlocks

func (cp *ClientProxy) SubscribeNewBlocks(subscriber string) (<-chan tmctypes.ResultEvent, context.CancelFunc, error)

SubscribeNewBlocks subscribes to the new block event handler through the RPC client with the given subscriber name. An receiving only channel, context cancel function and an error is returned. It is up to the caller to cancel the context and handle any errors appropriately.

Jump to

Keyboard shortcuts

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