@pimlico/alto 0.0.0-main.20241218T163308 → 0.0.0-main.20241219T215029

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/esm/cli/config/bundler.d.ts +26 -20
  2. package/esm/cli/config/bundler.js +2 -1
  3. package/esm/cli/config/bundler.js.map +1 -1
  4. package/esm/cli/config/options.js +5 -0
  5. package/esm/cli/config/options.js.map +1 -1
  6. package/esm/cli/handler.js +2 -1
  7. package/esm/cli/handler.js.map +1 -1
  8. package/esm/cli/parseArgs.js +1 -1
  9. package/esm/cli/parseArgs.js.map +1 -1
  10. package/esm/executor/executor.js +45 -20
  11. package/esm/executor/executor.js.map +1 -1
  12. package/esm/executor/executorManager.d.ts +1 -1
  13. package/esm/executor/types.d.ts +25 -0
  14. package/esm/executor/types.js +2 -0
  15. package/esm/executor/types.js.map +1 -0
  16. package/esm/executor/utils.d.ts +4 -2
  17. package/esm/executor/utils.js +20 -6
  18. package/esm/executor/utils.js.map +1 -1
  19. package/esm/mempool/mempool.js +7 -1
  20. package/esm/mempool/mempool.js.map +1 -1
  21. package/esm/rpc/estimation/gasEstimationHandler.d.ts +3 -1
  22. package/esm/rpc/estimation/gasEstimationHandler.js +3 -1
  23. package/esm/rpc/estimation/gasEstimationHandler.js.map +1 -1
  24. package/esm/rpc/estimation/gasEstimationsV06.d.ts +3 -1
  25. package/esm/rpc/estimation/gasEstimationsV06.js +9 -1
  26. package/esm/rpc/estimation/gasEstimationsV06.js.map +1 -1
  27. package/esm/rpc/estimation/gasEstimationsV07.d.ts +9 -4
  28. package/esm/rpc/estimation/gasEstimationsV07.js +22 -10
  29. package/esm/rpc/estimation/gasEstimationsV07.js.map +1 -1
  30. package/esm/rpc/rpcHandler.d.ts +53 -1
  31. package/esm/rpc/rpcHandler.js +218 -146
  32. package/esm/rpc/rpcHandler.js.map +1 -1
  33. package/esm/rpc/validation/SafeValidator.d.ts +18 -3
  34. package/esm/rpc/validation/SafeValidator.js +15 -6
  35. package/esm/rpc/validation/SafeValidator.js.map +1 -1
  36. package/esm/rpc/validation/UnsafeValidator.d.ts +41 -6
  37. package/esm/rpc/validation/UnsafeValidator.js +27 -10
  38. package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
  39. package/esm/types/interfaces.d.ts +41 -6
  40. package/esm/types/mempool.d.ts +3 -2
  41. package/esm/types/mempool.js +10 -3
  42. package/esm/types/mempool.js.map +1 -1
  43. package/esm/types/schemas.d.ts +896 -40
  44. package/esm/types/schemas.js +61 -2
  45. package/esm/types/schemas.js.map +1 -1
  46. package/esm/utils/helpers.d.ts +14 -1
  47. package/esm/utils/helpers.js +14 -0
  48. package/esm/utils/helpers.js.map +1 -1
  49. package/esm/utils/metrics.d.ts +3 -3
  50. package/esm/utils/userop.d.ts +1 -1
  51. package/lib/cli/config/bundler.d.ts +26 -20
  52. package/lib/cli/config/bundler.js +2 -1
  53. package/lib/cli/config/bundler.js.map +1 -1
  54. package/lib/cli/config/options.js +5 -0
  55. package/lib/cli/config/options.js.map +1 -1
  56. package/lib/cli/handler.js +2 -1
  57. package/lib/cli/handler.js.map +1 -1
  58. package/lib/cli/parseArgs.js +1 -1
  59. package/lib/cli/parseArgs.js.map +1 -1
  60. package/lib/executor/executor.js +44 -19
  61. package/lib/executor/executor.js.map +1 -1
  62. package/lib/executor/executorManager.d.ts +1 -1
  63. package/lib/executor/types.d.ts +25 -0
  64. package/lib/executor/types.js +3 -0
  65. package/lib/executor/types.js.map +1 -0
  66. package/lib/executor/utils.d.ts +4 -2
  67. package/lib/executor/utils.js +21 -6
  68. package/lib/executor/utils.js.map +1 -1
  69. package/lib/mempool/mempool.js +7 -1
  70. package/lib/mempool/mempool.js.map +1 -1
  71. package/lib/rpc/estimation/gasEstimationHandler.d.ts +3 -1
  72. package/lib/rpc/estimation/gasEstimationHandler.js +3 -1
  73. package/lib/rpc/estimation/gasEstimationHandler.js.map +1 -1
  74. package/lib/rpc/estimation/gasEstimationsV06.d.ts +3 -1
  75. package/lib/rpc/estimation/gasEstimationsV06.js +9 -1
  76. package/lib/rpc/estimation/gasEstimationsV06.js.map +1 -1
  77. package/lib/rpc/estimation/gasEstimationsV07.d.ts +9 -4
  78. package/lib/rpc/estimation/gasEstimationsV07.js +21 -9
  79. package/lib/rpc/estimation/gasEstimationsV07.js.map +1 -1
  80. package/lib/rpc/rpcHandler.d.ts +53 -1
  81. package/lib/rpc/rpcHandler.js +217 -145
  82. package/lib/rpc/rpcHandler.js.map +1 -1
  83. package/lib/rpc/validation/SafeValidator.d.ts +18 -3
  84. package/lib/rpc/validation/SafeValidator.js +15 -6
  85. package/lib/rpc/validation/SafeValidator.js.map +1 -1
  86. package/lib/rpc/validation/UnsafeValidator.d.ts +41 -6
  87. package/lib/rpc/validation/UnsafeValidator.js +27 -10
  88. package/lib/rpc/validation/UnsafeValidator.js.map +1 -1
  89. package/lib/types/interfaces.d.ts +41 -6
  90. package/lib/types/mempool.d.ts +3 -2
  91. package/lib/types/mempool.js +12 -4
  92. package/lib/types/mempool.js.map +1 -1
  93. package/lib/types/schemas.d.ts +896 -40
  94. package/lib/types/schemas.js +61 -2
  95. package/lib/types/schemas.js.map +1 -1
  96. package/lib/utils/helpers.d.ts +14 -1
  97. package/lib/utils/helpers.js +16 -1
  98. package/lib/utils/helpers.js.map +1 -1
  99. package/lib/utils/metrics.d.ts +3 -3
  100. package/lib/utils/userop.d.ts +1 -1
  101. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { EntryPointV07Abi, EntryPointV07SimulationsAbi, ExecutionErrors, PimlicoEntryPointSimulationsAbi, RpcError, ValidationErrors, targetCallResultSchema } from "../../types/index.js";
