ethclient

package
v0.13.0-rc.0-1712217157 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: GPL-3.0, LGPL-3.0 Imports: 12 Imported by: 19

Documentation

Overview

Package ethclient provides a client for the Ethereum RPC API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToBlockNumArg

func ToBlockNumArg(number *big.Int) string

Types

type Client

type Client interface {
	Client() *rpc.Client
	Close()
	ChainID(context.Context) (*big.Int, error)
	BlockByHash(context.Context, common.Hash) (*types.Block, error)
	BlockByNumber(context.Context, *big.Int) (*types.Block, error)
	BlockNumber(context.Context) (uint64, error)
	BlockReceipts(context.Context, rpc.BlockNumberOrHash) ([]*types.Receipt, error)
	HeaderByHash(context.Context, common.Hash) (*types.Header, error)
	HeaderByNumber(context.Context, *big.Int) (*types.Header, error)
	TransactionByHash(context.Context, common.Hash) (tx *types.Transaction, isPending bool, err error)
	TransactionSender(context.Context, *types.Transaction, common.Hash, uint) (common.Address, error)
	TransactionCount(context.Context, common.Hash) (uint, error)
	TransactionInBlock(context.Context, common.Hash, uint) (*types.Transaction, error)
	TransactionReceipt(context.Context, common.Hash) (*types.Receipt, error)
	SyncProgress(ctx context.Context) error
	SubscribeNewAcceptedTransactions(context.Context, chan<- *common.Hash) (interfaces.Subscription, error)
	SubscribeNewPendingTransactions(context.Context, chan<- *common.Hash) (interfaces.Subscription, error)
	SubscribeNewHead(context.Context, chan<- *types.Header) (interfaces.Subscription, error)
	NetworkID(context.Context) (*big.Int, error)
	BalanceAt(context.Context, common.Address, *big.Int) (*big.Int, error)
	AssetBalanceAt(context.Context, common.Address, ids.ID, *big.Int) (*big.Int, error)
	StorageAt(context.Context, common.Address, common.Hash, *big.Int) ([]byte, error)
	CodeAt(context.Context, common.Address, *big.Int) ([]byte, error)
	NonceAt(context.Context, common.Address, *big.Int) (uint64, error)
	FilterLogs(context.Context, interfaces.FilterQuery) ([]types.Log, error)
	SubscribeFilterLogs(context.Context, interfaces.FilterQuery, chan<- types.Log) (interfaces.Subscription, error)
	AcceptedCodeAt(context.Context, common.Address) ([]byte, error)
	AcceptedNonceAt(context.Context, common.Address) (uint64, error)
	AcceptedCallContract(context.Context, interfaces.CallMsg) ([]byte, error)
	CallContract(context.Context, interfaces.CallMsg, *big.Int) ([]byte, error)
	CallContractAtHash(ctx context.Context, msg interfaces.CallMsg, blockHash common.Hash) ([]byte, error)
	SuggestGasPrice(context.Context) (*big.Int, error)
	SuggestGasTipCap(context.Context) (*big.Int, error)
	FeeHistory(ctx context.Context, blockCount uint64, lastBlock *big.Int, rewardPercentiles []float64) (*interfaces.FeeHistory, error)
	EstimateGas(context.Context, interfaces.CallMsg) (uint64, error)
	EstimateBaseFee(context.Context) (*big.Int, error)
	SendTransaction(context.Context, *types.Transaction) error
}

Client defines interface for typed wrappers for the Ethereum RPC API.

func Dial

func Dial(rawurl string) (Client, error)

Dial connects a client to the given URL.

func DialContext

func DialContext(ctx context.Context, rawurl string) (Client, error)

DialContext connects a client to the given URL with context.

func NewClient

func NewClient(c *rpc.Client) Client

NewClient creates a client that uses the given RPC client.

Directories

Path Synopsis
Package corethclient provides an RPC client for coreth-specific APIs.
Package corethclient provides an RPC client for coreth-specific APIs.

Jump to

Keyboard shortcuts

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