Title
Add middleware for UserOperation lifecycle management
Labels
enhancement, account-abstraction, middleware, ux
Description
Create middleware to automate the complete UserOperation workflow, making it as easy to use as regular transactions.
Requirements
UserOperation Builder
Nonce Management
Gas Management
Signing Middleware
Submission & Confirmation
Complete Workflow Chain
Error Recovery
File Structure
src/account_abstraction/middleware/
├── builder.zig # UserOperation builder
├── nonce.zig # Nonce management
├── gas.zig # Gas estimation
├── signer.zig # Signing
├── submission.zig # Submission & confirmation
└── root.zig # Combined middleware
Example Usage
// Simple sponsored transaction
const aa_provider = try provider
.withSmartAccount(my_account)
.withPaymaster(pimlico);
// Send like a normal transaction!
const receipt = try aa_provider.sendTransaction(.{
.to = recipient,
.value = @as(u256, 1_000_000_000_000_000_000), // 1 ETH
.data = &[_]u8{},
});
std.debug.print("✅ Gasless transaction confirmed!\n", .{});
std.debug.print(" Hash: {}\n", .{receipt.userOpHash});
std.debug.print(" Gas paid by: {}\n", .{receipt.paymaster.?});
References
Title
Add middleware for UserOperation lifecycle management
Labels
enhancement,account-abstraction,middleware,uxDescription
Create middleware to automate the complete UserOperation workflow, making it as easy to use as regular transactions.
Requirements
UserOperation Builder
Nonce Management
UserOpNonceMiddleware:Gas Management
UserOpGasMiddleware:Signing Middleware
UserOpSignerMiddleware:Submission & Confirmation
UserOpSubmissionMiddleware:waitForUserOperation(hash: Hash, timeout_ms: u64) UserOperationReceiptComplete Workflow Chain
Error Recovery
File Structure
Example Usage
References