PackedUserOperation
PackedUserOperation represents an ERC-4337 v0.7+ user operation with optimized field packing. Gas limits and fees are packed into bytes32 fields, reducing calldata size and lowering costs for bundlers.Quick Start
Type Definition
Field Packing
accountGasLimits (bytes32)
Packs verification and call gas limits:gasFees (bytes32)
Packs priority fee and max fee:API Reference
from
Create PackedUserOperation from parameters.hash
Compute userOpHash for signing.unpack
Convert PackedUserOperation (v0.7) to UserOperation (v0.6).Packing Implementation
Pack Gas Limits
Pack Gas Fees
Benefits Over v0.6
- Reduced calldata: Smaller operation size
- Lower gas costs: Less data to submit
- Bundler efficiency: Lower costs for bundlers
- Backward compatible: Can convert to/from v0.6
Usage Patterns
Round-trip Conversion
Direct Creation
Related Types
- PackedUserOperation (Effect) - Effect.ts integration with Schema validation
- UserOperation - v0.6 format
- EntryPoint - Entry point contract
- Paymaster - Gas sponsorship
- Bundler - Operation bundler

