client

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnection

func NewConnection(
	target string,
	logger zerolog.Logger,
) (*grpc.ClientConn, error)

func UnaryClientInterceptor

func UnaryClientInterceptor(
	defaultRateLimit int,
	methodRateLimits map[string]int,
	defaultTimeout time.Duration,
	logger zerolog.Logger,
) grpc.UnaryClientInterceptor

Types

type Client

type Client interface {
	GetLatestBlockHeader(ctx context.Context, isSealed bool) (*flow.BlockHeader, error)
	ExecuteScriptAtBlockHeight(ctx context.Context, height uint64, script []byte, arguments []cadence.Value) (cadence.Value, error)
	GetBlockByHeight(ctx context.Context, height uint64) (*flow.Block, error)
	GetTransaction(ctx context.Context, txID flow.Identifier) (*flow.Transaction, error)
	GetEventsForHeightRange(ctx context.Context, query flowgrpc.EventRangeQuery) ([]flow.BlockEvents, error)
	GetCollection(ctx context.Context, colID flow.Identifier) (*flow.Collection, error)
}

func NewClientFromConnection

func NewClientFromConnection(
	conn grpc.ClientConnInterface,
) Client

type ClosableClient

type ClosableClient interface {
	Client
	io.Closer
}

func NewClient

func NewClient(
	target string,
	logger zerolog.Logger,
) (ClosableClient, error)

Jump to

Keyboard shortcuts

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