2
- import { getUserOperationHash, toPackedUserOperation } from "../../utils/index.js";
2
+ import { addAuthorizationStateOverrides, getUserOperationHash, toPackedUserOperation } from "../../utils/index.js";
3
3
  import { decodeAbiParameters, decodeErrorResult, decodeFunctionResult, encodeFunctionData, slice, toFunctionSelector, toHex } from "viem";
4
4
  import { AccountExecuteAbi } from "../../types/contracts/IAccountExecute.js";
5
5
  import { simulationValidationResultStruct } from "./types.js";
@@ -8,7 +8,7 @@ export class GasEstimatorV07 {
8
8
  constructor(config) {
9
9
  this.config = config;
10
10
  }
11
- async simulateValidation({ entryPoint, userOperation, queuedUserOperations }) {
11
+ async simulateValidation({ entryPoint, userOperation, queuedUserOperations, authorizationList }) {
12
12
  const userOperations = [...queuedUserOperations, userOperation];
13
13
  const packedUserOperations = userOperations.map((uo) => toPackedUserOperation(uo));
14
14
  const simulateValidationLast = encodeFunctionData({
@@ -18,7 +18,8 @@ export class GasEstimatorV07 {
18
18
  });
19
19
  const errorResult = await this.callPimlicoEntryPointSimulations({
20
20
  entryPoint,
21
- entryPointSimulationsCallData: [simulateValidationLast]
21
+ entryPointSimulationsCallData: [simulateValidationLast],
22
+ authorizationList
22
23
  });
23
24
  return {
24
25
  simulateValidationResult: getSimulateValidationResult(errorResult[0])
@@ -86,7 +87,7 @@ export class GasEstimatorV07 {
86
87
  return simulateTargetCallData;
87
88
  }
88
89
  // Try to get the calldata gas again if the initial simulation reverted due to hitting the eth_call gasLimit.
89
- async retryGetCallDataGas({ entryPoint, optimalGas, minGas, targetOp, queuedOps, stateOverrides, simulateHandleOpLastResult }) {
90
+ async retryGetCallDataGas({ entryPoint, optimalGas, minGas, targetOp, queuedOps, stateOverrides, simulateHandleOpLastResult, authorizationList }) {
90
91
  const maxRetries = 3;
91
92
  let retryCount = 0;
92
93
  let currentOptimalGas = optimalGas;
@@ -104,7 +105,8 @@ export class GasEstimatorV07 {
104
105
  let cause = await this.callPimlicoEntryPointSimulations({
105
106
  entryPoint,
106
107
  entryPointSimulationsCallData: [simulateCallData],
107
- stateOverrides
108
+ stateOverrides,
109
+ authorizationList
108
110
  });
109
111
  cause = cause.map((data) => {
110
112
  const decodedDelegateAndError = decodeErrorResult({
@@ -142,7 +144,7 @@ export class GasEstimatorV07 {
142
144
  code: ValidationErrors.SimulateValidation
143
145
  };
144
146
  }
145
- async simulateHandleOpV07({ entryPoint, userOperation, queuedUserOperations, stateOverrides = undefined }) {
147
+ async simulateHandleOpV07({ entryPoint, userOperation, queuedUserOperations, stateOverrides = undefined, authorizationList }) {
146
148
  const simulateHandleOpLast = this.encodeSimulateHandleOpLast({
147
149
  entryPoint,
148
150
  userOperation,
@@ -160,12 +162,14 @@ export class GasEstimatorV07 {
160
162
  this.callPimlicoEntryPointSimulations({
161
163
  entryPoint,
162
164
  entryPointSimulationsCallData: [simulateHandleOpLast],
163
- stateOverrides
165
+ stateOverrides,
166
+ authorizationList
164
167
  }),
165
168
  this.callPimlicoEntryPointSimulations({
166
169
  entryPoint,
167
170
  entryPointSimulationsCallData: [simulateCallData],
168
- stateOverrides
171
+ stateOverrides,
172
+ authorizationList
169
173
  })
170
174
  ]);
171
175
  cause = [simulateHandleOpLastCause[0], simulateCallDataCause[0]];
@@ -177,7 +181,8 @@ export class GasEstimatorV07 {
177
181
  simulateHandleOpLast,
178
182
  simulateCallData
179
183
  ],
180
- stateOverrides
184
+ stateOverrides,
185
+ authorizationList
181
186
  });
182
187
  }
183
188
  cause = cause.map((data) => {
@@ -228,7 +233,7 @@ export class GasEstimatorV07 {
228
233
  };
229
234
  }
230
235
  }
231
- async callPimlicoEntryPointSimulations({ entryPoint, entryPointSimulationsCallData, stateOverrides }) {
236
+ async callPimlicoEntryPointSimulations({ entryPoint, entryPointSimulationsCallData, stateOverrides, authorizationList }) {
232
237
  const publicClient = this.config.publicClient;
233
238
  const blockTagSupport = this.config.blockTagSupport;
234
239
  const utilityWalletAddress = this.config.utilityPrivateKey?.address ??
@@ -243,6 +248,13 @@ export class GasEstimatorV07 {
243
248
  functionName: "simulateEntryPoint",
244
249
  args: [entryPoint, entryPointSimulationsCallData]
245
250
  });
251
+ if (authorizationList) {
252
+ stateOverrides = await addAuthorizationStateOverrides({
253
+ stateOverrides,
254
+ authorizationList,
255
+ publicClient
256
+ });
257
+ }
246
258
  // Remove state override if not supported by network.
247
259
  if (!this.config.balanceOverride) {
248
260
  stateOverrides = undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"gasEstimationsV07.js","sourceRoot":"","sources":["../../../rpc/estimation/gasEstimationsV07.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAChB,2BAA2B,EAC3B,eAAe,EAEf,+BAA+B,EAC/B,QAAQ,EAIR,gBAAgB,EAEhB,sBAAsB,EACzB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAEzE,OAAO,EAEH,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,KAAK,EACL,kBAAkB,EAClB,KAAK,EACR,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AACzE,OAAO,EAEH,gCAAgC,EACnC,MAAM,SAAS,CAAA;AAGhB,MAAM,OAAO,eAAe;IAChB,MAAM,CAAY;IAE1B,YAAY,MAAkB;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACxB,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,EACrB,UAAU,EACV,aAAa,EACb,oBAAoB,EAKvB;QACG,MAAM,cAAc,GAAG,CAAC,GAAG,oBAAoB,EAAE,aAAa,CAAC,CAAA;QAC/D,MAAM,oBAAoB,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CACnD,qBAAqB,CAAC,EAAE,CAAC,CAC5B,CAAA;QAED,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;YAC9C,GAAG,EAAE,2BAA2B;YAChC,YAAY,EAAE,wBAAwB;YACtC,IAAI,EAAE,CAAC,oBAAoB,CAAC;SAC/B,CAAC,CAAA;QAEF,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gCAAgC,CAAC;YAC5D,UAAU;YACV,6BAA6B,EAAE,CAAC,sBAAsB,CAAC;SAC1D,CAAC,CA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AQ,CAChC,EAAE;gBACH,IAAI,EAAE,gBAAgB,CAAC,kBAAkB;aACnC,CAAA;QACd,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACL,4BAA4B;QAC5B,MAAM,aAAa,GAAoB,oBAAoB,CAAC;YACxD,GAAG,EAAE,2BAA2B;YAChC,YAAY,EAAE,kBAAkB;YAChC,IAAI;SACP,CAA+B,CAAA;QAEhC,OAAO;YACH,MAAM,EAAE,WAAW;YACnB,IAAI,EAAE;gBACF,eAAe,EAAE,aAAa;aACxB;SACb,CAAA;IACL,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAA;AACvC,CAAC"}
1
+ {"version":3,"file":"gasEstimationsV07.js","sourceRoot":"","sources":["../../../rpc/estimation/gasEstimationsV07.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAChB,2BAA2B,EAC3B,eAAe,EAEf,+BAA+B,EAC/B,QAAQ,EAIR,gBAAgB,EAEhB,sBAAsB,EACzB,MAAM,aAAa,CAAA;AACpB,OAAO,EACH,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACxB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAEH,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,KAAK,EACL,kBAAkB,EAClB,KAAK,EACR,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AACzE,OAAO,EAEH,gCAAgC,EACnC,MAAM,SAAS,CAAA;AAIhB,MAAM,OAAO,eAAe;IAChB,MAAM,CAAY;IAE1B,YAAY,MAAkB;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACxB,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,EACrB,UAAU,EACV,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EAMpB;QACG,MAAM,cAAc,GAAG,CAAC,GAAG,oBAAoB,EAAE,aAAa,CAAC,CAAA;Q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AAC;AAED,SAAS,yBAAyB,CAAC,IAAS;IACxC,IAAI,CAAC;QACD,MAAM,YAAY,GAAG,iBAAiB,CAAC;YACnC,GAAG,EAAE,2BAA2B;YAChC,IAAI,EAAE,IAAI;SACb,CAAC,CAAA;QAEF,IACI,YAAY;YACZ,YAAY,CAAC,SAAS,KAAK,UAAU;YACrC,YAAY,CAAC,IAAI,EACnB,CAAC;YACC,OAAO;gBACH,MAAM,EAAE,QAAQ;gBAChB,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAW;gBACpC,IAAI,EAAE,gBAAgB,CAAC,kBAAkB;aACnC,CAAA;QACd,CAAC;QAED,IACI,YAAY;YACZ,YAAY,CAAC,SAAS,KAAK,oBAAoB;YAC/C,YAAY,CAAC,IAAI,EACnB,CAAC;YACC,OAAO;gBACH,MAAM,EAAE,QAAQ;gBAChB,IAAI,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,uBAAuB,CACpD,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,CAAQ,CAChC,EAAE;gBACH,IAAI,EAAE,gBAAgB,CAAC,kBAAkB;aACnC,CAAA;QACd,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACL,4BAA4B;QAC5B,MAAM,aAAa,GAAoB,oBAAoB,CAAC;YACxD,GAAG,EAAE,2BAA2B;YAChC,YAAY,EAAE,kBAAkB;YAChC,IAAI;SACP,CAA+B,CAAA;QAEhC,OAAO;YACH,MAAM,EAAE,WAAW;YACnB,IAAI,EAAE;gBACF,eAAe,EAAE,aAAa;aACxB;SACb,CAAA;IACL,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAA;AACvC,CAAC"}
@@ -7,6 +7,7 @@ import type { Logger, Metrics } from "../utils/index.js";
7
7
  import { type Hex } from "viem";
8
8
  import type { NonceQueuer } from "./nonceQueuer.js";
9
9
  import type { AltoConfig } from "../createConfig.js";
10
+ import { SignedAuthorization } from "viem/experimental";
10
11
  export interface IRpcEndpoint {
11
12
  handleMethod(request: BundlerRequest, apiVersion: ApiVersion): Promise<BundlerResponse>;
12
13
  eth_chainId(): ChainIdResponseResult;
@@ -65,6 +66,29 @@ export declare class RpcHandler implements IRpcEndpoint {
65
66
  pimlico_getUserOperationStatus(userOperationHash: HexData32): PimlicoGetUserOperationStatusResponseResult;
66
67
  pimlico_getUserOperationGasPrice(): Promise<PimlicoGetUserOperationGasPriceResponseResult>;
67
68
  addToMempoolIfValid(op: MempoolUserOperation, entryPoint: Address, apiVersion: ApiVersion): Promise<"added" | "queued">;
69
+ pimlico_experimental_estimateUserOperationGas7702(apiVersion: ApiVersion, userOperation: UserOperation, entryPoint: Address, authorization: SignedAuthorization, stateOverrides?: StateOverrides): Promise<{
70
+ preVerificationGas: bigint;
71
+ verificationGasLimit: bigint;
72
+ callGasLimit: bigint;
73
+ paymasterVerificationGasLimit: bigint;
74
+ paymasterPostOpGasLimit: bigint;
75
+ verificationGas?: undefined;
76
+ } | {
77
+ preVerificationGas: bigint;
78
+ verificationGasLimit: bigint;
79
+ callGasLimit: bigint;
80
+ paymasterVerificationGasLimit?: undefined;
81
+ paymasterPostOpGasLimit?: undefined;
82
+ verificationGas?: undefined;
83
+ } | {
84
+ preVerificationGas: bigint;
85
+ verificationGas: bigint;
86
+ verificationGasLimit: bigint;
87
+ callGasLimit: bigint;
88
+ paymasterVerificationGasLimit?: undefined;
89
+ paymasterPostOpGasLimit?: undefined;
90
+ }>;
91
+ pimlico_experimental_sendUserOperation7702(apiVersion: ApiVersion, userOperation: UserOperation, entryPoint: Address, authorizationSignature: SignedAuthorization): Promise<`0x${string}`>;
68
92
  pimlico_sendUserOperationNow(apiVersion: ApiVersion, userOperation: UserOperation, entryPoint: Address): Promise<{
69
93
  sender: `0x${string}`;
70
94
  nonce: bigint;
@@ -87,13 +111,13 @@ export declare class RpcHandler implements IRpcEndpoint {
87
111
  to: `0x${string}` | null;
88
112
  gasUsed: bigint;
89
113
  status: bigint | null;
114
+ contractAddress: `0x${string}` | null;
90
115
  blockNumber: bigint;
91
116
  blockHash: `0x${string}`;
92
117
  transactionHash: `0x${string}`;
93
118
  transactionIndex: bigint;
94
119
  from: `0x${string}`;
95
120
  cumulativeGasUsed: bigint;
96
- contractAddress: `0x${string}` | null;
97
121
  logs: {
98
122
  address: `0x${string}`;
99
123
  data: `0x${string}`;
@@ -113,5 +137,33 @@ export declare class RpcHandler implements IRpcEndpoint {
113
137
  pimlico_sendCompressedUserOperation(apiVersion: ApiVersion, compressedCalldata: Hex, inflatorAddress: Address, entryPoint: Address): Promise<`0x${string}`>;
114
138
  private validateAndInflateCompressedUserOperation;
115
139
  getNonceValue(userOperation: UserOperation, entryPoint: Address): Promise<bigint>;
140
+ doEstimateGas({ apiVersion, userOperation, entryPoint, stateOverrides, authorization }: {
141
+ apiVersion: ApiVersion;
142
+ userOperation: UserOperation;
143
+ entryPoint: Address;
144
+ stateOverrides?: StateOverrides;
145
+ authorization?: SignedAuthorization;
146
+ }): Promise<{
147
+ preVerificationGas: bigint;
148
+ verificationGasLimit: bigint;
149
+ callGasLimit: bigint;
150
+ paymasterVerificationGasLimit: bigint;
151
+ paymasterPostOpGasLimit: bigint;
152
+ verificationGas?: undefined;
153
+ } | {
154
+ preVerificationGas: bigint;
155
+ verificationGasLimit: bigint;
156
+ callGasLimit: bigint;
157
+ paymasterVerificationGasLimit?: undefined;
158
+ paymasterPostOpGasLimit?: undefined;
159
+ verificationGas?: undefined;
160
+ } | {
161
+ preVerificationGas: bigint;
162
+ verificationGas: bigint;
163
+ verificationGasLimit: bigint;
164
+ callGasLimit: bigint;
165
+ paymasterVerificationGasLimit?: undefined;
166
+ paymasterPostOpGasLimit?: undefined;
167
+ }>;
116
168
  }
117
169
  //# sourceMappingURL=rpcHandler.d.ts.map
@@ -1,4 +1,4 @@
1
- import { EntryPointV06Abi, EntryPointV07Abi, IOpInflatorAbi, RpcError, ValidationErrors, bundlerGetStakeStatusResponseSchema, deriveUserOperation } from "../types/index.js";
1
+ import { EntryPointV06Abi, EntryPointV07Abi, IOpInflatorAbi, RpcError, ValidationErrors, bundlerGetStakeStatusResponseSchema, deriveUserOperation, is7702Type } from "../types/index.js";
2
2
  import { calcPreVerificationGas, calcVerificationGasAndCallGasLimit, deepHexlify, getAAError, getNonceKeyAndValue, getUserOperationHash, isVersion06, isVersion07, maxBigInt, parseUserOperationReceipt, scaleBigIntByPercent, toUnpackedUserOperation } from "../utils/index.js";
3
3
  import { TransactionNotFoundError, decodeFunctionData, getAbiItem, getAddress, getContract, slice, toFunctionSelector } from "viem";
4
4
  import { base, baseSepolia, optimism } from "viem/chains";
@@ -127,6 +127,16 @@ export class RpcHandler {
127
127
  method,
128
128
  result: await this.pimlico_sendUserOperationNow(apiVersion, ...request.params)
129
129
  };
130
+ case "pimlico_experimental_sendUserOperation7702":
131
+ return {
132
+ method,
133
+ result: await this.pimlico_experimental_sendUserOperation7702(apiVersion, ...request.params)
134
+ };
135
+ case "pimlico_experimental_estimateUserOperationGas7702":
136
+ return {
137
+ method,
138
+ result: await this.pimlico_experimental_estimateUserOperationGas7702(apiVersion, request.params[0], request.params[1], request.params[2], request.params[3])
139
+ };
130
140
  }
131
141
  }
132
142
  ensureEntryPointIsSupported(entryPoint) {
@@ -172,130 +182,12 @@ export class RpcHandler {
172
182
  return this.config.entrypoints;
173
183
  }
174
184
  async eth_estimateUserOperationGas(apiVersion, userOperation, entryPoint, stateOverrides) {
175
- this.ensureEntryPointIsSupported(entryPoint);
176
- if (userOperation.maxFeePerGas === 0n) {
177
- throw new RpcError("user operation max fee per gas must be larger than 0 during gas estimation");
178
- }
179
- // Check if the nonce is valid
180
- // If the nonce is less than the current nonce, the user operation has already been executed
181
- // If the nonce is greater than the current nonce, we may have missing user operations in the mempool
182
- const currentNonceValue = await this.getNonceValue(userOperation, entryPoint);
183
- const [, userOperationNonceValue] = getNonceKeyAndValue(userOperation.nonce);
184
- let queuedUserOperations = [];
185
- if (userOperationNonceValue < currentNonceValue) {
186
- throw new RpcError("UserOperation reverted during simulation with reason: AA25 invalid account nonce", ValidationErrors.InvalidFields);
187
- }
188
- if (userOperationNonceValue > currentNonceValue) {
189
- // Nonce queues are supported only for v7 user operations
190
- if (isVersion06(userOperation)) {
191
- throw new RpcError("UserOperation reverted during simulation with reason: AA25 invalid account nonce", ValidationErrors.InvalidFields);
192
- }
193
- queuedUserOperations = await this.mempool.getQueuedUserOperations(userOperation, entryPoint, currentNonceValue);
194
- if (userOperationNonceValue >
195
- currentNonceValue + BigInt(queuedUserOperations.length)) {
196
- throw new RpcError("UserOperation reverted during simulation with reason: AA25 invalid account nonce", ValidationErrors.InvalidFields);
197
- }
198
- }
199
- // Prepare userOperation for simulation
200
- const { simulationVerificationGasLimit, simulationCallGasLimit, simulationPaymasterVerificationGasLimit, simulationPaymasterPostOpGasLimit } = this.config;
201
- const simulationUserOperation = {
202
- ...userOperation,
203
- preVerificationGas: 0n,
204
- verificationGasLimit: simulationVerificationGasLimit,
205
- callGasLimit: simulationCallGasLimit
206
- };
207
- if (isVersion07(simulationUserOperation)) {
208
- simulationUserOperation.paymasterVerificationGasLimit =
209
- simulationPaymasterVerificationGasLimit;
210
- simulationUserOperation.paymasterPostOpGasLimit =
211
- simulationPaymasterPostOpGasLimit;
212
- }
213
- // This is necessary because entryPoint pays
214
- // min(maxFeePerGas, baseFee + maxPriorityFeePerGas) for the verification
215
- // Since we don't want our estimations to depend upon baseFee, we set
216
- // maxFeePerGas to maxPriorityFeePerGas
217
- simulationUserOperation.maxPriorityFeePerGas =
218
- simulationUserOperation.maxFeePerGas;
219
- const executionResult = await this.validator.getExecutionResult(simulationUserOperation, entryPoint, queuedUserOperations, true, deepHexlify(stateOverrides));
220
- let { verificationGasLimit, callGasLimit } = calcVerificationGasAndCallGasLimit(simulationUserOperation, executionResult.data.executionResult, this.config.publicClient.chain.id, executionResult.data.callDataResult);
221
- let paymasterVerificationGasLimit = 0n;
222
- let paymasterPostOpGasLimit = 0n;
223
- if (isVersion07(simulationUserOperation) &&
224
- simulationUserOperation.paymaster !== null &&
225
- "paymasterVerificationGasLimit" in
226
- executionResult.data.executionResult &&
227
- "paymasterPostOpGasLimit" in executionResult.data.executionResult) {
228
- paymasterVerificationGasLimit =
229
- executionResult.data.executionResult
230
- .paymasterVerificationGasLimit || 1n;
231
- paymasterPostOpGasLimit =
232
- executionResult.data.executionResult.paymasterPostOpGasLimit ||
233
- 1n;
234
- const multiplier = Number(this.config.paymasterGasLimitMultiplier);
235
- paymasterVerificationGasLimit = scaleBigIntByPercent(paymasterVerificationGasLimit, multiplier);
236
- paymasterPostOpGasLimit = scaleBigIntByPercent(paymasterPostOpGasLimit, multiplier);
237
- }
238
- if (this.config.publicClient.chain.id === base.id ||
239
- this.config.publicClient.chain.id === baseSepolia.id) {
240
- callGasLimit += 10000n;
241
- }
242
- if (this.config.publicClient.chain.id === base.id ||
243
- this.config.publicClient.chain.id === optimism.id) {
244
- callGasLimit = maxBigInt(callGasLimit, 120000n);
245
- }
246
- if (simulationUserOperation.callData === "0x") {
247
- callGasLimit = 0n;
248
- }
249
- if (isVersion06(simulationUserOperation)) {
250
- callGasLimit = scaleBigIntByPercent(callGasLimit, Number(this.config.callGasLimitMultiplier));
251
- }
252
- let preVerificationGas = await calcPreVerificationGas({
253
- config: this.config,
254
- userOperation: {
255
- ...userOperation,
256
- callGasLimit, // use actual callGasLimit
257
- verificationGasLimit, // use actual verificationGasLimit
258
- paymasterPostOpGasLimit, // use actual paymasterPostOpGasLimit
259
- paymasterVerificationGasLimit // use actual paymasterVerificationGasLimit
260
- },
185
+ return await this.doEstimateGas({
186
+ apiVersion,
187
+ userOperation,
261
188
  entryPoint,
262
- gasPriceManager: this.gasPriceManager,
263
- validate: false
189
+ stateOverrides
264
190
  });
265
- preVerificationGas = scaleBigIntByPercent(preVerificationGas, 110);
266
- // Check if userOperation passes without estimation balance overrides
267
- if (isVersion06(simulationUserOperation)) {
268
- await this.validator.getExecutionResult({
269
- ...simulationUserOperation,
270
- preVerificationGas,
271
- verificationGasLimit,
272
- callGasLimit,
273
- paymasterVerificationGasLimit,
274
- paymasterPostOpGasLimit
275
- }, entryPoint, queuedUserOperations, false, deepHexlify(stateOverrides));
276
- }
277
- if (isVersion07(simulationUserOperation)) {
278
- return {
279
- preVerificationGas,
280
- verificationGasLimit,
281
- callGasLimit,
282
- paymasterVerificationGasLimit,
283
- paymasterPostOpGasLimit
284
- };
285
- }
286
- if (apiVersion === "v2") {
287
- return {
288
- preVerificationGas,
289
- verificationGasLimit,
290
- callGasLimit
291
- };
292
- }
293
- return {
294
- preVerificationGas,
295
- verificationGas: verificationGasLimit,
296
- verificationGasLimit,
297
- callGasLimit
298
- };
299
191
  }
300
192
  async eth_sendUserOperation(apiVersion, userOperation, entryPoint) {
301
193
  const hash = getUserOperationHash(userOperation, entryPoint, this.config.publicClient.chain.id);
@@ -505,32 +397,72 @@ export class RpcHandler {
505
397
  isVersion07(userOperation)) {
506
398
  queuedUserOperations = await this.mempool.getQueuedUserOperations(userOperation, entryPoint, currentNonceValue);
507
399
  }
508
- if (userOperationNonceValue ===
400
+ if (userOperationNonceValue >
509
401
  currentNonceValue + BigInt(queuedUserOperations.length)) {
510
- if (this.config.dangerousSkipUserOperationValidation) {
511
- const [success, errorReason] = this.mempool.add(op, entryPoint);
512
- if (!success) {
513
- this.eventManager.emitFailedValidation(opHash, errorReason, getAAError(errorReason));
514
- throw new RpcError(errorReason, ValidationErrors.InvalidFields);
515
- }
516
- }
517
- else {
518
- if (apiVersion !== "v1") {
519
- await this.validator.validatePreVerificationGas(userOperation, entryPoint);
520
- }
521
- const validationResult = await this.validator.validateUserOperation(apiVersion !== "v1", userOperation, queuedUserOperations, entryPoint);
522
- await this.reputationManager.checkReputation(userOperation, entryPoint, validationResult);
523
- await this.mempool.checkEntityMultipleRoleViolation(userOperation);
524
- const [success, errorReason] = this.mempool.add(op, entryPoint, validationResult.referencedContracts);
525
- if (!success) {
526
- this.eventManager.emitFailedValidation(opHash, errorReason, getAAError(errorReason));
527
- throw new RpcError(errorReason, ValidationErrors.InvalidFields);
528
- }
529
- return "added";
402
+ this.nonceQueuer.add(op, entryPoint);
403
+ return "queued";
404
+ }
405
+ if (this.config.dangerousSkipUserOperationValidation) {
406
+ const [success, errorReason] = this.mempool.add(op, entryPoint);
407
+ if (!success) {
408
+ this.eventManager.emitFailedValidation(opHash, errorReason, getAAError(errorReason));
409
+ throw new RpcError(errorReason, ValidationErrors.InvalidFields);
530
410
  }
411
+ return "added";
412
+ }
413
+ if (apiVersion !== "v1") {
414
+ await this.validator.validatePreVerificationGas({
415
+ userOperation,
416
+ entryPoint
417
+ });
531
418
  }
532
- this.nonceQueuer.add(op, entryPoint);
533
- return "queued";
419
+ let authorizationList;
420
+ if (is7702Type(op)) {
421
+ authorizationList = [op.authorization];
422
+ }
423
+ const validationResult = await this.validator.validateUserOperation({
424
+ shouldCheckPrefund: apiVersion !== "v1",
425
+ userOperation,
426
+ queuedUserOperations,
427
+ entryPoint,
428
+ authorizationList
429
+ });
430
+ await this.reputationManager.checkReputation(userOperation, entryPoint, validationResult);
431
+ await this.mempool.checkEntityMultipleRoleViolation(userOperation);
432
+ const [success, errorReason] = this.mempool.add(op, entryPoint, validationResult.referencedContracts);
433
+ if (!success) {
434
+ this.eventManager.emitFailedValidation(opHash, errorReason, getAAError(errorReason));
435
+ throw new RpcError(errorReason, ValidationErrors.InvalidFields);
436
+ }
437
+ return "added";
438
+ }
439
+ async pimlico_experimental_estimateUserOperationGas7702(apiVersion, userOperation, entryPoint, authorization, stateOverrides) {
440
+ if (!this.config.enableExperimental7702Endpoints) {
441
+ throw new RpcError("pimlico_experimental_estimateUserOperationGas7702 endpoint is not enabled", ValidationErrors.InvalidFields);
442
+ }
443
+ return await this.doEstimateGas({
444
+ apiVersion,
445
+ userOperation,
446
+ authorization,
447
+ entryPoint,
448
+ stateOverrides
449
+ });
450
+ }
451
+ async pimlico_experimental_sendUserOperation7702(apiVersion, userOperation, entryPoint, authorizationSignature) {
452
+ if (!this.config.enableExperimental7702Endpoints) {
453
+ throw new RpcError("pimlico_experimental_sendUserOperation7702 endpoint is not enabled", ValidationErrors.InvalidFields);
454
+ }
455
+ this.ensureEntryPointIsSupported(entryPoint);
456
+ try {
457
+ await this.addToMempoolIfValid({
458
+ userOperation,
459
+ authorization: authorizationSignature
460
+ }, entryPoint, apiVersion);
461
+ }
462
+ catch (e) {
463
+ this.logger.error(e);
464
+ }
465
+ return getUserOperationHash(userOperation, entryPoint, this.config.publicClient.chain.id);
534
466
  }
535
467
  async pimlico_sendUserOperationNow(apiVersion, userOperation, entryPoint) {
536
468
  if (!this.config.enableInstantBundlingEndpoint) {
@@ -647,5 +579,145 @@ export class RpcHandler {
647
579
  const [_, currentNonceValue] = getNonceKeyAndValue(getNonceResult);
648
580
  return currentNonceValue;
649
581
  }
582
+ async doEstimateGas({ apiVersion, userOperation, entryPoint, stateOverrides, authorization }) {
583
+ this.ensureEntryPointIsSupported(entryPoint);
584
+ if (userOperation.maxFeePerGas === 0n) {
585
+ throw new RpcError("user operation max fee per gas must be larger than 0 during gas estimation");
586
+ }
587
+ // Check if the nonce is valid
588
+ // If the nonce is less than the current nonce, the user operation has already been executed
589
+ // If the nonce is greater than the current nonce, we may have missing user operations in the mempool
590
+ const currentNonceValue = await this.getNonceValue(userOperation, entryPoint);
591
+ const [, userOperationNonceValue] = getNonceKeyAndValue(userOperation.nonce);
592
+ let queuedUserOperations = [];
593
+ if (userOperationNonceValue < currentNonceValue) {
594
+ throw new RpcError("UserOperation reverted during simulation with reason: AA25 invalid account nonce", ValidationErrors.InvalidFields);
595
+ }
596
+ if (userOperationNonceValue > currentNonceValue) {
597
+ // Nonce queues are supported only for v7 user operations
598
+ if (isVersion06(userOperation)) {
599
+ throw new RpcError("UserOperation reverted during simulation with reason: AA25 invalid account nonce", ValidationErrors.InvalidFields);
600
+ }
601
+ queuedUserOperations = await this.mempool.getQueuedUserOperations(userOperation, entryPoint, currentNonceValue);
602
+ if (userOperationNonceValue >
603
+ currentNonceValue + BigInt(queuedUserOperations.length)) {
604
+ throw new RpcError("UserOperation reverted during simulation with reason: AA25 invalid account nonce", ValidationErrors.InvalidFields);
605
+ }
606
+ }
607
+ // Prepare userOperation for simulation
608
+ const { simulationVerificationGasLimit, simulationCallGasLimit, simulationPaymasterVerificationGasLimit, simulationPaymasterPostOpGasLimit } = this.config;
609
+ const simulationUserOperation = {
610
+ ...userOperation,
611
+ preVerificationGas: 0n,
612
+ verificationGasLimit: simulationVerificationGasLimit,
613
+ callGasLimit: simulationCallGasLimit
614
+ };
615
+ if (isVersion07(simulationUserOperation)) {
616
+ simulationUserOperation.paymasterVerificationGasLimit =
617
+ simulationPaymasterVerificationGasLimit;
618
+ simulationUserOperation.paymasterPostOpGasLimit =
619
+ simulationPaymasterPostOpGasLimit;
620
+ }
621
+ // This is necessary because entryPoint pays
622
+ // min(maxFeePerGas, baseFee + maxPriorityFeePerGas) for the verification
623
+ // Since we don't want our estimations to depend upon baseFee, we set
624
+ // maxFeePerGas to maxPriorityFeePerGas
625
+ simulationUserOperation.maxPriorityFeePerGas =
626
+ simulationUserOperation.maxFeePerGas;
627
+ const executionResult = await this.validator.getExecutionResult({
628
+ userOperation: simulationUserOperation,
629
+ entryPoint,
630
+ queuedUserOperations,
631
+ addSenderBalanceOverride: true,
632
+ stateOverrides: deepHexlify(stateOverrides),
633
+ authorizationList: authorization ? [authorization] : undefined
634
+ });
635
+ let { verificationGasLimit, callGasLimit } = calcVerificationGasAndCallGasLimit(simulationUserOperation, executionResult.data.executionResult, this.config.publicClient.chain.id, executionResult.data.callDataResult);
636
+ let paymasterVerificationGasLimit = 0n;
637
+ let paymasterPostOpGasLimit = 0n;
638
+ if (isVersion07(simulationUserOperation) &&
639
+ simulationUserOperation.paymaster !== null &&
640
+ "paymasterVerificationGasLimit" in
641
+ executionResult.data.executionResult &&
642
+ "paymasterPostOpGasLimit" in executionResult.data.executionResult) {
643
+ paymasterVerificationGasLimit =
644
+ executionResult.data.executionResult
645
+ .paymasterVerificationGasLimit || 1n;
646
+ paymasterPostOpGasLimit =
647
+ executionResult.data.executionResult.paymasterPostOpGasLimit ||
648
+ 1n;
649
+ const multiplier = Number(this.config.paymasterGasLimitMultiplier);
650
+ paymasterVerificationGasLimit = scaleBigIntByPercent(paymasterVerificationGasLimit, multiplier);
651
+ paymasterPostOpGasLimit = scaleBigIntByPercent(paymasterPostOpGasLimit, multiplier);
652
+ }
653
+ if (this.config.publicClient.chain.id === base.id ||
654
+ this.config.publicClient.chain.id === baseSepolia.id) {
655
+ callGasLimit += 10000n;
656
+ }
657
+ if (this.config.publicClient.chain.id === base.id ||
658
+ this.config.publicClient.chain.id === optimism.id) {
659
+ callGasLimit = maxBigInt(callGasLimit, 120000n);
660
+ }
661
+ if (simulationUserOperation.callData === "0x") {
662
+ callGasLimit = 0n;
663
+ }
664
+ if (isVersion06(simulationUserOperation)) {
665
+ callGasLimit = scaleBigIntByPercent(callGasLimit, Number(this.config.callGasLimitMultiplier));
666
+ }
667
+ let preVerificationGas = await calcPreVerificationGas({
668
+ config: this.config,
669
+ userOperation: {
670
+ ...userOperation,
671
+ callGasLimit, // use actual callGasLimit
672
+ verificationGasLimit, // use actual verificationGasLimit
673
+ paymasterPostOpGasLimit, // use actual paymasterPostOpGasLimit
674
+ paymasterVerificationGasLimit // use actual paymasterVerificationGasLimit
675
+ },
676
+ entryPoint,
677
+ gasPriceManager: this.gasPriceManager,
678
+ validate: false
679
+ });
680
+ preVerificationGas = scaleBigIntByPercent(preVerificationGas, 110);
681
+ // Check if userOperation passes without estimation balance overrides
682
+ if (isVersion06(simulationUserOperation)) {
683
+ await this.validator.getExecutionResult({
684
+ userOperation: {
685
+ ...simulationUserOperation,
686
+ preVerificationGas,
687
+ verificationGasLimit,
688
+ callGasLimit,
689
+ paymasterVerificationGasLimit,
690
+ paymasterPostOpGasLimit
691
+ },
692
+ entryPoint,
693
+ queuedUserOperations,
694
+ addSenderBalanceOverride: false,
695
+ stateOverrides: deepHexlify(stateOverrides),
696
+ authorizationList: authorization ? [authorization] : undefined
697
+ });
698
+ }
699
+ if (isVersion07(simulationUserOperation)) {
700
+ return {
701
+ preVerificationGas,
702
+ verificationGasLimit,
703
+ callGasLimit,
704
+ paymasterVerificationGasLimit,
705
+ paymasterPostOpGasLimit
706
+ };
707
+ }
708
+ if (apiVersion === "v2") {
709
+ return {
710
+ preVerificationGas,
711
+ verificationGasLimit,
712
+ callGasLimit
713
+ };
714
+ }
715
+ return {
716
+ preVerificationGas,
717
+ verificationGas: verificationGasLimit,
718
+ verificationGasLimit,
719
+ callGasLimit
720
+ };
721
+ }
650
722
  }
651
723
  //# sourceMappingURL=rpcHandler.js.map