modules

package
v0.6.35 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: GPL-3.0 Imports: 6 Imported by: 3

Documentation

Overview

Package modules provides standard interfaces for extending the Client and Bundler packages with middleware.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchHandlerCtx

type BatchHandlerCtx struct {
	Batch          []*userop.UserOperation
	PendingRemoval []*userop.UserOperation
	EntryPoint     common.Address
	ChainID        *big.Int
	BaseFee        *big.Int
	Tip            *big.Int
	GasPrice       *big.Int
	Data           map[string]any
}

BatchHandlerCtx is the object passed to BatchHandler functions during the Bundler's Run process. It also contains a Data field for adding arbitrary key-value pairs to the context. These values will be logged by the Bundler at the end of each run.

func NewBatchHandlerContext

func NewBatchHandlerContext(
	batch []*userop.UserOperation,
	entryPoint common.Address,
	chainID *big.Int,
	baseFee *big.Int,
	tip *big.Int,
	gasPrice *big.Int,
) *BatchHandlerCtx

NewBatchHandlerContext creates a new BatchHandlerCtx using a copy of the given batch.

func (*BatchHandlerCtx) MarkOpIndexForRemoval

func (c *BatchHandlerCtx) MarkOpIndexForRemoval(index int)

MarkOpIndexForRemoval will remove the op by index from the batch and add it to the pending removal array. This should be used for ops that are not to be included on-chain and dropped from the mempool.

type BatchHandlerFunc

type BatchHandlerFunc func(ctx *BatchHandlerCtx) error

BatchHandlerFunc is an interface to support modular processing of UserOperation batches by the Bundler.

func ComposeBatchHandlerFunc

func ComposeBatchHandlerFunc(fns ...BatchHandlerFunc) BatchHandlerFunc

ComposeBatchHandlerFunc combines many BatchHandlers into one.

type UserOpHandlerCtx

type UserOpHandlerCtx struct {
	UserOp     *userop.UserOperation
	EntryPoint common.Address
	ChainID    *big.Int
	// contains filtered or unexported fields
}

UserOpHandlerCtx is the object passed to UserOpHandler functions during the Client's SendUserOperation process.

func NewUserOpHandlerContext

func NewUserOpHandlerContext(
	op *userop.UserOperation,
	entryPoint common.Address,
	chainID *big.Int,
	mem *mempool.Mempool,
	gs stake.GetStakeFunc,
) (*UserOpHandlerCtx, error)

NewUserOpHandlerContext creates a new UserOpHandlerCtx using a given op.

func (*UserOpHandlerCtx) GetFactoryDepositInfo added in v0.6.33

func (c *UserOpHandlerCtx) GetFactoryDepositInfo() *entrypoint.IStakeManagerDepositInfo

GetFactoryDepositInfo returns the current EntryPoint deposit for the factory.

func (*UserOpHandlerCtx) GetPaymasterDepositInfo added in v0.6.33

func (c *UserOpHandlerCtx) GetPaymasterDepositInfo() *entrypoint.IStakeManagerDepositInfo

GetPaymasterDepositInfo returns the current EntryPoint deposit for the paymaster.

func (*UserOpHandlerCtx) GetPendingFactoryOps added in v0.6.33

func (c *UserOpHandlerCtx) GetPendingFactoryOps() []*userop.UserOperation

GetPendingFactoryOps returns all pending UserOperations in the mempool by the same factory.

func (*UserOpHandlerCtx) GetPendingPaymasterOps added in v0.6.33

func (c *UserOpHandlerCtx) GetPendingPaymasterOps() []*userop.UserOperation

GetPendingPaymasterOps returns all pending UserOperations in the mempool by the same paymaster.

func (*UserOpHandlerCtx) GetPendingSenderOps added in v0.6.33

func (c *UserOpHandlerCtx) GetPendingSenderOps() []*userop.UserOperation

GetPendingSenderOps returns all pending UserOperations in the mempool by the same sender.

func (*UserOpHandlerCtx) GetSenderDepositInfo added in v0.6.33

func (c *UserOpHandlerCtx) GetSenderDepositInfo() *entrypoint.IStakeManagerDepositInfo

GetSenderDepositInfo returns the current EntryPoint deposit for the sender.

type UserOpHandlerFunc

type UserOpHandlerFunc func(ctx *UserOpHandlerCtx) error

OpHandlerFunc is an interface to support modular processing of single UserOperations by the Client.

func ComposeUserOpHandlerFunc

func ComposeUserOpHandlerFunc(fns ...UserOpHandlerFunc) UserOpHandlerFunc

ComposeUserOpHandlerFunc combines many UserOpHandlers into one.

Directories

Path Synopsis
Package builder implements a module for bundlers to act as MEV searchers and send batches to the EntryPoint via a Block Builder API that supports eth_sendBundle.
Package builder implements a module for bundlers to act as MEV searchers and send batches to the EntryPoint via a Block Builder API that supports eth_sendBundle.
Package checks implements modules for running an array of standard validations for both the Client and Bundler.
Package checks implements modules for running an array of standard validations for both the Client and Bundler.
Package entities implements modules for reputation scoring and throttling/banning of entities as specified in EIP-4337.
Package entities implements modules for reputation scoring and throttling/banning of entities as specified in EIP-4337.
Package noop implements basic no-operation modules which are used by default for both Client and Bundler.
Package noop implements basic no-operation modules which are used by default for both Client and Bundler.
Package relay implements a module for private bundlers to send batches to the EntryPoint through regular EOA transactions.
Package relay implements a module for private bundlers to send batches to the EntryPoint through regular EOA transactions.

Jump to

Keyboard shortcuts

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