ethereum

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockNumberFromContext deprecated added in v0.5.0

func BlockNumberFromContext(ctx context.Context) *big.Int

BlockNumberFromContext returns the block number from the context.

Deprecated: use the github.com/defiweb/go-eth package instead.

func MultiCall added in v0.10.2

func MultiCall(
	ctx context.Context,
	client rpc.RPC,
	calls []types.Call,
	blockNumber types.BlockNumber,
) ([][]byte, error)

func WithBlockNumber deprecated added in v0.5.0

func WithBlockNumber(ctx context.Context, block *big.Int) context.Context

WithBlockNumber sets the block number in the context.

Deprecated: use the github.com/defiweb/go-eth package instead.

Types

type Client deprecated

type Client interface {
	// BlockNumber returns the current block number.
	BlockNumber(ctx context.Context) (*big.Int, error)

	// Block returns the block data. The block number can be changed by using
	// the WithBlockNumber context.
	Block(ctx context.Context) (*types.Block, error)

	// Call executes a message call transaction, which is directly
	// executed in the VM of the node, but never mined into the blockchain.
	Call(ctx context.Context, call types.Call) ([]byte, error)

	// CallBlocks executes the same call on multiple blocks (counting back from the latest)
	// and returns multiple results in a slice
	CallBlocks(ctx context.Context, call types.Call, blocks []int64) ([][]byte, error)

	// MultiCall works like the Call function but allows to execute multiple
	// calls at once.
	MultiCall(ctx context.Context, calls []types.Call) ([][]byte, error)

	// Storage returns the value of key in the contract storage of the
	// given account.
	Storage(ctx context.Context, address types.Address, key types.Hash) ([]byte, error)

	// Balance returns the wei balance of the given account.
	Balance(ctx context.Context, address types.Address) (*big.Int, error)

	// SendTransaction injects a signed transaction into the pending pool
	// for execution.
	SendTransaction(ctx context.Context, transaction *types.Transaction) (*types.Hash, error)

	// FilterLogs executes a filter query.
	FilterLogs(ctx context.Context, query types.FilterLogsQuery) ([]types.Log, error)
}

Client is an interface for Ethereum blockchain.

Deprecated: use the github.com/defiweb/go-eth package instead.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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