execution

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client handles standard JSON-RPC calls for wallet/transaction operations. Only needed when lifecycle management is enabled.

func NewClient

func NewClient(ctx context.Context, rpcURL string, log logrus.FieldLogger) (*Client, error)

NewClient creates a new standard EL JSON-RPC client (no JWT).

func (*Client) Close

func (c *Client) Close()

Close closes the RPC connections.

func (*Client) EstimateGas

func (c *Client) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)

EstimateGas estimates gas for a transaction.

func (*Client) EthClient

func (c *Client) EthClient() *ethclient.Client

EthClient returns the underlying ethclient.Client for direct operations.

func (*Client) GetBalance

func (c *Client) GetBalance(ctx context.Context, address common.Address) (*big.Int, error)

GetBalance returns the balance for an address.

func (*Client) GetBlockByHash

func (c *Client) GetBlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)

GetBlockByHash returns a block by hash.

func (*Client) GetBlockByNumber

func (c *Client) GetBlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)

GetBlockByNumber returns a block by number.

func (*Client) GetChainID

func (c *Client) GetChainID(ctx context.Context) (*big.Int, error)

GetChainID returns the chain ID.

func (*Client) GetConfirmedNonce

func (c *Client) GetConfirmedNonce(ctx context.Context, address common.Address) (uint64, error)

GetConfirmedNonce returns the account nonce at the latest block (state at head, excluding the mempool). It is reliable even on clients whose "pending" nonce is buggy: ethrex has been observed returning a pending nonce *below* the latest one, which would otherwise cause us to build an already-used ("too low") nonce.

func (*Client) GetLatestBlock

func (c *Client) GetLatestBlock(ctx context.Context) (*types.Block, error)

GetLatestBlock returns the latest block.

func (*Client) GetNonce

func (c *Client) GetNonce(ctx context.Context, address common.Address) (uint64, error)

GetNonce returns the pending nonce for an address (includes mempool txs).

func (*Client) GetStorageAt

func (c *Client) GetStorageAt(
	ctx context.Context,
	account common.Address,
	slot common.Hash,
) ([]byte, error)

GetStorageAt returns the raw 32-byte value stored at slot for the given account at the latest block. Used to read the EIP-7002/7251/8282 system-contract queue excess (slot 0) for queue-fee calculation.

func (*Client) GetTransactionReceipt

func (c *Client) GetTransactionReceipt(
	ctx context.Context,
	txHash common.Hash,
) (*types.Receipt, error)

GetTransactionReceipt returns the receipt for a transaction.

func (*Client) HeaderByNumber

func (c *Client) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)

HeaderByNumber returns the header for a block number.

func (*Client) IsTxKnown

func (c *Client) IsTxKnown(ctx context.Context, txHash common.Hash) (bool, error)

IsTxKnown reports whether the node currently knows the transaction (pending in the mempool or already mined). Returns false (without error) when the tx is unknown. This lets callers reason about transaction acceptance from node state rather than by parsing client-specific send error strings.

func (*Client) SendTransaction

func (c *Client) SendTransaction(ctx context.Context, tx *types.Transaction) error

SendTransaction sends a signed transaction.

func (*Client) SuggestGasPrice

func (c *Client) SuggestGasPrice(ctx context.Context) (*big.Int, error)

SuggestGasPrice returns the suggested gas price.

func (*Client) SuggestGasTipCap

func (c *Client) SuggestGasTipCap(ctx context.Context) (*big.Int, error)

SuggestGasTipCap returns the suggested gas tip cap (priority fee).

Jump to

Keyboard shortcuts

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