jsonrpc

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 20 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, params ...Parameter) (execclient.Service, error)

New creates a new execution client service, connecting with a standard HTTP.

Types

type Parameter

type Parameter interface {
	// contains filtered or unexported methods
}

Parameter is the interface for service parameters.

func WithAddress

func WithAddress(address string) Parameter

WithAddress provides the address for the endpoint.

func WithLogLevel

func WithLogLevel(logLevel zerolog.Level) Parameter

WithLogLevel sets the log level for the module.

func WithTimeout

func WithTimeout(timeout time.Duration) Parameter

WithTimeout sets the maximum duration for all requests to the endpoint.

func WithWebSocketAddress added in v0.6.0

func WithWebSocketAddress(address string) Parameter

WithWebSocketAddress provides the address for the websocket endpoint. If not supplied it will use the value supplied as the address.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is an Ethereum execution client service.

func (*Service) Address

func (s *Service) Address() string

Address provides the address for the connection.

func (*Service) Balance added in v0.7.0

func (s *Service) Balance(ctx context.Context, address types.Address, blockID string) (*big.Int, error)

Balance obtains the balance for the given address at the given block ID.

func (*Service) BaseFee added in v0.8.9

func (s *Service) BaseFee(_ context.Context,
	blockID string,
) (
	*big.Int,
	error,
)

BaseFee provides the base fee of the chain at the given block ID.

func (*Service) Block

func (s *Service) Block(ctx context.Context, blockID string) (*spec.Block, error)

Block returns the block given an ID

func (*Service) Call added in v0.8.0

func (s *Service) Call(_ context.Context, opts *execclient.CallOpts) ([]byte, error)

Call makes a call to the execution client.

func (*Service) ChainHeight

func (s *Service) ChainHeight(_ context.Context) (uint32, error)

ChainHeight returns the height of the chain as understood by the node.

func (*Service) ChainID added in v0.7.3

func (s *Service) ChainID(_ context.Context) (uint64, error)

ChainID returns the chain ID of the node.

func (*Service) EstimateGas added in v0.8.9

func (s *Service) EstimateGas(_ context.Context,
	tx *spec.TransactionSubmission,
) (
	*big.Int,
	error,
)

EstimateGas estimates the gas required for a transaction.

func (*Service) Events added in v0.3.0

Events returns the events matching the filter.

func (*Service) Issuance added in v0.2.1

func (s *Service) Issuance(ctx context.Context, blockID string) (*api.Issuance, error)

Issuance returns the issuance of a block.

func (*Service) Name

func (s *Service) Name() string

Name provides the name of the service.

func (*Service) NetworkID

func (s *Service) NetworkID(_ context.Context) (uint64, error)

NetworkID returns the network ID of the node.

func (*Service) NewPendingTransactions added in v0.6.0

func (s *Service) NewPendingTransactions(ctx context.Context, ch chan *spec.Transaction) (*util.Subscription, error)

NewPendingTransactions returns a subscription for pending transactions.

func (*Service) ReplayBlockTransactions

func (s *Service) ReplayBlockTransactions(ctx context.Context, blockID string) ([]*api.TransactionResult, error)

ReplayBlockTransactions obtains traces for all transactions in a block.

func (*Service) Syncing added in v0.2.0

func (s *Service) Syncing(_ context.Context) (*api.SyncState, error)

Syncing obtains information about the sync state of the node.

func (*Service) Transaction added in v0.6.0

func (s *Service) Transaction(_ context.Context, hash types.Hash) (*spec.Transaction, error)

Transaction returns the transaction for the given transaction hash.

func (*Service) TransactionInBlock added in v0.7.6

func (s *Service) TransactionInBlock(_ context.Context, blockHash types.Hash, index uint32) (*spec.Transaction, error)

TransactionInBlock returns the transaction for the given transaction in a block at the given index.

func (*Service) TransactionReceipt

func (s *Service) TransactionReceipt(_ context.Context, hash types.Hash) (*spec.TransactionReceipt, error)

TransactionReceipt returns the transaction receipt for the given transaction hash.

Jump to

Keyboard shortcuts

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