@pimlico/alto 0.0.0-main.20240607T104359 → 0.0.0-staging.20240606T095015

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 (369) hide show
  1. package/lib/cli/config/bundler.js +73 -76
  2. package/lib/cli/config/bundler.js.map +1 -1
  3. package/lib/cli/config/index.js +2 -18
  4. package/lib/cli/config/index.js.map +1 -1
  5. package/lib/cli/config/options.js +10 -13
  6. package/lib/cli/config/options.js.map +1 -1
  7. package/lib/cli/customTransport.js +7 -11
  8. package/lib/cli/customTransport.js.map +1 -1
  9. package/lib/cli/handler.js +24 -28
  10. package/lib/cli/handler.js.map +1 -1
  11. package/lib/cli/index.d.ts +0 -1
  12. package/lib/cli/index.js +2 -19
  13. package/lib/cli/index.js.map +1 -1
  14. package/lib/cli/instrumentation.js +20 -22
  15. package/lib/cli/instrumentation.js.map +1 -1
  16. package/lib/cli/setupServer.js +17 -21
  17. package/lib/cli/setupServer.js.map +1 -1
  18. package/lib/cli/util.js +1 -5
  19. package/lib/cli/util.js.map +1 -1
  20. package/lib/executor/executor.js +56 -90
  21. package/lib/executor/executor.js.map +1 -1
  22. package/lib/executor/executorManager.js +7 -12
  23. package/lib/executor/executorManager.js.map +1 -1
  24. package/lib/executor/index.js +4 -20
  25. package/lib/executor/index.js.map +1 -1
  26. package/lib/executor/senderManager.js +8 -12
  27. package/lib/executor/senderManager.js.map +1 -1
  28. package/lib/executor/test/utils.js +22 -28
  29. package/lib/executor/test/utils.js.map +1 -1
  30. package/lib/executor/utils.js +32 -64
  31. package/lib/executor/utils.js.map +1 -1
  32. package/lib/index.d.ts +5 -1
  33. package/lib/index.js +91 -3
  34. package/lib/index.js.map +1 -1
  35. package/lib/mempool/index.js +4 -20
  36. package/lib/mempool/index.js.map +1 -1
  37. package/lib/mempool/mempool.js +55 -59
  38. package/lib/mempool/mempool.js.map +1 -1
  39. package/lib/mempool/monitoring.js +1 -5
  40. package/lib/mempool/monitoring.js.map +1 -1
  41. package/lib/mempool/nullMempool.js +1 -5
  42. package/lib/mempool/nullMempool.js.map +1 -1
  43. package/lib/mempool/reputationManager.js +44 -49
  44. package/lib/mempool/reputationManager.js.map +1 -1
  45. package/lib/mempool/store.js +1 -5
  46. package/lib/mempool/store.js.map +1 -1
  47. package/lib/rpc/EntryPointSimulationsV07.js +44 -50
  48. package/lib/rpc/EntryPointSimulationsV07.js.map +1 -1
  49. package/lib/rpc/ExecuteSimulator.js +2 -5
  50. package/lib/rpc/ExecuteSimulator.js.map +1 -1
  51. package/lib/rpc/gasEstimation.js +62 -69
  52. package/lib/rpc/gasEstimation.js.map +1 -1
  53. package/lib/rpc/index.js +4 -20
  54. package/lib/rpc/index.js.map +1 -1
  55. package/lib/rpc/nonceQueuer.js +16 -20
  56. package/lib/rpc/nonceQueuer.js.map +1 -1
  57. package/lib/rpc/rpcHandler.js +76 -103
  58. package/lib/rpc/rpcHandler.js.map +1 -1
  59. package/lib/rpc/server.js +27 -58
  60. package/lib/rpc/server.js.map +1 -1
  61. package/lib/rpc/validation/BundlerCollectorTracerV06.js +1 -5
  62. package/lib/rpc/validation/BundlerCollectorTracerV06.js.map +1 -1
  63. package/lib/rpc/validation/BundlerCollectorTracerV07.js +1 -5
  64. package/lib/rpc/validation/BundlerCollectorTracerV07.js.map +1 -1
  65. package/lib/rpc/validation/SafeValidator.js +65 -69
  66. package/lib/rpc/validation/SafeValidator.js.map +1 -1
  67. package/lib/rpc/validation/TracerResultParserV06.js +26 -30
  68. package/lib/rpc/validation/TracerResultParserV06.js.map +1 -1
  69. package/lib/rpc/validation/TracerResultParserV07.js +29 -36
  70. package/lib/rpc/validation/TracerResultParserV07.js.map +1 -1
  71. package/lib/rpc/validation/UnsafeValidator.js +46 -73
  72. package/lib/rpc/validation/UnsafeValidator.js.map +1 -1
  73. package/lib/rpc/validation/index.js +2 -18
  74. package/lib/rpc/validation/index.js.map +1 -1
  75. package/lib/rpc/validation/tracer.js +7 -37
  76. package/lib/rpc/validation/tracer.js.map +1 -1
  77. package/lib/types/contracts/BundleBulker.js +1 -4
  78. package/lib/types/contracts/BundleBulker.js.map +1 -1
  79. package/lib/types/contracts/CallEngine.js +1 -4
  80. package/lib/types/contracts/CallEngine.js.map +1 -1
  81. package/lib/types/contracts/CodeHashGetter.js +2 -5
  82. package/lib/types/contracts/CodeHashGetter.js.map +1 -1
  83. package/lib/types/contracts/EntryPoint.js +4 -7
  84. package/lib/types/contracts/EntryPoint.js.map +1 -1
  85. package/lib/types/contracts/EntryPointSimulations.js +3 -6
  86. package/lib/types/contracts/EntryPointSimulations.js.map +1 -1
  87. package/lib/types/contracts/IOpInflator.js +1 -4
  88. package/lib/types/contracts/IOpInflator.js.map +1 -1
  89. package/lib/types/contracts/IPaymaster.js +1 -4
  90. package/lib/types/contracts/IPaymaster.js.map +1 -1
  91. package/lib/types/contracts/Inflator.js +1 -4
  92. package/lib/types/contracts/Inflator.js.map +1 -1
  93. package/lib/types/contracts/PerOpInflator.js +1 -4
  94. package/lib/types/contracts/PerOpInflator.js.map +1 -1
  95. package/lib/types/contracts/PimlicoEntryPointSimulations.js +2 -5
  96. package/lib/types/contracts/PimlicoEntryPointSimulations.js.map +1 -1
  97. package/lib/types/contracts/SenderCreator.js +2 -5
  98. package/lib/types/contracts/SenderCreator.js.map +1 -1
  99. package/lib/types/contracts/SimpleAccountFactory.js +2 -5
  100. package/lib/types/contracts/SimpleAccountFactory.js.map +1 -1
  101. package/lib/types/contracts/TestOpcodesAccount.js +2 -5
  102. package/lib/types/contracts/TestOpcodesAccount.js.map +1 -1
  103. package/lib/types/contracts/TestOpcodesAccountFactory.js +2 -5
  104. package/lib/types/contracts/TestOpcodesAccountFactory.js.map +1 -1
  105. package/lib/types/contracts/TestStorageAccount.js +2 -5
  106. package/lib/types/contracts/TestStorageAccount.js.map +1 -1
  107. package/lib/types/contracts/index.js +16 -32
  108. package/lib/types/contracts/index.js.map +1 -1
  109. package/lib/types/gasPrice.js +14 -17
  110. package/lib/types/gasPrice.js.map +1 -1
  111. package/lib/types/index.js +10 -26
  112. package/lib/types/index.js.map +1 -1
  113. package/lib/types/interfaces.js +1 -2
  114. package/lib/types/mempool.d.ts +1 -2
  115. package/lib/types/mempool.js +5 -10
  116. package/lib/types/mempool.js.map +1 -1
  117. package/lib/types/schemas.js +254 -284
  118. package/lib/types/schemas.js.map +1 -1
  119. package/lib/types/test/validationTestErrors.js +2 -5
  120. package/lib/types/test/validationTestErrors.js.map +1 -1
  121. package/lib/types/utils.js +5 -9
  122. package/lib/types/utils.js.map +1 -1
  123. package/lib/types/validation.js +139 -142
  124. package/lib/types/validation.js.map +1 -1
  125. package/lib/utils/bigInt.js +2 -7
  126. package/lib/utils/bigInt.js.map +1 -1
  127. package/lib/utils/compressionHandler.js +7 -11
  128. package/lib/utils/compressionHandler.js.map +1 -1
  129. package/lib/utils/gasPriceManager.js +30 -57
  130. package/lib/utils/gasPriceManager.js.map +1 -1
  131. package/lib/utils/helpers.js +5 -10
  132. package/lib/utils/helpers.js.map +1 -1
  133. package/lib/utils/index.js +9 -25
  134. package/lib/utils/index.js.map +1 -1
  135. package/lib/utils/logger.js +10 -19
  136. package/lib/utils/logger.js.map +1 -1
  137. package/lib/utils/metrics.js +20 -24
  138. package/lib/utils/metrics.js.map +1 -1
  139. package/lib/utils/rpc-reply.js +1 -3
  140. package/lib/utils/rpc-reply.js.map +1 -1
  141. package/lib/utils/test.js +36 -67
  142. package/lib/utils/test.js.map +1 -1
  143. package/lib/utils/userop.js +62 -107
  144. package/lib/utils/userop.js.map +1 -1
  145. package/lib/utils/validation.js +64 -99
  146. package/lib/utils/validation.js.map +1 -1
  147. package/package.json +68 -70
  148. package/esm/cli/alto.d.ts +0 -6
  149. package/esm/cli/alto.js +0 -92
  150. package/esm/cli/alto.js.map +0 -1
  151. package/esm/cli/config/bundler.d.ts +0 -391
  152. package/esm/cli/config/bundler.js +0 -132
  153. package/esm/cli/config/bundler.js.map +0 -1
  154. package/esm/cli/config/index.d.ts +0 -3
  155. package/esm/cli/config/index.js +0 -3
  156. package/esm/cli/config/index.js.map +0 -1
  157. package/esm/cli/config/options.d.ts +0 -11
  158. package/esm/cli/config/options.js +0 -336
  159. package/esm/cli/config/options.js.map +0 -1
  160. package/esm/cli/customTransport.d.ts +0 -14
  161. package/esm/cli/customTransport.js +0 -53
  162. package/esm/cli/customTransport.js.map +0 -1
  163. package/esm/cli/handler.d.ts +0 -3
  164. package/esm/cli/handler.js +0 -116
  165. package/esm/cli/handler.js.map +0 -1
  166. package/esm/cli/index.d.ts +0 -4
  167. package/esm/cli/index.js +0 -4
  168. package/esm/cli/index.js.map +0 -1
  169. package/esm/cli/instrumentation.d.ts +0 -2
  170. package/esm/cli/instrumentation.js +0 -39
  171. package/esm/cli/instrumentation.js.map +0 -1
  172. package/esm/cli/setupServer.d.ts +0 -17
  173. package/esm/cli/setupServer.js +0 -155
  174. package/esm/cli/setupServer.js.map +0 -1
  175. package/esm/cli/util.d.ts +0 -22
  176. package/esm/cli/util.js +0 -30
  177. package/esm/cli/util.js.map +0 -1
  178. package/esm/executor/executor.d.ts +0 -54
  179. package/esm/executor/executor.js +0 -643
  180. package/esm/executor/executor.js.map +0 -1
  181. package/esm/executor/executorManager.d.ts +0 -34
  182. package/esm/executor/executorManager.js +0 -402
  183. package/esm/executor/executorManager.js.map +0 -1
  184. package/esm/executor/index.d.ts +0 -5
  185. package/esm/executor/index.js +0 -5
  186. package/esm/executor/index.js.map +0 -1
  187. package/esm/executor/senderManager.d.ts +0 -17
  188. package/esm/executor/senderManager.js +0 -160
  189. package/esm/executor/senderManager.js.map +0 -1
  190. package/esm/executor/test/utils.d.ts +0 -13
  191. package/esm/executor/test/utils.js +0 -75
  192. package/esm/executor/test/utils.js.map +0 -1
  193. package/esm/executor/utils.d.ts +0 -32
  194. package/esm/executor/utils.js +0 -241
  195. package/esm/executor/utils.js.map +0 -1
  196. package/esm/index.d.ts +0 -2
  197. package/esm/index.js +0 -2
  198. package/esm/index.js.map +0 -1
  199. package/esm/mempool/index.d.ts +0 -5
  200. package/esm/mempool/index.js +0 -5
  201. package/esm/mempool/index.js.map +0 -1
  202. package/esm/mempool/mempool.d.ts +0 -64
  203. package/esm/mempool/mempool.js +0 -489
  204. package/esm/mempool/mempool.js.map +0 -1
  205. package/esm/mempool/monitoring.d.ts +0 -10
  206. package/esm/mempool/monitoring.js +0 -34
  207. package/esm/mempool/monitoring.js.map +0 -1
  208. package/esm/mempool/nullMempool.d.ts +0 -15
  209. package/esm/mempool/nullMempool.js +0 -36
  210. package/esm/mempool/nullMempool.js.map +0 -1
  211. package/esm/mempool/reputationManager.d.ts +0 -115
  212. package/esm/mempool/reputationManager.js +0 -397
  213. package/esm/mempool/reputationManager.js.map +0 -1
  214. package/esm/mempool/store.d.ts +0 -22
  215. package/esm/mempool/store.js +0 -123
  216. package/esm/mempool/store.js.map +0 -1
  217. package/esm/rpc/EntryPointSimulationsV07.d.ts +0 -58
  218. package/esm/rpc/EntryPointSimulationsV07.js +0 -407
  219. package/esm/rpc/EntryPointSimulationsV07.js.map +0 -1
  220. package/esm/rpc/ExecuteSimulator.d.ts +0 -37
  221. package/esm/rpc/ExecuteSimulator.js +0 -48
  222. package/esm/rpc/ExecuteSimulator.js.map +0 -1
  223. package/esm/rpc/gasEstimation.d.ts +0 -17
  224. package/esm/rpc/gasEstimation.js +0 -410
  225. package/esm/rpc/gasEstimation.js.map +0 -1
  226. package/esm/rpc/index.d.ts +0 -5
  227. package/esm/rpc/index.js +0 -5
  228. package/esm/rpc/index.js.map +0 -1
  229. package/esm/rpc/nonceQueuer.d.ts +0 -25
  230. package/esm/rpc/nonceQueuer.js +0 -135
  231. package/esm/rpc/nonceQueuer.js.map +0 -1
  232. package/esm/rpc/rpcHandler.d.ts +0 -64
  233. package/esm/rpc/rpcHandler.js +0 -727
  234. package/esm/rpc/rpcHandler.js.map +0 -1
  235. package/esm/rpc/server.d.ts +0 -31
  236. package/esm/rpc/server.js +0 -239
  237. package/esm/rpc/server.js.map +0 -1
  238. package/esm/rpc/validation/BundlerCollectorTracerV06.d.ts +0 -102
  239. package/esm/rpc/validation/BundlerCollectorTracerV06.js +0 -255
  240. package/esm/rpc/validation/BundlerCollectorTracerV06.js.map +0 -1
  241. package/esm/rpc/validation/BundlerCollectorTracerV07.d.ts +0 -102
  242. package/esm/rpc/validation/BundlerCollectorTracerV07.js +0 -254
  243. package/esm/rpc/validation/BundlerCollectorTracerV07.js.map +0 -1
  244. package/esm/rpc/validation/SafeValidator.d.ts +0 -35
  245. package/esm/rpc/validation/SafeValidator.js +0 -487
  246. package/esm/rpc/validation/SafeValidator.js.map +0 -1
  247. package/esm/rpc/validation/TracerResultParserV06.d.ts +0 -13
  248. package/esm/rpc/validation/TracerResultParserV06.js +0 -578
  249. package/esm/rpc/validation/TracerResultParserV06.js.map +0 -1
  250. package/esm/rpc/validation/TracerResultParserV07.d.ts +0 -33
  251. package/esm/rpc/validation/TracerResultParserV07.js +0 -557
  252. package/esm/rpc/validation/TracerResultParserV07.js.map +0 -1
  253. package/esm/rpc/validation/UnsafeValidator.d.ts +0 -63
  254. package/esm/rpc/validation/UnsafeValidator.js +0 -257
  255. package/esm/rpc/validation/UnsafeValidator.js.map +0 -1
  256. package/esm/rpc/validation/index.d.ts +0 -3
  257. package/esm/rpc/validation/index.js +0 -3
  258. package/esm/rpc/validation/index.js.map +0 -1
  259. package/esm/rpc/validation/tracer.d.ts +0 -122
  260. package/esm/rpc/validation/tracer.js +0 -82
  261. package/esm/rpc/validation/tracer.js.map +0 -1
  262. package/esm/types/contracts/BundleBulker.d.ts +0 -120
  263. package/esm/types/contracts/BundleBulker.js +0 -157
  264. package/esm/types/contracts/BundleBulker.js.map +0 -1
  265. package/esm/types/contracts/CallEngine.d.ts +0 -28
  266. package/esm/types/contracts/CallEngine.js +0 -37
  267. package/esm/types/contracts/CallEngine.js.map +0 -1
  268. package/esm/types/contracts/CodeHashGetter.d.ts +0 -37
  269. package/esm/types/contracts/CodeHashGetter.js +0 -45
  270. package/esm/types/contracts/CodeHashGetter.js.map +0 -1
  271. package/esm/types/contracts/EntryPoint.d.ts +0 -1789
  272. package/esm/types/contracts/EntryPoint.js +0 -2304
  273. package/esm/types/contracts/EntryPoint.js.map +0 -1
  274. package/esm/types/contracts/EntryPointSimulations.d.ts +0 -153
  275. package/esm/types/contracts/EntryPointSimulations.js +0 -15
  276. package/esm/types/contracts/EntryPointSimulations.js.map +0 -1
  277. package/esm/types/contracts/IOpInflator.d.ts +0 -61
  278. package/esm/types/contracts/IOpInflator.js +0 -80
  279. package/esm/types/contracts/IOpInflator.js.map +0 -1
  280. package/esm/types/contracts/IPaymaster.d.ts +0 -3
  281. package/esm/types/contracts/IPaymaster.js +0 -117
  282. package/esm/types/contracts/IPaymaster.js.map +0 -1
  283. package/esm/types/contracts/Inflator.d.ts +0 -65
  284. package/esm/types/contracts/Inflator.js +0 -84
  285. package/esm/types/contracts/Inflator.js.map +0 -1
  286. package/esm/types/contracts/PerOpInflator.d.ts +0 -176
  287. package/esm/types/contracts/PerOpInflator.js +0 -229
  288. package/esm/types/contracts/PerOpInflator.js.map +0 -1
  289. package/esm/types/contracts/PimlicoEntryPointSimulations.d.ts +0 -23
  290. package/esm/types/contracts/PimlicoEntryPointSimulations.js +0 -33
  291. package/esm/types/contracts/PimlicoEntryPointSimulations.js.map +0 -1
  292. package/esm/types/contracts/SenderCreator.d.ts +0 -4
  293. package/esm/types/contracts/SenderCreator.js +0 -23
  294. package/esm/types/contracts/SenderCreator.js.map +0 -1
  295. package/esm/types/contracts/SimpleAccountFactory.d.ts +0 -57
  296. package/esm/types/contracts/SimpleAccountFactory.js +0 -76
  297. package/esm/types/contracts/SimpleAccountFactory.js.map +0 -1
  298. package/esm/types/contracts/TestOpcodesAccount.d.ts +0 -4
  299. package/esm/types/contracts/TestOpcodesAccount.js +0 -281
  300. package/esm/types/contracts/TestOpcodesAccount.js.map +0 -1
  301. package/esm/types/contracts/TestOpcodesAccountFactory.d.ts +0 -4
  302. package/esm/types/contracts/TestOpcodesAccountFactory.js +0 -23
  303. package/esm/types/contracts/TestOpcodesAccountFactory.js.map +0 -1
  304. package/esm/types/contracts/TestStorageAccount.d.ts +0 -4
  305. package/esm/types/contracts/TestStorageAccount.js +0 -313
  306. package/esm/types/contracts/TestStorageAccount.js.map +0 -1
  307. package/esm/types/contracts/index.d.ts +0 -17
  308. package/esm/types/contracts/index.js +0 -17
  309. package/esm/types/contracts/index.js.map +0 -1
  310. package/esm/types/gasPrice.d.ts +0 -110
  311. package/esm/types/gasPrice.js +0 -52
  312. package/esm/types/gasPrice.js.map +0 -1
  313. package/esm/types/index.d.ts +0 -11
  314. package/esm/types/index.js +0 -11
  315. package/esm/types/index.js.map +0 -1
  316. package/esm/types/interfaces.d.ts +0 -26
  317. package/esm/types/interfaces.js +0 -2
  318. package/esm/types/interfaces.js.map +0 -1
  319. package/esm/types/mempool.d.ts +0 -79
  320. package/esm/types/mempool.js +0 -16
  321. package/esm/types/mempool.js.map +0 -1
  322. package/esm/types/schemas.d.ts +0 -4791
  323. package/esm/types/schemas.js +0 -497
  324. package/esm/types/schemas.js.map +0 -1
  325. package/esm/types/test/validationTestErrors.d.ts +0 -3
  326. package/esm/types/test/validationTestErrors.js +0 -229
  327. package/esm/types/test/validationTestErrors.js.map +0 -1
  328. package/esm/types/utils.d.ts +0 -24
  329. package/esm/types/utils.js +0 -30
  330. package/esm/types/utils.js.map +0 -1
  331. package/esm/types/validation.d.ts +0 -14327
  332. package/esm/types/validation.js +0 -304
  333. package/esm/types/validation.js.map +0 -1
  334. package/esm/utils/bigInt.d.ts +0 -3
  335. package/esm/utils/bigInt.js +0 -9
  336. package/esm/utils/bigInt.js.map +0 -1
  337. package/esm/utils/compressionHandler.d.ts +0 -11
  338. package/esm/utils/compressionHandler.js +0 -39
  339. package/esm/utils/compressionHandler.js.map +0 -1
  340. package/esm/utils/gasPriceManager.d.ts +0 -34
  341. package/esm/utils/gasPriceManager.js +0 -338
  342. package/esm/utils/gasPriceManager.js.map +0 -1
  343. package/esm/utils/helpers.d.ts +0 -4
  344. package/esm/utils/helpers.js +0 -13
  345. package/esm/utils/helpers.js.map +0 -1
  346. package/esm/utils/index.d.ts +0 -11
  347. package/esm/utils/index.js +0 -10
  348. package/esm/utils/index.js.map +0 -1
  349. package/esm/utils/logger.d.ts +0 -6
  350. package/esm/utils/logger.js +0 -76
  351. package/esm/utils/logger.js.map +0 -1
  352. package/esm/utils/metrics.d.ts +0 -22
  353. package/esm/utils/metrics.js +0 -150
  354. package/esm/utils/metrics.js.map +0 -1
  355. package/esm/utils/rpc-reply.d.ts +0 -17
  356. package/esm/utils/rpc-reply.js +0 -41
  357. package/esm/utils/rpc-reply.js.map +0 -1
  358. package/esm/utils/test.d.ts +0 -17
  359. package/esm/utils/test.js +0 -130
  360. package/esm/utils/test.js.map +0 -1
  361. package/esm/utils/userop.d.ts +0 -49
  362. package/esm/utils/userop.js +0 -408
  363. package/esm/utils/userop.js.map +0 -1
  364. package/esm/utils/validation.d.ts +0 -65
  365. package/esm/utils/validation.js +0 -461
  366. package/esm/utils/validation.js.map +0 -1
  367. package/lib/cli/alto.d.ts +0 -6
  368. package/lib/cli/alto.js +0 -123
  369. package/lib/cli/alto.js.map +0 -1
