rpc

package
v0.0.0-...-d1cf31c Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EthBlockChainRPCWithRetry

type EthBlockChainRPCWithRetry struct {
	*ethclient.Client
	// contains filtered or unexported fields
}

func NewEthRPCWithRetry

func NewEthRPCWithRetry(api string, maxRetryCount int) (*EthBlockChainRPCWithRetry, error)

func (EthBlockChainRPCWithRetry) BlockByHash

func (rpc EthBlockChainRPCWithRetry) BlockByHash(ctx context.Context, hash common.Hash) (block *types.Block, err error)

func (EthBlockChainRPCWithRetry) BlockByNumber

func (rpc EthBlockChainRPCWithRetry) BlockByNumber(ctx context.Context, number *big.Int) (rst *types.Block, err error)

func (EthBlockChainRPCWithRetry) BlockNumber

func (rpc EthBlockChainRPCWithRetry) BlockNumber(ctx context.Context) (rst uint64, err error)

func (EthBlockChainRPCWithRetry) FilterLogs

func (rpc EthBlockChainRPCWithRetry) FilterLogs(ctx context.Context, query ethereum.FilterQuery) (rst []types.Log, err error)

func (EthBlockChainRPCWithRetry) HeaderByNumber

func (rpc EthBlockChainRPCWithRetry) HeaderByNumber(ctx context.Context, number *big.Int) (rst *types.Header, err error)

func (EthBlockChainRPCWithRetry) TransactionReceipt

func (rpc EthBlockChainRPCWithRetry) TransactionReceipt(ctx context.Context, txHash common.Hash) (rst *types.Receipt, err error)

type IBlockChainRPC

type IBlockChainRPC interface {
	BlockNumber(ctx context.Context) (uint64, error)
	BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
	HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
	TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
	FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
}

Jump to

Keyboard shortcuts

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