ethereumv2

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package ethereumv2 provides interfaces to interact with the Ethereum compatible blockchains. It is intended to replace the ethereum package. After the ethereum package is removed, this package will be renamed to ethereum.

For now, there is only one implementation of the rpcclient, but in the future, there may be a need for specific implementations for different L2s. The same may be true for rpcsplitter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// BlockNumber performs eth_blockNumber RPC call.
	//
	// It returns the current block number.
	BlockNumber(ctx context.Context) (uint64, error)
	// BlockByNumber performs eth_getBlockByNumber RPC call.
	//
	// It returns the block with the given number.
	BlockByNumber(ctx context.Context, number types.BlockNumber) (*types.BlockTxHashes, error)
	// FullBlockByNumber performs eth_getBlockByNumber RPC call.
	//
	// It returns the block with the given number along with all transactions.
	FullBlockByNumber(ctx context.Context, number types.BlockNumber) (*types.BlockTxObjects, error)
	// GetTransactionCount performs eth_getTransactionCount RPC call.
	//
	// It returns the number of transactions sent from the given address.
	GetTransactionCount(ctx context.Context, account types.Address, block types.BlockNumber) (uint64, error)
	// SendRawTransaction performs eth_sendRawTransaction RPC call.
	//
	// It sends an encoded transaction to the network.
	SendRawTransaction(ctx context.Context, data types.Bytes) (*types.Hash, error)
	// GetStorageAt performs eth_getStorageAt RPC call.
	//
	// It returns the value of key in the contract storage at the given
	// address.
	GetStorageAt(ctx context.Context, acc types.Address, key types.Hash, block types.BlockNumber) (*types.Hash, error)
	// FilterLogs performs eth_getLogs RPC call.
	//
	// FilterLogs returns logs that match the given query.
	FilterLogs(ctx context.Context, q types.FilterLogsQuery) ([]types.Log, error)
}

Client is a lightweight Ethereum RPC.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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