modules

package
v0.6.0-rc.9 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: GPL-3.0 Imports: 5 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
	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,
) *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,
	pendingOps []*userop.UserOperation,
	entryPoint common.Address,
	chainID *big.Int,
) *UserOpHandlerCtx

NewUserOpHandlerContext creates a new UserOpHandlerCtx using a given op.

func (*UserOpHandlerCtx) AddDepositInfo added in v0.1.1

func (c *UserOpHandlerCtx) AddDepositInfo(entity common.Address, dep *entrypoint.IStakeManagerDepositInfo)

AddDepositInfo adds any entity's EntryPoint stake info to the current context.

func (*UserOpHandlerCtx) GetDepositInfo added in v0.1.1

GetDepositInfo retrieves any entity's EntryPoint stake info from the current context if it was previously added. Otherwise returns nil

func (*UserOpHandlerCtx) GetPendingOps added in v0.1.1

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

GetPendingOps returns all pending UserOperations in the mempool by the same UserOp.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 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 paymaster implements modules for reputation scoring and throttling/banning for paymasters as specified in EIP-4337.
Package paymaster implements modules for reputation scoring and throttling/banning for paymasters as specified in EIP-4337.
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