Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
UserOp struct {
EventScan UserOpEventScanConfig
}
}
type Sponsorship ¶
type Sponsorship struct {
Log types.Log
SponsoredEvent *contract.VerifyingPaymasterSponsored
UserOpEvent *account.EntryPointUserOperationEvent
UserOp *contract.PackedUserOperation // Nil when indirect call input cannot be decoded.
}
type UserOpEventParser ¶
type UserOpEventParser struct {
// contains filtered or unexported fields
}
UserOpEventParser is responsible for parsing Sponsored event and relevant data from the blockchain log.
If bundle transaction contains many user operations too frequently, it's better to add a LRU cache for the retrieved bundle transaction and receipt.
func NewUserOpEventParser ¶
func (*UserOpEventParser) Parse ¶
func (parser *UserOpEventParser) Parse(log types.Log) (*Sponsorship, error)
Parse parses a Sponsored event log and retrieves the associated user operation and its details. Indirect calls retain their events for indexing even when the raw UserOperation is unavailable.
type UserOpEventScanConfig ¶
type UserOpEventScanConfig struct {
// NextBlock is the next block number to start scanning events from, 0 means the finalized block.
NextBlock uint64
// Interval is the interval between each scan after catch-up phase.
Interval time.Duration `default:"10s"`
// contains filtered or unexported fields
}
type UserOpEventScanner ¶
type UserOpEventScanner struct {
// contains filtered or unexported fields
}
UserOpEventScanner is a worker that scans user op events from the blockchain and updates the database accordingly.
func NewUserOpEventScanner ¶
func NewUserOpEventScanner(paymaster common.Address, config UserOpEventScanConfig, client *web3go.Client, store *store.Store) (*UserOpEventScanner, error)
NewUserOpEventScanner creates a new UserOpEventScanner with the given configuration, web3 client, and store. It initializes the scanner and loads the next block number to scan from the database or configuration. It will return an error if the config is invalid or initialization fails.
func (*UserOpEventScanner) Work ¶
func (scanner *UserOpEventScanner) Work()
Work starts the scanning process for user op events. It first catches up to the latest finalized block, and then continues to scan for new events periodically.