@pimlico/alto 0.0.0-main.20250428T104157 → 0.0.0-main.20250429T114818

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 (384) hide show
  1. package/contracts/EIP712.sol/EIP712.json +1 -0
  2. package/contracts/ERC165.sol/ERC165.json +1 -0
  3. package/contracts/Eip7702Support.sol/Eip7702Support.json +1 -0
  4. package/contracts/EntryPoint.sol/EntryPoint.json +1 -0
  5. package/contracts/EntryPointCodeOverride.sol/EntryPointCodeOverride.json +1 -0
  6. package/contracts/EntryPointSimulations.sol/EntryPointSimulations.json +1 -0
  7. package/contracts/Exec.sol/Exec.json +1 -0
  8. package/contracts/IAccount.sol/IAccount.json +1 -0
  9. package/contracts/IAccountExecute.sol/IAccountExecute.json +1 -0
  10. package/contracts/IAggregator.sol/IAggregator.json +1 -0
  11. package/contracts/IERC165.sol/IERC165.json +1 -0
  12. package/contracts/IERC5267.sol/IERC5267.json +1 -0
  13. package/contracts/IEntryPoint.sol/IEntryPoint.json +1 -0
  14. package/contracts/IEntryPointSimulations.sol/IEntryPointSimulations.json +1 -0
  15. package/contracts/INonceManager.sol/INonceManager.json +1 -0
  16. package/contracts/IPaymaster.sol/IPaymaster.json +1 -0
  17. package/contracts/ISenderCreator.sol/ISenderCreator.json +1 -0
  18. package/contracts/IStakeManager.sol/IStakeManager.json +1 -0
  19. package/contracts/Math.sol/Math.json +1 -0
  20. package/contracts/MessageHashUtils.sol/MessageHashUtils.json +1 -0
  21. package/contracts/NonceManager.sol/NonceManager.json +1 -0
  22. package/contracts/Panic.sol/Panic.json +1 -0
  23. package/contracts/PimlicoEntryPointSimulationsV7.sol/PimlicoEntryPointSimulationsV7.json +1 -0
  24. package/contracts/PimlicoEntryPointSimulationsV8.sol/PimlicoEntryPointSimulationsV8.json +1 -0
  25. package/contracts/ReentrancyGuard.sol/ReentrancyGuard.json +1 -0
  26. package/contracts/ReentrancyGuardTransient.sol/ReentrancyGuardTransient.json +1 -0
  27. package/contracts/SafeCast.sol/SafeCast.json +1 -0
  28. package/contracts/SenderCreator.sol/SenderCreator.json +1 -0
  29. package/contracts/ShortStrings.sol/ShortStrings.json +1 -0
  30. package/contracts/SignedMath.sol/SignedMath.json +1 -0
  31. package/contracts/StakeManager.sol/StakeManager.json +1 -0
  32. package/contracts/StorageSlot.sol/StorageSlot.json +1 -0
  33. package/contracts/Strings.sol/Strings.json +1 -0
  34. package/contracts/TransientSlot.sol/TransientSlot.json +1 -0
  35. package/contracts/UserOperation.sol/UserOperationLib.json +1 -0
  36. package/contracts/UserOperationLib.sol/UserOperationLib.json +1 -0
  37. package/contracts/build-info/0c52dc19c74a9a932ddddcca463ce398.json +1 -0
  38. package/contracts/build-info/a1d9af887789a0ade8ffbc8b045f0780.json +1 -0
  39. package/contracts/interfaces/IEntryPoint.sol/IEntryPoint.json +1 -0
  40. package/esm/cli/deploySimulationsContract.js +14 -5
  41. package/esm/cli/deploySimulationsContract.js.map +1 -1
  42. package/package.json +2 -1
  43. package/lib/cli/alto.d.ts +0 -7
  44. package/lib/cli/alto.js +0 -141
  45. package/lib/cli/alto.js.map +0 -1
  46. package/lib/cli/config/bundler.d.ts +0 -2872
  47. package/lib/cli/config/bundler.js +0 -242
  48. package/lib/cli/config/bundler.js.map +0 -1
  49. package/lib/cli/config/index.d.ts +0 -3
  50. package/lib/cli/config/index.js +0 -19
  51. package/lib/cli/config/index.js.map +0 -1
  52. package/lib/cli/config/options.d.ts +0 -13
  53. package/lib/cli/config/options.js +0 -587
  54. package/lib/cli/config/options.js.map +0 -1
  55. package/lib/cli/customTransport.d.ts +0 -14
  56. package/lib/cli/customTransport.js +0 -94
  57. package/lib/cli/customTransport.js.map +0 -1
  58. package/lib/cli/deploySimulationsContract.d.ts +0 -13
  59. package/lib/cli/deploySimulationsContract.js +0 -100
  60. package/lib/cli/deploySimulationsContract.js.map +0 -1
  61. package/lib/cli/handler.d.ts +0 -3
  62. package/lib/cli/handler.js +0 -157
  63. package/lib/cli/handler.js.map +0 -1
  64. package/lib/cli/index.d.ts +0 -4
  65. package/lib/cli/index.js +0 -20
  66. package/lib/cli/index.js.map +0 -1
  67. package/lib/cli/instrumentation.d.ts +0 -2
  68. package/lib/cli/instrumentation.js +0 -47
  69. package/lib/cli/instrumentation.js.map +0 -1
  70. package/lib/cli/parseArgs.d.ts +0 -8
  71. package/lib/cli/parseArgs.js +0 -25
  72. package/lib/cli/parseArgs.js.map +0 -1
  73. package/lib/cli/setupServer.d.ts +0 -13
  74. package/lib/cli/setupServer.js +0 -266
  75. package/lib/cli/setupServer.js.map +0 -1
  76. package/lib/cli/util.d.ts +0 -22
  77. package/lib/cli/util.js +0 -34
  78. package/lib/cli/util.js.map +0 -1
  79. package/lib/createConfig.d.ts +0 -16
  80. package/lib/createConfig.js +0 -13
  81. package/lib/createConfig.js.map +0 -1
  82. package/lib/executor/executor.d.ts +0 -65
  83. package/lib/executor/executor.js +0 -301
  84. package/lib/executor/executor.js.map +0 -1
  85. package/lib/executor/executorManager.d.ts +0 -108
  86. package/lib/executor/executorManager.js +0 -702
  87. package/lib/executor/executorManager.js.map +0 -1
  88. package/lib/executor/fastlane.d.ts +0 -9
  89. package/lib/executor/fastlane.js +0 -41
  90. package/lib/executor/fastlane.js.map +0 -1
  91. package/lib/executor/filterOpsAndEStimateGas.d.ts +0 -29
  92. package/lib/executor/filterOpsAndEStimateGas.js +0 -225
  93. package/lib/executor/filterOpsAndEStimateGas.js.map +0 -1
  94. package/lib/executor/index.d.ts +0 -5
  95. package/lib/executor/index.js +0 -21
  96. package/lib/executor/index.js.map +0 -1
  97. package/lib/executor/senderManager/createMemorySenderManager.d.ts +0 -8
  98. package/lib/executor/senderManager/createMemorySenderManager.js +0 -45
  99. package/lib/executor/senderManager/createMemorySenderManager.js.map +0 -1
  100. package/lib/executor/senderManager/createRedisSenderManager.d.ts +0 -8
  101. package/lib/executor/senderManager/createRedisSenderManager.js +0 -85
  102. package/lib/executor/senderManager/createRedisSenderManager.js.map +0 -1
  103. package/lib/executor/senderManager/flushOnStartUp.d.ts +0 -9
  104. package/lib/executor/senderManager/flushOnStartUp.js +0 -37
  105. package/lib/executor/senderManager/flushOnStartUp.js.map +0 -1
  106. package/lib/executor/senderManager/index.d.ts +0 -15
  107. package/lib/executor/senderManager/index.js +0 -25
  108. package/lib/executor/senderManager/index.js.map +0 -1
  109. package/lib/executor/senderManager/validateAndRefill.d.ts +0 -11
  110. package/lib/executor/senderManager/validateAndRefill.js +0 -115
  111. package/lib/executor/senderManager/validateAndRefill.js.map +0 -1
  112. package/lib/executor/utilityWalletMonitor.d.ts +0 -19
  113. package/lib/executor/utilityWalletMonitor.js +0 -42
  114. package/lib/executor/utilityWalletMonitor.js.map +0 -1
  115. package/lib/executor/utils.d.ts +0 -34
  116. package/lib/executor/utils.js +0 -167
  117. package/lib/executor/utils.js.map +0 -1
  118. package/lib/handlers/arbitrumGasPriceManager.d.ts +0 -14
  119. package/lib/handlers/arbitrumGasPriceManager.js +0 -39
  120. package/lib/handlers/arbitrumGasPriceManager.js.map +0 -1
  121. package/lib/handlers/eventManager.d.ts +0 -29
  122. package/lib/handlers/eventManager.js +0 -225
  123. package/lib/handlers/eventManager.js.map +0 -1
  124. package/lib/handlers/gasPriceManager.d.ts +0 -36
  125. package/lib/handlers/gasPriceManager.js +0 -391
  126. package/lib/handlers/gasPriceManager.js.map +0 -1
  127. package/lib/handlers/index.d.ts +0 -3
  128. package/lib/handlers/index.js +0 -19
  129. package/lib/handlers/index.js.map +0 -1
  130. package/lib/handlers/mantleGasPriceManager.d.ts +0 -23
  131. package/lib/handlers/mantleGasPriceManager.js +0 -44
  132. package/lib/handlers/mantleGasPriceManager.js.map +0 -1
  133. package/lib/handlers/optimismManager.d.ts +0 -10
  134. package/lib/handlers/optimismManager.js +0 -21
  135. package/lib/handlers/optimismManager.js.map +0 -1
  136. package/lib/index.d.ts +0 -2
  137. package/lib/index.js +0 -4
  138. package/lib/index.js.map +0 -1
  139. package/lib/mempool/index.d.ts +0 -4
  140. package/lib/mempool/index.js +0 -20
  141. package/lib/mempool/index.js.map +0 -1
  142. package/lib/mempool/mempool.d.ts +0 -191
  143. package/lib/mempool/mempool.js +0 -499
  144. package/lib/mempool/mempool.js.map +0 -1
  145. package/lib/mempool/monitoring.d.ts +0 -14
  146. package/lib/mempool/monitoring.js +0 -101
  147. package/lib/mempool/monitoring.js.map +0 -1
  148. package/lib/mempool/reputationManager.d.ts +0 -121
  149. package/lib/mempool/reputationManager.js +0 -472
  150. package/lib/mempool/reputationManager.js.map +0 -1
  151. package/lib/rpc/createMethodHandler.d.ts +0 -31
  152. package/lib/rpc/createMethodHandler.js +0 -34
  153. package/lib/rpc/createMethodHandler.js.map +0 -1
  154. package/lib/rpc/estimation/gasEstimationHandler.d.ts +0 -30
  155. package/lib/rpc/estimation/gasEstimationHandler.js +0 -50
  156. package/lib/rpc/estimation/gasEstimationHandler.js.map +0 -1
  157. package/lib/rpc/estimation/gasEstimationsV06.d.ts +0 -19
  158. package/lib/rpc/estimation/gasEstimationsV06.js +0 -148
  159. package/lib/rpc/estimation/gasEstimationsV06.js.map +0 -1
  160. package/lib/rpc/estimation/gasEstimationsV07.d.ts +0 -101
  161. package/lib/rpc/estimation/gasEstimationsV07.js +0 -727
  162. package/lib/rpc/estimation/gasEstimationsV07.js.map +0 -1
  163. package/lib/rpc/estimation/types.d.ts +0 -120
  164. package/lib/rpc/estimation/types.js +0 -125
  165. package/lib/rpc/estimation/types.js.map +0 -1
  166. package/lib/rpc/index.d.ts +0 -4
  167. package/lib/rpc/index.js +0 -20
  168. package/lib/rpc/index.js.map +0 -1
  169. package/lib/rpc/methods/debug_bundler_clearReputation.d.ts +0 -22
  170. package/lib/rpc/methods/debug_bundler_clearReputation.js +0 -15
  171. package/lib/rpc/methods/debug_bundler_clearReputation.js.map +0 -1
  172. package/lib/rpc/methods/debug_bundler_clearState.d.ts +0 -22
  173. package/lib/rpc/methods/debug_bundler_clearState.js +0 -16
  174. package/lib/rpc/methods/debug_bundler_clearState.js.map +0 -1
  175. package/lib/rpc/methods/debug_bundler_dumpMempool.d.ts +0 -973
  176. package/lib/rpc/methods/debug_bundler_dumpMempool.js +0 -16
  177. package/lib/rpc/methods/debug_bundler_dumpMempool.js.map +0 -1
  178. package/lib/rpc/methods/debug_bundler_dumpReputation.d.ts +0 -57
  179. package/lib/rpc/methods/debug_bundler_dumpReputation.js +0 -16
  180. package/lib/rpc/methods/debug_bundler_dumpReputation.js.map +0 -1
  181. package/lib/rpc/methods/debug_bundler_getStakeStatus.d.ts +0 -79
  182. package/lib/rpc/methods/debug_bundler_getStakeStatus.js +0 -25
  183. package/lib/rpc/methods/debug_bundler_getStakeStatus.js.map +0 -1
  184. package/lib/rpc/methods/debug_bundler_sendBundleNow.d.ts +0 -22
  185. package/lib/rpc/methods/debug_bundler_sendBundleNow.js +0 -15
  186. package/lib/rpc/methods/debug_bundler_sendBundleNow.js.map +0 -1
  187. package/lib/rpc/methods/debug_bundler_setBundlingMode.d.ts +0 -22
  188. package/lib/rpc/methods/debug_bundler_setBundlingMode.js +0 -16
  189. package/lib/rpc/methods/debug_bundler_setBundlingMode.js.map +0 -1
  190. package/lib/rpc/methods/debug_bundler_setReputation.d.ts +0 -46
  191. package/lib/rpc/methods/debug_bundler_setReputation.js +0 -16
  192. package/lib/rpc/methods/debug_bundler_setReputation.js.map +0 -1
  193. package/lib/rpc/methods/eth_chainId.d.ts +0 -22
  194. package/lib/rpc/methods/eth_chainId.js +0 -13
  195. package/lib/rpc/methods/eth_chainId.js.map +0 -1
  196. package/lib/rpc/methods/eth_estimateUserOperationGas.d.ts +0 -1891
  197. package/lib/rpc/methods/eth_estimateUserOperationGas.js +0 -26
  198. package/lib/rpc/methods/eth_estimateUserOperationGas.js.map +0 -1
  199. package/lib/rpc/methods/eth_getUserOperationByHash.d.ts +0 -1775
  200. package/lib/rpc/methods/eth_getUserOperationByHash.js +0 -101
  201. package/lib/rpc/methods/eth_getUserOperationByHash.js.map +0 -1
  202. package/lib/rpc/methods/eth_getUserOperationReceipt.d.ts +0 -412
  203. package/lib/rpc/methods/eth_getUserOperationReceipt.js +0 -14
  204. package/lib/rpc/methods/eth_getUserOperationReceipt.js.map +0 -1
  205. package/lib/rpc/methods/eth_sendUserOperation.d.ts +0 -878
  206. package/lib/rpc/methods/eth_sendUserOperation.js +0 -44
  207. package/lib/rpc/methods/eth_sendUserOperation.js.map +0 -1
  208. package/lib/rpc/methods/eth_supportedEntryPoints.d.ts +0 -22
  209. package/lib/rpc/methods/eth_supportedEntryPoints.js +0 -13
  210. package/lib/rpc/methods/eth_supportedEntryPoints.js.map +0 -1
  211. package/lib/rpc/methods/index.d.ts +0 -3
  212. package/lib/rpc/methods/index.js +0 -44
  213. package/lib/rpc/methods/index.js.map +0 -1
  214. package/lib/rpc/methods/pimlico_getUserOperationGasPrice.d.ts +0 -131
  215. package/lib/rpc/methods/pimlico_getUserOperationGasPrice.js +0 -33
  216. package/lib/rpc/methods/pimlico_getUserOperationGasPrice.js.map +0 -1
  217. package/lib/rpc/methods/pimlico_getUserOperationStatus.d.ts +0 -43
  218. package/lib/rpc/methods/pimlico_getUserOperationStatus.js +0 -14
  219. package/lib/rpc/methods/pimlico_getUserOperationStatus.js.map +0 -1
  220. package/lib/rpc/methods/pimlico_sendUserOperationNow.d.ts +0 -1268
  221. package/lib/rpc/methods/pimlico_sendUserOperationNow.js +0 -55
  222. package/lib/rpc/methods/pimlico_sendUserOperationNow.js.map +0 -1
  223. package/lib/rpc/rpcHandler.d.ts +0 -75
  224. package/lib/rpc/rpcHandler.js +0 -391
  225. package/lib/rpc/rpcHandler.js.map +0 -1
  226. package/lib/rpc/server.d.ts +0 -26
  227. package/lib/rpc/server.js +0 -283
  228. package/lib/rpc/server.js.map +0 -1
  229. package/lib/rpc/validation/BundlerCollectorTracerV06.d.ts +0 -102
  230. package/lib/rpc/validation/BundlerCollectorTracerV06.js +0 -262
  231. package/lib/rpc/validation/BundlerCollectorTracerV06.js.map +0 -1
  232. package/lib/rpc/validation/BundlerCollectorTracerV07.d.ts +0 -102
  233. package/lib/rpc/validation/BundlerCollectorTracerV07.js +0 -261
  234. package/lib/rpc/validation/BundlerCollectorTracerV07.js.map +0 -1
  235. package/lib/rpc/validation/SafeValidator.d.ts +0 -51
  236. package/lib/rpc/validation/SafeValidator.js +0 -327
  237. package/lib/rpc/validation/SafeValidator.js.map +0 -1
  238. package/lib/rpc/validation/TracerResultParserV06.d.ts +0 -13
  239. package/lib/rpc/validation/TracerResultParserV06.js +0 -582
  240. package/lib/rpc/validation/TracerResultParserV06.js.map +0 -1
  241. package/lib/rpc/validation/TracerResultParserV07.d.ts +0 -33
  242. package/lib/rpc/validation/TracerResultParserV07.js +0 -599
  243. package/lib/rpc/validation/TracerResultParserV07.js.map +0 -1
  244. package/lib/rpc/validation/UnsafeValidator.d.ts +0 -97
  245. package/lib/rpc/validation/UnsafeValidator.js +0 -303
  246. package/lib/rpc/validation/UnsafeValidator.js.map +0 -1
  247. package/lib/rpc/validation/index.d.ts +0 -3
  248. package/lib/rpc/validation/index.js +0 -19
  249. package/lib/rpc/validation/index.js.map +0 -1
  250. package/lib/rpc/validation/tracer.d.ts +0 -125
  251. package/lib/rpc/validation/tracer.js +0 -112
  252. package/lib/rpc/validation/tracer.js.map +0 -1
  253. package/lib/store/createMemoryOutstandingStore.d.ts +0 -28
  254. package/lib/store/createMemoryOutstandingStore.js +0 -236
  255. package/lib/store/createMemoryOutstandingStore.js.map +0 -1
  256. package/lib/store/createMempoolStore.d.ts +0 -8
  257. package/lib/store/createMempoolStore.js +0 -199
  258. package/lib/store/createMempoolStore.js.map +0 -1
  259. package/lib/store/createRedisOutstandingStore.d.ts +0 -27
  260. package/lib/store/createRedisOutstandingStore.js +0 -349
  261. package/lib/store/createRedisOutstandingStore.js.map +0 -1
  262. package/lib/store/createRedisStore.d.ts +0 -9
  263. package/lib/store/createRedisStore.js +0 -138
  264. package/lib/store/createRedisStore.js.map +0 -1
  265. package/lib/store/createStore.d.ts +0 -6
  266. package/lib/store/createStore.js +0 -70
  267. package/lib/store/createStore.js.map +0 -1
  268. package/lib/store/index.d.ts +0 -81
  269. package/lib/store/index.js +0 -6
  270. package/lib/store/index.js.map +0 -1
  271. package/lib/types/contracts/ArbitrumL1FeeAbi.d.ts +0 -32
  272. package/lib/types/contracts/ArbitrumL1FeeAbi.js +0 -45
  273. package/lib/types/contracts/ArbitrumL1FeeAbi.js.map +0 -1
  274. package/lib/types/contracts/CallEngine.d.ts +0 -28
  275. package/lib/types/contracts/CallEngine.js +0 -40
  276. package/lib/types/contracts/CallEngine.js.map +0 -1
  277. package/lib/types/contracts/CodeHashGetter.d.ts +0 -37
  278. package/lib/types/contracts/CodeHashGetter.js +0 -48
  279. package/lib/types/contracts/CodeHashGetter.js.map +0 -1
  280. package/lib/types/contracts/EntryPoint.d.ts +0 -1789
  281. package/lib/types/contracts/EntryPoint.js +0 -2307
  282. package/lib/types/contracts/EntryPoint.js.map +0 -1
  283. package/lib/types/contracts/EntryPointSimulationsV6.d.ts +0 -34
  284. package/lib/types/contracts/EntryPointSimulationsV6.js +0 -51
  285. package/lib/types/contracts/EntryPointSimulationsV6.js.map +0 -1
  286. package/lib/types/contracts/EntryPointSimulationsV7.d.ts +0 -2076
  287. package/lib/types/contracts/EntryPointSimulationsV7.js +0 -2678
  288. package/lib/types/contracts/EntryPointSimulationsV7.js.map +0 -1
  289. package/lib/types/contracts/IAccountExecute.d.ts +0 -53
  290. package/lib/types/contracts/IAccountExecute.js +0 -71
  291. package/lib/types/contracts/IAccountExecute.js.map +0 -1
  292. package/lib/types/contracts/IPaymaster.d.ts +0 -3
  293. package/lib/types/contracts/IPaymaster.js +0 -120
  294. package/lib/types/contracts/IPaymaster.js.map +0 -1
  295. package/lib/types/contracts/MantleBvmGasPriceOracle.d.ts +0 -219
  296. package/lib/types/contracts/MantleBvmGasPriceOracle.js +0 -180
  297. package/lib/types/contracts/MantleBvmGasPriceOracle.js.map +0 -1
  298. package/lib/types/contracts/OpL1FeeAbi.d.ts +0 -114
  299. package/lib/types/contracts/OpL1FeeAbi.js +0 -77
  300. package/lib/types/contracts/OpL1FeeAbi.js.map +0 -1
  301. package/lib/types/contracts/PimlicoEntryPointSimulations.d.ts +0 -25
  302. package/lib/types/contracts/PimlicoEntryPointSimulations.js +0 -42
  303. package/lib/types/contracts/PimlicoEntryPointSimulations.js.map +0 -1
  304. package/lib/types/contracts/SenderCreator.d.ts +0 -4
  305. package/lib/types/contracts/SenderCreator.js +0 -26
  306. package/lib/types/contracts/SenderCreator.js.map +0 -1
  307. package/lib/types/contracts/SimpleAccountFactory.d.ts +0 -57
  308. package/lib/types/contracts/SimpleAccountFactory.js +0 -79
  309. package/lib/types/contracts/SimpleAccountFactory.js.map +0 -1
  310. package/lib/types/contracts/TestOpcodesAccount.d.ts +0 -4
  311. package/lib/types/contracts/TestOpcodesAccount.js +0 -284
  312. package/lib/types/contracts/TestOpcodesAccount.js.map +0 -1
  313. package/lib/types/contracts/TestOpcodesAccountFactory.d.ts +0 -4
  314. package/lib/types/contracts/TestOpcodesAccountFactory.js +0 -26
  315. package/lib/types/contracts/TestOpcodesAccountFactory.js.map +0 -1
  316. package/lib/types/contracts/TestStorageAccount.d.ts +0 -4
  317. package/lib/types/contracts/TestStorageAccount.js +0 -316
  318. package/lib/types/contracts/TestStorageAccount.js.map +0 -1
  319. package/lib/types/contracts/index.d.ts +0 -17
  320. package/lib/types/contracts/index.js +0 -33
  321. package/lib/types/contracts/index.js.map +0 -1
  322. package/lib/types/gasPrice.d.ts +0 -110
  323. package/lib/types/gasPrice.js +0 -55
  324. package/lib/types/gasPrice.js.map +0 -1
  325. package/lib/types/index.d.ts +0 -11
  326. package/lib/types/index.js +0 -27
  327. package/lib/types/index.js.map +0 -1
  328. package/lib/types/interfaces.d.ts +0 -58
  329. package/lib/types/interfaces.js +0 -3
  330. package/lib/types/interfaces.js.map +0 -1
  331. package/lib/types/mempool.d.ts +0 -60
  332. package/lib/types/mempool.js +0 -11
  333. package/lib/types/mempool.js.map +0 -1
  334. package/lib/types/schemas.d.ts +0 -20785
  335. package/lib/types/schemas.js +0 -679
  336. package/lib/types/schemas.js.map +0 -1
  337. package/lib/types/utils.d.ts +0 -25
  338. package/lib/types/utils.js +0 -35
  339. package/lib/types/utils.js.map +0 -1
  340. package/lib/types/validation.d.ts +0 -14327
  341. package/lib/types/validation.js +0 -312
  342. package/lib/types/validation.js.map +0 -1
  343. package/lib/utils/asyncTimeout.d.ts +0 -5
  344. package/lib/utils/asyncTimeout.js +0 -51
  345. package/lib/utils/asyncTimeout.js.map +0 -1
  346. package/lib/utils/bigInt.d.ts +0 -8
  347. package/lib/utils/bigInt.js +0 -24
  348. package/lib/utils/bigInt.js.map +0 -1
  349. package/lib/utils/eip7702.d.ts +0 -4
  350. package/lib/utils/eip7702.js +0 -21
  351. package/lib/utils/eip7702.js.map +0 -1
  352. package/lib/utils/fastify-rpc-decorators.d.ts +0 -19
  353. package/lib/utils/fastify-rpc-decorators.js +0 -23
  354. package/lib/utils/fastify-rpc-decorators.js.map +0 -1
  355. package/lib/utils/helpers.d.ts +0 -15
  356. package/lib/utils/helpers.js +0 -59
  357. package/lib/utils/helpers.js.map +0 -1
  358. package/lib/utils/index.d.ts +0 -9
  359. package/lib/utils/index.js +0 -24
  360. package/lib/utils/index.js.map +0 -1
  361. package/lib/utils/logger.d.ts +0 -6
  362. package/lib/utils/logger.js +0 -85
  363. package/lib/utils/logger.js.map +0 -1
  364. package/lib/utils/metrics.d.ts +0 -29
  365. package/lib/utils/metrics.js +0 -199
  366. package/lib/utils/metrics.js.map +0 -1
  367. package/lib/utils/minMaxQueue/createMemoryMinMaxQueue.d.ts +0 -6
  368. package/lib/utils/minMaxQueue/createMemoryMinMaxQueue.js +0 -57
  369. package/lib/utils/minMaxQueue/createMemoryMinMaxQueue.js.map +0 -1
  370. package/lib/utils/minMaxQueue/createRedisMinMaxQueue.d.ts +0 -7
  371. package/lib/utils/minMaxQueue/createRedisMinMaxQueue.js +0 -105
  372. package/lib/utils/minMaxQueue/createRedisMinMaxQueue.js.map +0 -1
  373. package/lib/utils/minMaxQueue/index.d.ts +0 -12
  374. package/lib/utils/minMaxQueue/index.js +0 -16
  375. package/lib/utils/minMaxQueue/index.js.map +0 -1
  376. package/lib/utils/rpc-reply.d.ts +0 -16
  377. package/lib/utils/rpc-reply.js +0 -41
  378. package/lib/utils/rpc-reply.js.map +0 -1
  379. package/lib/utils/userop.d.ts +0 -138
  380. package/lib/utils/userop.js +0 -620
  381. package/lib/utils/userop.js.map +0 -1
  382. package/lib/utils/validation.d.ts +0 -76
  383. package/lib/utils/validation.js +0 -491
  384. package/lib/utils/validation.js.map +0 -1
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pimlicoSendUserOperationNowHandler = void 0;
4
- const utils_1 = require("../../utils/index.js");
5
- const createMethodHandler_1 = require("../createMethodHandler.js");
6
- const types_1 = require("../../types/index.js");
7
- exports.pimlicoSendUserOperationNowHandler = (0, createMethodHandler_1.createMethodHandler)({
8
- method: "pimlico_sendUserOperationNow",
9
- schema: types_1.pimlicoSendUserOperationNowSchema,
10
- handler: async ({ rpcHandler, params, apiVersion }) => {
11
- if (!rpcHandler.config.enableInstantBundlingEndpoint) {
12
- throw new types_1.RpcError("pimlico_sendUserOperationNow endpoint is not enabled", types_1.ValidationErrors.InvalidFields);
13
- }
14
- const [userOperation, entryPoint] = params;
15
- rpcHandler.ensureEntryPointIsSupported(entryPoint);
16
- const opHash = await (0, utils_1.getUserOperationHash)({
17
- userOperation: userOperation,
18
- entryPointAddress: entryPoint,
19
- chainId: rpcHandler.config.chainId,
20
- publicClient: rpcHandler.config.publicClient
21
- });
22
- await rpcHandler.preMempoolChecks(opHash, userOperation, apiVersion, entryPoint);
23
- // Prepare bundle
24
- const userOpInfo = {
25
- userOp: userOperation,
26
- userOpHash: await (0, utils_1.getUserOperationHash)({
27
- userOperation: userOperation,
28
- entryPointAddress: entryPoint,
29
- chainId: rpcHandler.config.chainId,
30
- publicClient: rpcHandler.config.publicClient
31
- }),
32
- addedToMempool: Date.now(),
33
- submissionAttempts: 0
34
- };
35
- const bundle = {
36
- entryPoint,
37
- userOps: [userOpInfo],
38
- version: (0, utils_1.isVersion06)(userOperation)
39
- ? "0.6"
40
- : "0.7"
41
- };
42
- rpcHandler.mempool.store.addProcessing({ entryPoint, userOpInfo });
43
- const result = await rpcHandler.executorManager.sendBundleToExecutor(bundle);
44
- if (!result) {
45
- throw new types_1.RpcError("unhandled error during bundle submission", types_1.ValidationErrors.InvalidFields);
46
- }
47
- // Wait for receipt.
48
- const receipt = await rpcHandler.config.publicClient.waitForTransactionReceipt({
49
- hash: result,
50
- pollingInterval: 100
51
- });
52
- return (0, utils_1.parseUserOperationReceipt)(opHash, receipt);
53
- }
54
- });
55
- //# sourceMappingURL=pimlico_sendUserOperationNow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pimlico_sendUserOperationNow.js","sourceRoot":"","sources":["../../../rpc/methods/pimlico_sendUserOperationNow.ts"],"names":[],"mappings":";;;AAAA,uCAIoB;AACpB,gEAA4D;AAC5D,uCAMoB;AAEP,QAAA,kCAAkC,GAAG,IAAA,yCAAmB,EAAC;IAClE,MAAM,EAAE,8BAA8B;IACtC,MAAM,EAAE,yCAAiC;IACzC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE;QAClD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,6BAA6B,EAAE,CAAC;YACnD,MAAM,IAAI,gBAAQ,CACd,sDAAsD,EACtD,wBAAgB,CAAC,aAAa,CACjC,CAAA;QACL,CAAC;QAED,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,GAAG,MAAM,CAAA;QAE1C,UAAU,CAAC,2BAA2B,CAAC,UAAU,CAAC,CAAA;QAClD,MAAM,MAAM,GAAG,MAAM,IAAA,4BAAoB,EAAC;YACtC,aAAa,EAAE,aAA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AC,CAAA;QAEN,OAAO,IAAA,iCAAyB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACrD,CAAC;CACJ,CAAC,CAAA"}
@@ -1,75 +0,0 @@
1
- import { type Executor, type ExecutorManager } from "../executor/index.js";
2
- import type { EventManager, GasPriceManager } from "../handlers/index.js";
3
- import type { InterfaceReputationManager, Mempool, Monitor } from "../mempool/index.js";
4
- import type { ApiVersion, BundlerRequest, StateOverrides } from "../types/index.js";
5
- import { type Address, type InterfaceValidator, type UserOperation } from "../types/index.js";
6
- import type { Logger, Metrics } from "../utils/index.js";
7
- import { type Hex } from "viem";
8
- import type { AltoConfig } from "../createConfig.js";
9
- import type { MethodHandler } from "./createMethodHandler.js";
10
- export declare class RpcHandler {
11
- config: AltoConfig;
12
- validator: InterfaceValidator;
13
- mempool: Mempool;
14
- executor: Executor;
15
- monitor: Monitor;
16
- executorManager: ExecutorManager;
17
- reputationManager: InterfaceReputationManager;
18
- metrics: Metrics;
19
- eventManager: EventManager;
20
- gasPriceManager: GasPriceManager;
21
- logger: Logger;
22
- private methodHandlers;
23
- private eip7702CodeCache;
24
- constructor({ config, validator, mempool, executor, monitor, executorManager, reputationManager, metrics, eventManager, gasPriceManager }: {
25
- config: AltoConfig;
26
- validator: InterfaceValidator;
27
- mempool: Mempool;
28
- executor: Executor;
29
- monitor: Monitor;
30
- executorManager: ExecutorManager;
31
- reputationManager: InterfaceReputationManager;
32
- metrics: Metrics;
33
- eventManager: EventManager;
34
- gasPriceManager: GasPriceManager;
35
- });
36
- registerHandler(handler: MethodHandler): void;
37
- handleMethod(request: BundlerRequest, apiVersion: ApiVersion): Promise<any>;
38
- ensureEntryPointIsSupported(entryPoint: Address): void;
39
- ensureDebugEndpointsAreEnabled(methodName: string): void;
40
- preMempoolChecks(opHash: Hex, userOperation: UserOperation, apiVersion: ApiVersion, entryPoint: Address): Promise<void>;
41
- addToMempoolIfValid(userOperation: UserOperation, entryPoint: Address, apiVersion: ApiVersion): Promise<"added" | "queued">;
42
- validateEip7702Auth({ userOperation, validateSender }: {
43
- userOperation: UserOperation;
44
- validateSender?: boolean;
45
- }): Promise<void>;
46
- getNonceValue(userOperation: UserOperation, entryPoint: Address): Promise<bigint>;
47
- estimateGas({ apiVersion, userOperation, entryPoint, stateOverrides }: {
48
- apiVersion: ApiVersion;
49
- userOperation: UserOperation;
50
- entryPoint: Address;
51
- stateOverrides?: StateOverrides;
52
- }): Promise<{
53
- preVerificationGas: bigint;
54
- verificationGasLimit: bigint;
55
- callGasLimit: bigint;
56
- paymasterVerificationGasLimit: bigint;
57
- paymasterPostOpGasLimit: bigint;
58
- verificationGas?: undefined;
59
- } | {
60
- preVerificationGas: bigint;
61
- verificationGasLimit: bigint;
62
- callGasLimit: bigint;
63
- paymasterVerificationGasLimit?: undefined;
64
- paymasterPostOpGasLimit?: undefined;
65
- verificationGas?: undefined;
66
- } | {
67
- preVerificationGas: bigint;
68
- verificationGas: bigint;
69
- verificationGasLimit: bigint;
70
- callGasLimit: bigint;
71
- paymasterVerificationGasLimit?: undefined;
72
- paymasterPostOpGasLimit?: undefined;
73
- }>;
74
- }
75
- //# sourceMappingURL=rpcHandler.d.ts.map
@@ -1,391 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RpcHandler = void 0;
4
- const executor_1 = require("../executor/index.js");
5
- const types_1 = require("../types/index.js");
6
- const utils_1 = require("../utils/index.js");
7
- const viem_1 = require("viem");
8
- const methods_1 = require("./methods/index.js");
9
- const utils_2 = require("viem/utils");
10
- const accounts_1 = require("viem/accounts");
11
- class RpcHandler {
12
- config;
13
- validator;
14
- mempool;
15
- executor;
16
- monitor;
17
- executorManager;
18
- reputationManager;
19
- metrics;
20
- eventManager;
21
- gasPriceManager;
22
- logger;
23
- methodHandlers;
24
- eip7702CodeCache;
25
- constructor({ config, validator, mempool, executor, monitor, executorManager, reputationManager, metrics, eventManager, gasPriceManager }) {
26
- this.config = config;
27
- this.validator = validator;
28
- this.mempool = mempool;
29
- this.executor = executor;
30
- this.monitor = monitor;
31
- this.executorManager = executorManager;
32
- this.reputationManager = reputationManager;
33
- this.metrics = metrics;
34
- this.eventManager = eventManager;
35
- this.gasPriceManager = gasPriceManager;
36
- this.logger = config.getLogger({ module: "rpc" }, {
37
- level: config.rpcLogLevel || config.logLevel
38
- });
39
- this.methodHandlers = new Map();
40
- this.eip7702CodeCache = new Map();
41
- (0, methods_1.registerHandlers)(this);
42
- }
43
- registerHandler(handler) {
44
- this.methodHandlers.set(handler.method, handler);
45
- }
46
- async handleMethod(request, apiVersion) {
47
- const handler = this.methodHandlers.get(request.method);
48
- if (!handler) {
49
- throw new types_1.RpcError("Method not supported", types_1.ValidationErrors.InvalidFields);
50
- }
51
- return await handler.handler({
52
- rpcHandler: this,
53
- params: request.params,
54
- apiVersion
55
- });
56
- }
57
- ensureEntryPointIsSupported(entryPoint) {
58
- if (!this.config.entrypoints.includes(entryPoint)) {
59
- throw new Error(`EntryPoint ${entryPoint} not supported, supported EntryPoints: ${this.config.entrypoints.join(", ")}`);
60
- }
61
- }
62
- ensureDebugEndpointsAreEnabled(methodName) {
63
- if (!this.config.enableDebugEndpoints) {
64
- throw new types_1.RpcError(`${methodName} is only available in development environment`);
65
- }
66
- }
67
- async preMempoolChecks(opHash, userOperation, apiVersion, entryPoint) {
68
- if (this.config.legacyTransactions &&
69
- userOperation.maxFeePerGas !== userOperation.maxPriorityFeePerGas) {
70
- const reason = "maxPriorityFeePerGas must equal maxFeePerGas on chains that don't support EIP-1559";
71
- this.eventManager.emitFailedValidation(opHash, reason);
72
- throw new types_1.RpcError(reason);
73
- }
74
- if (apiVersion !== "v1" && !this.config.safeMode) {
75
- await this.gasPriceManager.validateGasPrice({
76
- maxFeePerGas: userOperation.maxFeePerGas,
77
- maxPriorityFeePerGas: userOperation.maxPriorityFeePerGas
78
- });
79
- }
80
- if (userOperation.verificationGasLimit < 10000n) {
81
- const reason = "verificationGasLimit must be at least 10000";
82
- this.eventManager.emitFailedValidation(opHash, reason);
83
- throw new types_1.RpcError(reason);
84
- }
85
- this.logger.trace({ userOperation, entryPoint }, "beginning validation");
86
- if (userOperation.preVerificationGas === 0n ||
87
- userOperation.verificationGasLimit === 0n) {
88
- const reason = "user operation gas limits must be larger than 0";
89
- this.eventManager.emitFailedValidation(opHash, reason);
90
- throw new types_1.RpcError(reason);
91
- }
92
- const beneficiary = this.config.utilityPrivateKey?.address ||
93
- (0, accounts_1.privateKeyToAddress)((0, accounts_1.generatePrivateKey)());
94
- const gasLimits = (0, executor_1.calculateAA95GasFloor)({
95
- userOps: [userOperation],
96
- beneficiary
97
- });
98
- if (gasLimits > this.config.maxGasPerBundle) {
99
- throw new types_1.RpcError(`User operation gas limits exceed the max gas per bundle: ${gasLimits} > ${this.config.maxGasPerBundle}`);
100
- }
101
- }
102
- // check if we want to bundle userOperation. If yes, add to mempool
103
- async addToMempoolIfValid(userOperation, entryPoint, apiVersion) {
104
- this.ensureEntryPointIsSupported(entryPoint);
105
- const opHash = await (0, utils_1.getUserOperationHash)({
106
- userOperation: userOperation,
107
- entryPointAddress: entryPoint,
108
- chainId: this.config.chainId,
109
- publicClient: this.config.publicClient
110
- });
111
- await this.preMempoolChecks(opHash, userOperation, apiVersion, entryPoint);
112
- const currentNonceValue = await this.getNonceValue(userOperation, entryPoint);
113
- const [, userOperationNonceValue] = (0, utils_1.getNonceKeyAndSequence)(userOperation.nonce);
114
- if (userOperationNonceValue < currentNonceValue) {
115
- const reason = "UserOperation failed validation with reason: AA25 invalid account nonce";
116
- this.eventManager.emitFailedValidation(opHash, reason, "AA25");
117
- throw new types_1.RpcError(reason, types_1.ValidationErrors.InvalidFields);
118
- }
119
- if (userOperationNonceValue > currentNonceValue + 10n) {
120
- const reason = "UserOperation failed validaiton with reason: AA25 invalid account nonce";
121
- this.eventManager.emitFailedValidation(opHash, reason, "AA25");
122
- throw new types_1.RpcError(reason, types_1.ValidationErrors.InvalidFields);
123
- }
124
- const queuedUserOperations = await this.mempool.getQueuedOustandingUserOps({
125
- userOp: userOperation,
126
- entryPoint
127
- });
128
- if (userOperationNonceValue >
129
- currentNonceValue + BigInt(queuedUserOperations.length)) {
130
- this.mempool.add(userOperation, entryPoint);
131
- this.eventManager.emitQueued(opHash);
132
- return "queued";
133
- }
134
- if (this.config.dangerousSkipUserOperationValidation) {
135
- const [success, errorReason] = await this.mempool.add(userOperation, entryPoint);
136
- if (!success) {
137
- this.eventManager.emitFailedValidation(opHash, errorReason, (0, utils_1.getAAError)(errorReason));
138
- throw new types_1.RpcError(errorReason, types_1.ValidationErrors.InvalidFields);
139
- }
140
- return "added";
141
- }
142
- if (apiVersion !== "v1") {
143
- await this.validator.validatePreVerificationGas({
144
- userOperation,
145
- entryPoint
146
- });
147
- }
148
- await this.mempool.checkEntityMultipleRoleViolation(entryPoint, userOperation);
149
- const validationResult = await this.validator.validateUserOperation({
150
- userOperation,
151
- queuedUserOperations,
152
- entryPoint
153
- });
154
- await this.reputationManager.checkReputation(userOperation, entryPoint, validationResult);
155
- await this.mempool.checkEntityMultipleRoleViolation(entryPoint, userOperation);
156
- const [success, errorReason] = await this.mempool.add(userOperation, entryPoint, validationResult.referencedContracts);
157
- if (!success) {
158
- this.eventManager.emitFailedValidation(opHash, errorReason, (0, utils_1.getAAError)(errorReason));
159
- throw new types_1.RpcError(errorReason, types_1.ValidationErrors.InvalidFields);
160
- }
161
- return "added";
162
- }
163
- async validateEip7702Auth({ userOperation, validateSender = false }) {
164
- if (!userOperation.eip7702Auth) {
165
- throw new types_1.RpcError("UserOperation is missing eip7702Auth", types_1.ValidationErrors.InvalidFields);
166
- }
167
- if (!this.config.codeOverrideSupport) {
168
- throw new types_1.RpcError("eip7702Auth is not supported on this chain", types_1.ValidationErrors.InvalidFields);
169
- }
170
- // Check that auth is valid.
171
- const sender = validateSender
172
- ? await (0, utils_2.recoverAuthorizationAddress)({
173
- authorization: {
174
- address: "address" in userOperation.eip7702Auth
175
- ? userOperation.eip7702Auth.address
176
- : userOperation.eip7702Auth.contractAddress,
177
- chainId: userOperation.eip7702Auth.chainId,
178
- nonce: userOperation.eip7702Auth.nonce,
179
- r: userOperation.eip7702Auth.r,
180
- s: userOperation.eip7702Auth.s,
181
- v: userOperation.eip7702Auth.v,
182
- yParity: userOperation.eip7702Auth.yParity
183
- }
184
- })
185
- : userOperation.sender;
186
- const nonceOnChain = await this.config.publicClient.getTransactionCount({
187
- address: sender
188
- });
189
- if (userOperation.eip7702Auth.chainId !== this.config.chainId &&
190
- userOperation.eip7702Auth.chainId !== 0) {
191
- throw new types_1.RpcError("Invalid EIP-7702 authorization: The chainId does not match the userOperation sender address", types_1.ValidationErrors.InvalidFields);
192
- }
193
- if (![0, 1].includes(userOperation.eip7702Auth.yParity)) {
194
- throw new types_1.RpcError("Invalid EIP-7702 authorization: The yParity value must be either 0 or 1", types_1.ValidationErrors.InvalidFields);
195
- }
196
- if (nonceOnChain !== userOperation.eip7702Auth.nonce) {
197
- throw new types_1.RpcError("Invalid EIP-7702 authorization: The nonce does not match the userOperation sender address", types_1.ValidationErrors.SimulateValidation);
198
- }
199
- if (sender !== userOperation.sender) {
200
- throw new types_1.RpcError("Invalid EIP-7702 authorization: The recovered signer address does not match the userOperation sender address", types_1.ValidationErrors.InvalidFields);
201
- }
202
- if ((0, utils_1.isVersion06)(userOperation) && userOperation.initCode !== "0x") {
203
- throw new types_1.RpcError("Invalid EIP-7702 authorization: UserOperation cannot contain initCode.", types_1.ValidationErrors.InvalidFields);
204
- }
205
- if ((0, utils_1.isVersion07)(userOperation) &&
206
- userOperation.factory !== "0x7702" &&
207
- userOperation.factory !== null) {
208
- throw new types_1.RpcError("Invalid EIP-7702 authorization: UserOperation cannot contain factory that is neither null or 0x7702.", types_1.ValidationErrors.InvalidFields);
209
- }
210
- // Check delegation designator
211
- const delegationDesignator = "address" in userOperation.eip7702Auth
212
- ? userOperation.eip7702Auth.address
213
- : userOperation.eip7702Auth.contractAddress;
214
- if (delegationDesignator === viem_1.zeroAddress) {
215
- throw new types_1.RpcError("Invalid EIP-7702 authorization: Cannot delegate to the zero address.", types_1.ValidationErrors.InvalidFields);
216
- }
217
- const hasCode = this.eip7702CodeCache.has(delegationDesignator);
218
- if (!hasCode) {
219
- const delegateCode = await this.config.publicClient.getCode({
220
- address: delegationDesignator
221
- });
222
- if (delegateCode === undefined || delegateCode === "0x") {
223
- throw new types_1.RpcError(`Invalid EIP-7702 authorization: Delegate ${delegationDesignator} has no code.`, types_1.ValidationErrors.InvalidFields);
224
- }
225
- this.eip7702CodeCache.set(delegationDesignator, true);
226
- }
227
- }
228
- async getNonceValue(userOperation, entryPoint) {
229
- const entryPointContract = (0, viem_1.getContract)({
230
- address: entryPoint,
231
- abi: (0, utils_1.isVersion06)(userOperation)
232
- ? types_1.EntryPointV06Abi
233
- : types_1.EntryPointV07Abi,
234
- client: {
235
- public: this.config.publicClient
236
- }
237
- });
238
- const [nonceKey] = (0, utils_1.getNonceKeyAndSequence)(userOperation.nonce);
239
- const getNonceResult = await entryPointContract.read.getNonce([userOperation.sender, nonceKey], {
240
- blockTag: "latest"
241
- });
242
- const [_, currentNonceValue] = (0, utils_1.getNonceKeyAndSequence)(getNonceResult);
243
- return currentNonceValue;
244
- }
245
- async estimateGas({ apiVersion, userOperation, entryPoint, stateOverrides }) {
246
- this.ensureEntryPointIsSupported(entryPoint);
247
- if (userOperation.maxFeePerGas === 0n && !this.config.isGasFreeChain) {
248
- throw new types_1.RpcError("user operation max fee per gas must be larger than 0 during gas estimation");
249
- }
250
- // Check if the nonce is valid
251
- // If the nonce is less than the current nonce, the user operation has already been executed
252
- // If the nonce is greater than the current nonce, we may have missing user operations in the mempool
253
- const currentNonceValue = await this.getNonceValue(userOperation, entryPoint);
254
- const [, userOperationNonceValue] = (0, utils_1.getNonceKeyAndSequence)(userOperation.nonce);
255
- let queuedUserOperations = [];
256
- if (userOperationNonceValue < currentNonceValue) {
257
- throw new types_1.RpcError("UserOperation reverted during simulation with reason: AA25 invalid account nonce", types_1.ValidationErrors.InvalidFields);
258
- }
259
- if (userOperationNonceValue > currentNonceValue) {
260
- // Nonce queues are supported only for v7 user operations
261
- if ((0, utils_1.isVersion06)(userOperation)) {
262
- throw new types_1.RpcError("UserOperation reverted during simulation with reason: AA25 invalid account nonce", types_1.ValidationErrors.InvalidFields);
263
- }
264
- queuedUserOperations =
265
- await this.mempool.getQueuedOustandingUserOps({
266
- userOp: userOperation,
267
- entryPoint
268
- });
269
- if (userOperationNonceValue >
270
- currentNonceValue + BigInt(queuedUserOperations.length)) {
271
- throw new types_1.RpcError("UserOperation reverted during simulation with reason: AA25 invalid account nonce", types_1.ValidationErrors.InvalidFields);
272
- }
273
- }
274
- // Prepare userOperation for simulation
275
- const { simulationVerificationGasLimit, simulationCallGasLimit, simulationPaymasterVerificationGasLimit, simulationPaymasterPostOpGasLimit } = this.config;
276
- const simulationUserOperation = {
277
- ...userOperation,
278
- maxFeePerGas: 1n,
279
- maxPriorityFeePerGas: 1n,
280
- preVerificationGas: 0n,
281
- verificationGasLimit: simulationVerificationGasLimit,
282
- callGasLimit: simulationCallGasLimit
283
- };
284
- if ((0, utils_1.isVersion07)(simulationUserOperation)) {
285
- simulationUserOperation.paymasterVerificationGasLimit =
286
- simulationPaymasterVerificationGasLimit;
287
- simulationUserOperation.paymasterPostOpGasLimit =
288
- simulationPaymasterPostOpGasLimit;
289
- }
290
- // This is necessary because entryPoint pays
291
- // min(maxFeePerGas, baseFee + maxPriorityFeePerGas) for the verification
292
- // Since we don't want our estimations to depend upon baseFee, we set
293
- // maxFeePerGas to maxPriorityFeePerGas
294
- simulationUserOperation.maxPriorityFeePerGas =
295
- simulationUserOperation.maxFeePerGas;
296
- const executionResult = await this.validator.getExecutionResult({
297
- userOperation: simulationUserOperation,
298
- entryPoint,
299
- queuedUserOperations,
300
- stateOverrides: (0, utils_1.deepHexlify)(stateOverrides)
301
- });
302
- let { verificationGasLimit, callGasLimit, paymasterVerificationGasLimit } = (0, utils_1.calcVerificationGasAndCallGasLimit)(simulationUserOperation, executionResult.data.executionResult, executionResult.data);
303
- let paymasterPostOpGasLimit = 0n;
304
- if (!paymasterVerificationGasLimit &&
305
- (0, utils_1.isVersion07)(simulationUserOperation) &&
306
- simulationUserOperation.paymaster !== null &&
307
- "paymasterVerificationGasLimit" in
308
- executionResult.data.executionResult) {
309
- paymasterVerificationGasLimit =
310
- executionResult.data.executionResult
311
- .paymasterVerificationGasLimit || 1n;
312
- paymasterVerificationGasLimit = (0, utils_1.scaleBigIntByPercent)(paymasterVerificationGasLimit, this.config.paymasterGasLimitMultiplier);
313
- }
314
- if ((0, utils_1.isVersion07)(simulationUserOperation) &&
315
- simulationUserOperation.paymaster !== null &&
316
- "paymasterPostOpGasLimit" in executionResult.data.executionResult) {
317
- paymasterPostOpGasLimit =
318
- executionResult.data.executionResult.paymasterPostOpGasLimit ||
319
- 1n;
320
- const userOperationPaymasterPostOpGasLimit = "paymasterPostOpGasLimit" in userOperation
321
- ? userOperation.paymasterPostOpGasLimit ?? 1n
322
- : 1n;
323
- paymasterPostOpGasLimit = (0, utils_1.maxBigInt)(userOperationPaymasterPostOpGasLimit, (0, utils_1.scaleBigIntByPercent)(paymasterPostOpGasLimit, this.config.paymasterGasLimitMultiplier));
324
- }
325
- if (simulationUserOperation.callData === "0x") {
326
- callGasLimit = 0n;
327
- }
328
- if ((0, utils_1.isVersion06)(simulationUserOperation)) {
329
- callGasLimit = (0, utils_1.scaleBigIntByPercent)(callGasLimit, this.config.v6CallGasLimitMultiplier);
330
- verificationGasLimit = (0, utils_1.scaleBigIntByPercent)(verificationGasLimit, this.config.v6VerificationGasLimitMultiplier);
331
- }
332
- if ((0, utils_1.isVersion07)(simulationUserOperation)) {
333
- verificationGasLimit = (0, utils_1.scaleBigIntByPercent)(verificationGasLimit, this.config.v7VerificationGasLimitMultiplier);
334
- paymasterVerificationGasLimit = (0, utils_1.scaleBigIntByPercent)(paymasterVerificationGasLimit, this.config.v7PaymasterVerificationGasLimitMultiplier);
335
- callGasLimit = (0, utils_1.scaleBigIntByPercent)(callGasLimit, this.config.v7CallGasLimitMultiplier);
336
- paymasterPostOpGasLimit = (0, utils_1.scaleBigIntByPercent)(paymasterPostOpGasLimit, this.config.v7PaymasterPostOpGasLimitMultiplier);
337
- }
338
- let preVerificationGas = await (0, utils_1.calcPreVerificationGas)({
339
- config: this.config,
340
- userOperation: {
341
- ...userOperation,
342
- callGasLimit, // use actual callGasLimit
343
- verificationGasLimit, // use actual verificationGasLimit
344
- paymasterPostOpGasLimit, // use actual paymasterPostOpGasLimit
345
- paymasterVerificationGasLimit // use actual paymasterVerificationGasLimit
346
- },
347
- entryPoint,
348
- gasPriceManager: this.gasPriceManager,
349
- validate: false
350
- });
351
- preVerificationGas = (0, utils_1.scaleBigIntByPercent)(preVerificationGas, 110n);
352
- // Check if userOperation passes without estimation balance overrides
353
- await this.validator.validateHandleOp({
354
- userOperation: {
355
- ...userOperation,
356
- preVerificationGas,
357
- verificationGasLimit,
358
- callGasLimit,
359
- paymasterVerificationGasLimit,
360
- paymasterPostOpGasLimit
361
- },
362
- entryPoint,
363
- queuedUserOperations,
364
- stateOverrides: (0, utils_1.deepHexlify)(stateOverrides)
365
- });
366
- if ((0, utils_1.isVersion07)(simulationUserOperation)) {
367
- return {
368
- preVerificationGas,
369
- verificationGasLimit,
370
- callGasLimit,
371
- paymasterVerificationGasLimit,
372
- paymasterPostOpGasLimit
373
- };
374
- }
375
- if (apiVersion === "v2") {
376
- return {
377
- preVerificationGas,
378
- verificationGasLimit,
379
- callGasLimit
380
- };
381
- }
382
- return {
383
- preVerificationGas,
384
- verificationGas: verificationGasLimit,
385
- verificationGasLimit,
386
- callGasLimit
387
- };
388
- }
389
- }
390
- exports.RpcHandler = RpcHandler;
391
- //# sourceMappingURL=rpcHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rpcHandler.js","sourceRoot":"","sources":["../../rpc/rpcHandler.ts"],"names":[],"mappings":";;;AAAA,6CAIuB;AAQvB,uCAQoB;AAEpB,uCAWoB;AACpB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,4BAAoB,EAAC,kBAAkB,EAAE,IAAI,CAAC,CAAA;QAEnE,qEAAqE;QACrE,MAAM,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC;YAClC,aAAa,EAAE;gBACX,GAAG,aAAa;gBAChB,kBAAkB;gBAClB,oBAAoB;gBACpB,YAAY;gBACZ,6BAA6B;gBAC7B,uBAAuB;aAC1B;YACD,UAAU;YACV,oBAAoB;YACpB,cAAc,EAAE,IAAA,mBAAW,EAAC,cAAc,CAAC;SAC9C,CAAC,CAAA;QAEF,IAAI,IAAA,mBAAW,EAAC,uBAAuB,CAAC,EAAE,CAAC;YACvC,OAAO;gBACH,kBAAkB;gBAClB,oBAAoB;gBACpB,YAAY;gBACZ,6BAA6B;gBAC7B,uBAAuB;aAC1B,CAAA;QACL,CAAC;QAED,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;YACtB,OAAO;gBACH,kBAAkB;gBAClB,oBAAoB;gBACpB,YAAY;aACf,CAAA;QACL,CAAC;QAED,OAAO;YACH,kBAAkB;YAClB,eAAe,EAAE,oBAAoB;YACrC,oBAAoB;YACpB,YAAY;SACf,CAAA;IACL,CAAC;CACJ;AAxpBD,gCAwpBC"}
@@ -1,26 +0,0 @@
1
- import type { Metrics } from "../utils/index.js";
2
- import { type FastifyReply, type FastifyRequest } from "fastify";
3
- import type { Registry } from "prom-client";
4
- import type { AltoConfig } from "../createConfig.js";
5
- import type { RpcHandler } from "./rpcHandler.js";
6
- export declare class Server {
7
- private config;
8
- private fastify;
9
- private rpcEndpoint;
10
- private registry;
11
- private metrics;
12
- constructor({ config, rpcEndpoint, registry, metrics }: {
13
- config: AltoConfig;
14
- rpcEndpoint: RpcHandler;
15
- registry: Registry;
16
- metrics: Metrics;
17
- });
18
- start(): void;
19
- stop(): Promise<void>;
20
- healthCheck(_request: FastifyRequest, reply: FastifyReply): Promise<void>;
21
- private rpcSocket;
22
- private rpcHttp;
23
- private rpc;
24
- serveMetrics(_request: FastifyRequest, reply: FastifyReply): Promise<void>;
25
- }
26
- //# sourceMappingURL=server.d.ts.map