@@ -1,338 +0,0 @@
1
- import { RpcError, gasStationResult } from "../types/index.js";
2
- import { maxBigInt, minBigInt } from "./index.js";
3
- import * as sentry from "@sentry/node";
4
- import { parseGwei } from "viem";
5
- import * as chains from "viem/chains";
6
- var ChainId;
7
- (function (ChainId) {
8
- ChainId[ChainId["Goerli"] = 5] = "Goerli";
9
- ChainId[ChainId["Polygon"] = 137] = "Polygon";
10
- ChainId[ChainId["Mumbai"] = 80001] = "Mumbai";
11
- ChainId[ChainId["LineaTestnet"] = 59140] = "LineaTestnet";
12
- ChainId[ChainId["Linea"] = 59144] = "Linea";
13
- })(ChainId || (ChainId = {}));
14
- const MIN_POLYGON_GAS_PRICE = parseGwei("31");
15
- const MIN_MUMBAI_GAS_PRICE = parseGwei("1");
16
- function getGasStationUrl(chainId) {
17
- switch (chainId) {
18
- case ChainId.Polygon:
19
- return "https://gasstation.polygon.technology/v2";
20
- case ChainId.Mumbai:
21
- return "https://gasstation-testnet.polygon.technology/v2";
22
- }
23
- }
24
- export class GasPriceManager {
25
- chain;
26
- publicClient;
27
- legacyTransactions;
28
- logger;
29
- queueBaseFeePerGas = []; // Store pairs of [price, timestamp]
30
- queueMaxFeePerGas = []; // Store pairs of [price, timestamp]
31
- queueMaxPriorityFeePerGas = []; // Store pairs of [price, timestamp]
32
- maxQueueSize;
33
- gasBumpMultiplier;
34
- constructor(chain, publicClient, legacyTransactions, logger, gasBumpMultiplier, gasPriceTimeValidityInSeconds = 10) {
35
- this.maxQueueSize = gasPriceTimeValidityInSeconds;
36
- this.chain = chain;
37
- this.publicClient = publicClient;
38
- this.legacyTransactions = legacyTransactions;
39
- this.logger = logger;
40
- this.gasBumpMultiplier = gasBumpMultiplier;
41
- }
42
- getDefaultGasFee(chainId) {
43
- switch (chainId) {
44
- case ChainId.Polygon:
45
- return MIN_POLYGON_GAS_PRICE;
46
- case ChainId.Mumbai:
47
- return MIN_MUMBAI_GAS_PRICE;
48
- default:
49
- return 0n;
50
- }
51
- }
52
- async getPolygonGasPriceParameters() {
53
- const gasStationUrl = getGasStationUrl(this.chain.id);
54
- try {
55
- const data = await (await fetch(gasStationUrl)).json();
56
- // take the standard speed here, SDK options will define the extra tip
57
- const parsedData = gasStationResult.parse(data);
58
- return parsedData.fast;
59
- }
60
- catch (e) {
61
- this.logger.error({ error: e }, "failed to get gas price from gas station, using default");
62
- return null;
63
- }
64
- }
65
- bumpTheGasPrice(gasPriceParameters) {
66
- const bumpAmount = this.gasBumpMultiplier;
67
- const maxPriorityFeePerGas = maxBigInt(gasPriceParameters.maxPriorityFeePerGas, this.getDefaultGasFee(this.chain.id));
68
- const maxFeePerGas = maxBigInt(gasPriceParameters.maxFeePerGas, maxPriorityFeePerGas);
69
- const result = {
70
- maxFeePerGas: (maxFeePerGas * bumpAmount) / 100n,
71
- maxPriorityFeePerGas: (maxPriorityFeePerGas * bumpAmount) / 100n
72
- };
73
- if (this.chain.id === chains.celo.id ||
74
- this.chain.id === chains.celoAlfajores.id) {
75
- const maxFee = maxBigInt(result.maxFeePerGas, result.maxPriorityFeePerGas);
76
- return {
77
- maxFeePerGas: maxFee,
78
- maxPriorityFeePerGas: maxFee
79
- };
80
- }
81
- if (this.chain.id === chains.dfk.id) {
82
- const maxFeePerGas = maxBigInt(5000000000n, result.maxFeePerGas);
83
- const maxPriorityFeePerGas = maxBigInt(5000000000n, result.maxPriorityFeePerGas);
84
- return {
85
- maxFeePerGas,
86
- maxPriorityFeePerGas
87
- };
88
- }
89
- // set a minimum maxPriorityFee & maxFee to 1.5gwei on avalanche (because eth_maxPriorityFeePerGas returns 0)
90
- if (this.chain.id === chains.avalanche.id) {
91
- const maxFeePerGas = maxBigInt(parseGwei("1.5"), result.maxFeePerGas);
92
- const maxPriorityFeePerGas = maxBigInt(parseGwei("1.5"), result.maxPriorityFeePerGas);
93
- return {
94
- maxFeePerGas,
95
- maxPriorityFeePerGas
96
- };
97
- }
98
- return result;
99
- }
100
- async getFallBackMaxPriorityFeePerGas(publicClient, gasPrice) {
101
- const feeHistory = await publicClient.getFeeHistory({
102
- blockCount: 10,
103
- rewardPercentiles: [20],
104
- blockTag: "latest"
105
- });
106
- if (feeHistory.reward === undefined || feeHistory.reward === null) {
107
- return gasPrice;
108
- }
109
- const feeAverage = feeHistory.reward.reduce((acc, cur) => cur[0] + acc, 0n) / 10n;
110
- return minBigInt(feeAverage, gasPrice);
111
- }
112
- async getNextBaseFee(publicClient) {
113
- const block = await publicClient.getBlock({
114
- blockTag: "latest"
115
- });
116
- const currentBaseFeePerGas = block.baseFeePerGas || (await publicClient.getGasPrice());
117
- const currentGasUsed = block.gasUsed;
118
- const gasTarget = block.gasLimit / 2n;
119
- if (currentGasUsed === gasTarget) {
120
- return currentBaseFeePerGas;
121
- }
122
- if (currentGasUsed > gasTarget) {
123
- const gasUsedDelta = currentGasUsed - gasTarget;
124
- const baseFeePerGasDelta = maxBigInt((currentBaseFeePerGas * gasUsedDelta) / gasTarget / 8n, 1n);
125
- return currentBaseFeePerGas + baseFeePerGasDelta;
126
- }
127
- const gasUsedDelta = currentGasUsed - gasTarget;
128
- const baseFeePerGasDelta = (currentBaseFeePerGas * gasUsedDelta) / gasTarget / 8n;
129
- return currentBaseFeePerGas - baseFeePerGasDelta;
130
- }
131
- async getLegacyTransactionGasPrice() {
132
- let gasPrice;
133
- try {
134
- const gasInfo = await this.publicClient.estimateFeesPerGas({
135
- chain: this.chain,
136
- type: "legacy"
137
- });
138
- gasPrice = gasInfo.gasPrice;
139
- }
140
- catch (e) {
141
- sentry.captureException(e);
142
- this.logger.error("failed to fetch legacy gasPrices from estimateFeesPerGas", { error: e });
143
- gasPrice = undefined;
144
- }
145
- if (gasPrice === undefined) {
146
- this.logger.warn("gasPrice is undefined, using fallback value");
147
- try {
148
- gasPrice = await this.publicClient.getGasPrice();
149
- }
150
- catch (e) {
151
- this.logger.error("failed to get fallback gasPrice");
152
- sentry.captureException(e);
153
- throw e;
154
- }
155
- }
156
- return {
157
- maxFeePerGas: gasPrice,
158
- maxPriorityFeePerGas: gasPrice
159
- };
160
- }
161
- async estimateGasPrice() {
162
- let maxFeePerGas;
163
- let maxPriorityFeePerGas;
164
- try {
165
- const fees = await this.publicClient.estimateFeesPerGas({
166
- chain: this.chain
167
- });
168
- maxFeePerGas = fees.maxFeePerGas;
169
- maxPriorityFeePerGas = fees.maxPriorityFeePerGas;
170
- }
171
- catch (e) {
172
- sentry.captureException(e);
173
- this.logger.error("failed to fetch eip-1559 gasPrices from estimateFeesPerGas", { error: e });
174
- maxFeePerGas = undefined;
175
- maxPriorityFeePerGas = undefined;
176
- }
177
- if (maxPriorityFeePerGas === undefined) {
178
- this.logger.warn("maxPriorityFeePerGas is undefined, using fallback value");
179
- try {
180
- maxPriorityFeePerGas =
181
- await this.getFallBackMaxPriorityFeePerGas(this.publicClient, maxFeePerGas ?? 0n);
182
- }
183
- catch (e) {
184
- this.logger.error("failed to get fallback maxPriorityFeePerGas");
185
- sentry.captureException(e);
186
- throw e;
187
- }
188
- }
189
- if (maxFeePerGas === undefined) {
190
- this.logger.warn("maxFeePerGas is undefined, using fallback value");
191
- try {
192
- maxFeePerGas =
193
- (await this.getNextBaseFee(this.publicClient)) +
194
- maxPriorityFeePerGas;
195
- }
196
- catch (e) {
197
- this.logger.error("failed to get fallback maxFeePerGas");
198
- sentry.captureException(e);
199
- throw e;
200
- }
201
- }
202
- if (maxPriorityFeePerGas === 0n) {
203
- maxPriorityFeePerGas = maxFeePerGas / 200n;
204
- }
205
- return { maxFeePerGas, maxPriorityFeePerGas };
206
- }
207
- saveBaseFeePerGas(gasPrice, timestamp) {
208
- const queue = this.queueBaseFeePerGas;
209
- const last = queue.length > 0 ? queue[queue.length - 1] : null;
210
- if (!last || timestamp - last.timestamp >= 1000) {
211
- if (queue.length >= this.maxQueueSize) {
212
- queue.shift();
213
- }
214
- queue.push({ baseFeePerGas: gasPrice, timestamp });
215
- }
216
- else if (gasPrice < last.baseFeePerGas) {
217
- last.baseFeePerGas = gasPrice;
218
- last.timestamp = timestamp;
219
- }
220
- }
221
- saveMaxFeePerGas(gasPrice, timestamp) {
222
- const queue = this.queueMaxFeePerGas;
223
- const last = queue.length > 0 ? queue[queue.length - 1] : null;
224
- if (!last || timestamp - last.timestamp >= 1000) {
225
- if (queue.length >= this.maxQueueSize) {
226
- queue.shift();
227
- }
228
- queue.push({ maxFeePerGas: gasPrice, timestamp });
229
- }
230
- else if (gasPrice < last.maxFeePerGas) {
231
- last.maxFeePerGas = gasPrice;
232
- last.timestamp = timestamp;
233
- }
234
- }
235
- saveMaxPriorityFeePerGas(gasPrice, timestamp) {
236
- const queue = this.queueMaxPriorityFeePerGas;
237
- const last = queue.length > 0 ? queue[queue.length - 1] : null;
238
- if (!last || timestamp - last.timestamp >= 1000) {
239
- if (queue.length >= this.maxQueueSize) {
240
- queue.shift();
241
- }
242
- queue.push({ maxPriorityFeePerGas: gasPrice, timestamp });
243
- }
244
- else if (gasPrice < last.maxPriorityFeePerGas) {
245
- last.maxPriorityFeePerGas = gasPrice;
246
- last.timestamp = timestamp;
247
- }
248
- }
249
- saveGasPrice(gasPrice, timestamp) {
250
- return new Promise((resolve) => {
251
- this.saveMaxFeePerGas(gasPrice.maxFeePerGas, timestamp);
252
- this.saveMaxPriorityFeePerGas(gasPrice.maxPriorityFeePerGas, timestamp);
253
- resolve();
254
- });
255
- }
256
- async innerGetGasPrice() {
257
- let maxFeePerGas = 0n;
258
- let maxPriorityFeePerGas = 0n;
259
- if (this.chain.id === chains.polygon.id ||
260
- this.chain.id === chains.polygonMumbai.id) {
261
- const polygonEstimate = await this.getPolygonGasPriceParameters();
262
- if (polygonEstimate) {
263
- const gasPrice = this.bumpTheGasPrice({
264
- maxFeePerGas: polygonEstimate.maxFeePerGas,
265
- maxPriorityFeePerGas: polygonEstimate.maxPriorityFeePerGas
266
- });
267
- return {
268
- maxFeePerGas: maxBigInt(gasPrice.maxFeePerGas, maxFeePerGas),
269
- maxPriorityFeePerGas: maxBigInt(gasPrice.maxPriorityFeePerGas, maxPriorityFeePerGas)
270
- };
271
- }
272
- }
273
- if (this.legacyTransactions) {
274
- const gasPrice = this.bumpTheGasPrice(await this.getLegacyTransactionGasPrice());
275
- return {
276
- maxFeePerGas: maxBigInt(gasPrice.maxFeePerGas, maxFeePerGas),
277
- maxPriorityFeePerGas: maxBigInt(gasPrice.maxPriorityFeePerGas, maxPriorityFeePerGas)
278
- };
279
- }
280
- const estimatedPrice = await this.estimateGasPrice();
281
- maxFeePerGas = estimatedPrice.maxFeePerGas;
282
- maxPriorityFeePerGas = estimatedPrice.maxPriorityFeePerGas;
283
- const gasPrice = this.bumpTheGasPrice({
284
- maxFeePerGas,
285
- maxPriorityFeePerGas
286
- });
287
- return {
288
- maxFeePerGas: maxBigInt(gasPrice.maxFeePerGas, maxFeePerGas),
289
- maxPriorityFeePerGas: maxBigInt(gasPrice.maxPriorityFeePerGas, maxPriorityFeePerGas)
290
- };
291
- }
292
- async getBaseFee() {
293
- const latestBlock = await this.publicClient.getBlock();
294
- if (latestBlock.baseFeePerGas === null) {
295
- throw new RpcError("block does not have baseFeePerGas");
296
- }
297
- const baseFee = latestBlock.baseFeePerGas;
298
- this.saveBaseFeePerGas(baseFee, Date.now());
299
- return baseFee;
300
- }
301
- async getGasPrice() {
302
- const gasPrice = await this.innerGetGasPrice();
303
- this.saveGasPrice({
304
- maxFeePerGas: gasPrice.maxFeePerGas,
305
- maxPriorityFeePerGas: gasPrice.maxPriorityFeePerGas
306
- }, Date.now());
307
- return gasPrice;
308
- }
309
- async getMaxBaseFeePerGas() {
310
- if (this.queueBaseFeePerGas.length === 0) {
311
- await this.getBaseFee();
312
- }
313
- return this.queueBaseFeePerGas.reduce((acc, cur) => maxBigInt(cur.baseFeePerGas, acc), this.queueBaseFeePerGas[0].baseFeePerGas);
314
- }
315
- async getMinMaxFeePerGas() {
316
- if (this.queueMaxFeePerGas.length === 0) {
317
- await this.getGasPrice();
318
- }
319
- return this.queueMaxFeePerGas.reduce((acc, cur) => minBigInt(cur.maxFeePerGas, acc), this.queueMaxFeePerGas[0].maxFeePerGas);
320
- }
321
- async getMinMaxPriorityFeePerGas() {
322
- if (this.queueMaxPriorityFeePerGas.length === 0) {
323
- await this.getGasPrice();
324
- }
325
- return this.queueMaxPriorityFeePerGas.reduce((acc, cur) => minBigInt(cur.maxPriorityFeePerGas, acc), this.queueMaxPriorityFeePerGas[0].maxPriorityFeePerGas);
326
- }
327
- async validateGasPrice(gasPrice) {
328
- const lowestMaxFeePerGas = await this.getMinMaxFeePerGas();
329
- const lowestMaxPriorityFeePerGas = await this.getMinMaxPriorityFeePerGas();
330
- if (gasPrice.maxFeePerGas < lowestMaxFeePerGas) {
331
- throw new RpcError(`maxFeePerGas must be at least ${lowestMaxFeePerGas} (current maxFeePerGas: ${gasPrice.maxFeePerGas}) - use pimlico_getUserOperationGasPrice to get the current gas price`);
332
- }
333
- if (gasPrice.maxPriorityFeePerGas < lowestMaxPriorityFeePerGas) {
334
- throw new RpcError(`maxPriorityFeePerGas must be at least ${lowestMaxPriorityFeePerGas} (current maxPriorityFeePerGas: ${gasPrice.maxPriorityFeePerGas}) - use pimlico_getUserOperationGasPrice to get the current gas price`);
335
- }
336
- }
337
- }
338
- //# sourceMappingURL=gasPriceManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gasPriceManager.js","sourceRoot":"","sources":["../../utils/gasPriceManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,QAAQ,EACR,gBAAgB,EAEnB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,SAAS,EAAE,SAAS,EAAe,MAAM,aAAa,CAAA;AAC/D,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,SAAS,EAAiC,MAAM,MAAM,CAAA;AAC/D,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAErC,IAAK,OAMJ;AAND,WAAK,OAAO;IACR,yCAAU,CAAA;IACV,6CAAa,CAAA;IACb,6CAAc,CAAA;IACd,yDAAoB,CAAA;IACpB,2CAAa,CAAA;AACjB,CAAC,EANI,OAAO,KAAP,OAAO,QAMX;AAED,MAAM,qBAAqB,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;AAC7C,MAAM,oBAAoB,GAAG,SAAS,CAAC,GAAG,CAAC,CAAA;AAE3C,SAAS,gBAAgB,CAAC,OAAyC;IAC/D,QAAQ,OAAO,EAAE,CAAC;QACd,KAAK,OAAO,CAAC,OAAO;YAChB,OAAO,0CAA0C,CAAA;QACrD,KAAK,OAAO,CAAC,MAAM;YACf,OAAO,kDAAkD,CAAA;IACjE,CAAC;AACL,CAAC;AAED,MAAM,OAAO,eAAe;IAChB,KAAK,CAAO;IACZ,YAAY,CAAc;IAC1B,kBAAkB,CAAS;IAC3B,MAAM,CAAQ;IACd,kBAAkB,GACtB,EAA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AAC,MAAM,CACxC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,oBAAoB,EAAE,GAAG,CAAC,EACtD,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,oBAAoB,CACzD,CAAA;IACL,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,QAA4B;QACtD,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAA;QAC1D,MAAM,0BAA0B,GAC5B,MAAM,IAAI,CAAC,0BAA0B,EAAE,CAAA;QAE3C,IAAI,QAAQ,CAAC,YAAY,GAAG,kBAAkB,EAAE,CAAC;YAC7C,MAAM,IAAI,QAAQ,CACd,iCAAiC,kBAAkB,2BAA2B,QAAQ,CAAC,YAAY,uEAAuE,CAC7K,CAAA;QACL,CAAC;QAED,IAAI,QAAQ,CAAC,oBAAoB,GAAG,0BAA0B,EAAE,CAAC;YAC7D,MAAM,IAAI,QAAQ,CACd,yCAAyC,0BAA0B,mCAAmC,QAAQ,CAAC,oBAAoB,uEAAuE,CAC7M,CAAA;QACL,CAAC;IACL,CAAC;CACJ"}
@@ -1,4 +0,0 @@
1
- import { type Address } from "viem";
2
- export declare const areAddressesEqual: (a: Address, b: Address) => boolean;
3
- export declare function getRevertErrorData(err: unknown): `0x${string}` | undefined;
4
- //# sourceMappingURL=helpers.d.ts.map
@@ -1,13 +0,0 @@
1
- import { getAddress, BaseError } from "viem";
2
- /// Ensure proper equality by converting both addresses into their checksum type
3
- export const areAddressesEqual = (a, b) => {
4
- return getAddress(a) === getAddress(b);
5
- };
6
- export function getRevertErrorData(err) {
7
- // biome-ignore lint/style/useBlockStatements:
8
- if (!(err instanceof BaseError))
9
- return undefined;
10
- const error = err.walk();
11
- return typeof error?.data === "object" ? error.data?.data : error.data;
12
- }
13
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,UAAU,EACV,SAAS,EAEZ,MAAM,MAAM,CAAA;AAEb,gFAAgF;AAChF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAU,EAAE,CAAU,EAAE,EAAE;IACxD,OAAO,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,CAAA;AAC1C,CAAC,CAAA;AAED,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC3C,8CAA8C;IAC9C,IAAI,CAAC,CAAC,GAAG,YAAY,SAAS,CAAC;QAAE,OAAO,SAAS,CAAA;IACjD,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAsB,CAAA;IAC5C,OAAO,OAAO,KAAK,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAA;AAC1E,CAAC"}
@@ -1,11 +0,0 @@
1
- export * from "./logger.js";
2
- export * from "./metrics.js";
3
- export * from "./bigInt.js";
4
- export * from "./gasPriceManager.js";
5
- export * from "./test.js";
6
- export * from "./validation.js";
7
- export * from "./userop.js";
8
- export * from "./compressionHandler.js";
9
- export * from "./helpers.js";
10
- export { Logger } from "pino";
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,10 +0,0 @@
1
- export * from "./logger.js";
2
- export * from "./metrics.js";
3
- export * from "./bigInt.js";
4
- export * from "./gasPriceManager.js";
5
- export * from "./test.js";
6
- export * from "./validation.js";
7
- export * from "./userop.js";
8
- export * from "./compressionHandler.js";
9
- export * from "./helpers.js";
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,mBAAmB,CAAA;AACjC,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,sBAAsB,CAAA;AACpC,cAAc,WAAW,CAAA"}
@@ -1,6 +0,0 @@
1
- import type { Logger } from "./index.js";
2
- import { type SerializerFn } from "pino";
3
- export declare const customSerializer: SerializerFn;
4
- export declare const initDebugLogger: (level?: string) => Logger;
5
- export declare const initProductionLogger: (level: string) => Logger;
6
- //# sourceMappingURL=logger.d.ts.map
@@ -1,76 +0,0 @@
1
- import logger from "pino";
2
- import { toHex } from "viem";
3
- // biome-ignore lint/suspicious/noExplicitAny: it's a generic type
4
- function bigintToJson(_key, value) {
5
- if (typeof value === "bigint") {
6
- return toHex(value);
7
- }
8
- return value;
9
- }
10
- function logLevel(label) {
11
- return {
12
- level: label
13
- };
14
- }
15
- function stringifyWithCircularHandling(obj,
16
- // biome-ignore lint/suspicious/noExplicitAny: it's a generic type
17
- replacer) {
18
- // biome-ignore lint/suspicious/noExplicitAny: it's a generic type
19
- const cache = new Set();
20
- return JSON.stringify(obj, (key, value) => {
21
- if (typeof value === "object" && value !== null) {
22
- if (cache.has(value)) {
23
- return; // Circular reference found, discard the key
24
- }
25
- cache.add(value);
26
- }
27
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
28
- return replacer ? replacer(key, value) : value;
29
- });
30
- }
31
- export const customSerializer = (input) => {
32
- const output = {};
33
- for (const key in input) {
34
- if (Object.prototype.hasOwnProperty.call(input, key)) {
35
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
36
- const value = input[key];
37
- if (typeof value === "object" && value !== null) {
38
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-argument
39
- output[key] = JSON.parse(stringifyWithCircularHandling(value, bigintToJson));
40
- }
41
- else {
42
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
43
- output[key] = bigintToJson(key, value);
44
- }
45
- }
46
- }
47
- return output;
48
- };
49
- export const initDebugLogger = (level = "debug") => {
50
- const l = logger({
51
- transport: {
52
- target: "pino-pretty",
53
- options: {
54
- colorize: true
55
- }
56
- },
57
- formatters: {
58
- level: logLevel,
59
- log: customSerializer
60
- }
61
- });
62
- l.level = level;
63
- return l;
64
- };
65
- export const initProductionLogger = (level) => {
66
- const l = logger({
67
- base: undefined, // do not log pid and hostname, we don't need it
68
- formatters: {
69
- level: logLevel,
70
- log: customSerializer
71
- }
72
- });
73
- l.level = level;
74
- return l;
75
- };
76
- //# sourceMappingURL=logger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../utils/logger.ts"],"names":[],"mappings":"AACA,OAAO,MAA6B,MAAM,MAAM,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAM5B,kEAAkE;AAClE,SAAS,YAAY,CAAC,IAAY,EAAE,KAAU;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC,KAAK,CAAC,CAAA;IACvB,CAAC;IACD,OAAO,KAAK,CAAA;AAChB,CAAC;AAED,SAAS,QAAQ,CAAC,KAAa;IAC3B,OAAO;QACH,KAAK,EAAE,KAAK;KACf,CAAA;AACL,CAAC;AAED,SAAS,6BAA6B,CAClC,GAAc;AACd,kEAAkE;AAClE,QAA2C;IAE3C,kEAAkE;IAClE,MAAM,KAAK,GAAa,IAAI,GAAG,EAAE,CAAA;IACjC,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QACtC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YAC9C,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;gBACnB,OAAM,CAAC,4CAA4C;YACvD,CAAC;YACD,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QACpB,CAAC;QACD,+DAA+D;QAC/D,OA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CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAa,EAAU,EAAE;IAC1D,MAAM,CAAC,GAAG,MAAM,CAAC;QACb,IAAI,EAAE,SAAS,EAAE,gDAAgD;QACjE,UAAU,EAAE;YACR,KAAK,EAAE,QAAQ;YACf,GAAG,EAAE,gBAAgB;SACxB;KACJ,CAAC,CAAA;IACF,CAAC,CAAC,KAAK,GAAG,KAAK,CAAA;IACf,OAAO,CAAC,CAAA;AACZ,CAAC,CAAA"}
@@ -1,22 +0,0 @@
1
- import { Counter, Gauge, Histogram, type Registry } from "prom-client";
2
- export type Metrics = ReturnType<typeof createMetrics>;
3
- export declare function createMetrics(registry: Registry, register?: boolean): {
4
- httpRequests: Counter<"code" | "method" | "route" | "network" | "chainId" | "rpc_method" | "rpc_status">;
5
- httpRequestsDuration: Histogram<"code" | "method" | "route" | "network" | "chainId" | "rpc_method" | "rpc_status" | "api_version">;
6
- userOperationsInMempool: Gauge<"status" | "network" | "chainId">;
7
- walletsAvailable: Gauge<never>;
8
- walletsTotal: Gauge<never>;
9
- userOperationsOnChain: Counter<"status">;
10
- userOperationsSubmitted: Counter<"status">;
11
- bundlesIncluded: Counter<never>;
12
- bundlesSubmitted: Counter<"status">;
13
- userOperationsReceived: Counter<"type" | "status">;
14
- userOperationsValidationSuccess: Counter<never>;
15
- userOperationsValidationFailure: Counter<never>;
16
- userOperationInclusionDuration: Histogram<never>;
17
- verificationGasLimitEstimationTime: Histogram<never>;
18
- verificationGasLimitEstimationCount: Histogram<never>;
19
- replacedTransactions: Counter<"reason" | "status">;
20
- userOperationsResubmitted: Counter<never>;
21
- };
22
- //# sourceMappingURL=metrics.d.ts.map