client

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MIT Imports: 11 Imported by: 21

Documentation

Overview

Package client provides a client for the omnirpc service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OptionsArgsOption

type OptionsArgsOption func(options *rpcOptions)

OptionsArgsOption is an option passed into the client.

func WithCaptureReqRes added in v0.0.79

func WithCaptureReqRes() OptionsArgsOption

WithCaptureReqRes captures requests and responses.

func WithDefaultConfirmations

func WithDefaultConfirmations(confirmations int) OptionsArgsOption

WithDefaultConfirmations sets the default number of confirmations.

type RPCClient

type RPCClient interface {
	submitter.ClientFetcher
	// GetEndpoint returns the endpoint for the given chainID and confirmations.
	GetEndpoint(chainID, confirmations int) string
	// GetDefaultEndpoint returns the endpoint with the default confirmation count for the chain id.
	GetDefaultEndpoint(chainID int) string
	// GetConfirmationsClient returns a client for the given chainID and confirmations.
	// TODO: consider making confirmations iota or uint8, can be easy to confuse these params
	GetConfirmationsClient(ctx context.Context, chainID, confirmations int) (client.EVM, error)
	// GetChainClient returns a client for the given chainID.
	GetChainClient(ctx context.Context, chainID int) (client.EVM, error)
	// GetChainIDs returns all chain ids.
	GetChainIDs(ctx context.Context) ([]int, error)
}

RPCClient is an interface for the omnirpc service.

func NewOmnirpcClient

func NewOmnirpcClient(endpoint string, handler metrics.Handler, options ...OptionsArgsOption) RPCClient

NewOmnirpcClient creates a new RPCClient.

Jump to

Keyboard shortcuts

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