@pimlico/alto 0.0.0-staging.20240606T115633 → 0.0.2

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 (228) hide show
  1. package/LICENSE +674 -0
  2. package/lib/executor/executor.js +6 -0
  3. package/lib/executor/executor.js.map +1 -1
  4. package/lib/executor/executorManager.js +1 -0
  5. package/lib/executor/executorManager.js.map +1 -1
  6. package/lib/executor/utils.js +3 -1
  7. package/lib/executor/utils.js.map +1 -1
  8. package/lib/types/mempool.d.ts +2 -1
  9. package/package.json +10 -11
  10. package/esm/cli/alto.d.ts +0 -6
  11. package/esm/cli/alto.js +0 -92
  12. package/esm/cli/alto.js.map +0 -1
  13. package/esm/cli/config/bundler.d.ts +0 -391
  14. package/esm/cli/config/bundler.js +0 -132
  15. package/esm/cli/config/bundler.js.map +0 -1
  16. package/esm/cli/config/index.d.ts +0 -3
  17. package/esm/cli/config/index.js +0 -3
  18. package/esm/cli/config/index.js.map +0 -1
  19. package/esm/cli/config/options.d.ts +0 -11
  20. package/esm/cli/config/options.js +0 -336
  21. package/esm/cli/config/options.js.map +0 -1
  22. package/esm/cli/customTransport.d.ts +0 -14
  23. package/esm/cli/customTransport.js +0 -53
  24. package/esm/cli/customTransport.js.map +0 -1
  25. package/esm/cli/handler.d.ts +0 -3
  26. package/esm/cli/handler.js +0 -116
  27. package/esm/cli/handler.js.map +0 -1
  28. package/esm/cli/index.d.ts +0 -4
  29. package/esm/cli/index.js +0 -4
  30. package/esm/cli/index.js.map +0 -1
  31. package/esm/cli/instrumentation.d.ts +0 -2
  32. package/esm/cli/instrumentation.js +0 -39
  33. package/esm/cli/instrumentation.js.map +0 -1
  34. package/esm/cli/setupServer.d.ts +0 -17
  35. package/esm/cli/setupServer.js +0 -155
  36. package/esm/cli/setupServer.js.map +0 -1
  37. package/esm/cli/util.d.ts +0 -22
  38. package/esm/cli/util.js +0 -30
  39. package/esm/cli/util.js.map +0 -1
  40. package/esm/executor/executor.d.ts +0 -54
  41. package/esm/executor/executor.js +0 -637
  42. package/esm/executor/executor.js.map +0 -1
  43. package/esm/executor/executorManager.d.ts +0 -34
  44. package/esm/executor/executorManager.js +0 -401
  45. package/esm/executor/executorManager.js.map +0 -1
  46. package/esm/executor/index.d.ts +0 -5
  47. package/esm/executor/index.js +0 -5
  48. package/esm/executor/index.js.map +0 -1
  49. package/esm/executor/senderManager.d.ts +0 -17
  50. package/esm/executor/senderManager.js +0 -160
  51. package/esm/executor/senderManager.js.map +0 -1
  52. package/esm/executor/test/utils.d.ts +0 -13
  53. package/esm/executor/test/utils.js +0 -75
  54. package/esm/executor/test/utils.js.map +0 -1
  55. package/esm/executor/utils.d.ts +0 -32
  56. package/esm/executor/utils.js +0 -239
  57. package/esm/executor/utils.js.map +0 -1
  58. package/esm/index.d.ts +0 -2
  59. package/esm/index.js +0 -2
  60. package/esm/index.js.map +0 -1
  61. package/esm/mempool/index.d.ts +0 -5
  62. package/esm/mempool/index.js +0 -5
  63. package/esm/mempool/index.js.map +0 -1
  64. package/esm/mempool/mempool.d.ts +0 -64
  65. package/esm/mempool/mempool.js +0 -489
  66. package/esm/mempool/mempool.js.map +0 -1
  67. package/esm/mempool/monitoring.d.ts +0 -10
  68. package/esm/mempool/monitoring.js +0 -34
  69. package/esm/mempool/monitoring.js.map +0 -1
  70. package/esm/mempool/nullMempool.d.ts +0 -15
  71. package/esm/mempool/nullMempool.js +0 -36
  72. package/esm/mempool/nullMempool.js.map +0 -1
  73. package/esm/mempool/reputationManager.d.ts +0 -115
  74. package/esm/mempool/reputationManager.js +0 -397
  75. package/esm/mempool/reputationManager.js.map +0 -1
  76. package/esm/mempool/store.d.ts +0 -22
  77. package/esm/mempool/store.js +0 -123
  78. package/esm/mempool/store.js.map +0 -1
  79. package/esm/rpc/EntryPointSimulationsV07.d.ts +0 -58
  80. package/esm/rpc/EntryPointSimulationsV07.js +0 -407
  81. package/esm/rpc/EntryPointSimulationsV07.js.map +0 -1
  82. package/esm/rpc/ExecuteSimulator.d.ts +0 -37
  83. package/esm/rpc/ExecuteSimulator.js +0 -48
  84. package/esm/rpc/ExecuteSimulator.js.map +0 -1
  85. package/esm/rpc/gasEstimation.d.ts +0 -17
  86. package/esm/rpc/gasEstimation.js +0 -410
  87. package/esm/rpc/gasEstimation.js.map +0 -1
  88. package/esm/rpc/index.d.ts +0 -5
  89. package/esm/rpc/index.js +0 -5
  90. package/esm/rpc/index.js.map +0 -1
  91. package/esm/rpc/nonceQueuer.d.ts +0 -25
  92. package/esm/rpc/nonceQueuer.js +0 -135
  93. package/esm/rpc/nonceQueuer.js.map +0 -1
  94. package/esm/rpc/rpcHandler.d.ts +0 -64
  95. package/esm/rpc/rpcHandler.js +0 -727
  96. package/esm/rpc/rpcHandler.js.map +0 -1
  97. package/esm/rpc/server.d.ts +0 -31
  98. package/esm/rpc/server.js +0 -239
  99. package/esm/rpc/server.js.map +0 -1
  100. package/esm/rpc/validation/BundlerCollectorTracerV06.d.ts +0 -102
  101. package/esm/rpc/validation/BundlerCollectorTracerV06.js +0 -255
  102. package/esm/rpc/validation/BundlerCollectorTracerV06.js.map +0 -1
  103. package/esm/rpc/validation/BundlerCollectorTracerV07.d.ts +0 -102
  104. package/esm/rpc/validation/BundlerCollectorTracerV07.js +0 -254
  105. package/esm/rpc/validation/BundlerCollectorTracerV07.js.map +0 -1
  106. package/esm/rpc/validation/SafeValidator.d.ts +0 -35
  107. package/esm/rpc/validation/SafeValidator.js +0 -487
  108. package/esm/rpc/validation/SafeValidator.js.map +0 -1
  109. package/esm/rpc/validation/TracerResultParserV06.d.ts +0 -13
  110. package/esm/rpc/validation/TracerResultParserV06.js +0 -578
  111. package/esm/rpc/validation/TracerResultParserV06.js.map +0 -1
  112. package/esm/rpc/validation/TracerResultParserV07.d.ts +0 -33
  113. package/esm/rpc/validation/TracerResultParserV07.js +0 -557
  114. package/esm/rpc/validation/TracerResultParserV07.js.map +0 -1
  115. package/esm/rpc/validation/UnsafeValidator.d.ts +0 -63
  116. package/esm/rpc/validation/UnsafeValidator.js +0 -257
  117. package/esm/rpc/validation/UnsafeValidator.js.map +0 -1
  118. package/esm/rpc/validation/index.d.ts +0 -3
  119. package/esm/rpc/validation/index.js +0 -3
  120. package/esm/rpc/validation/index.js.map +0 -1
  121. package/esm/rpc/validation/tracer.d.ts +0 -122
  122. package/esm/rpc/validation/tracer.js +0 -82
  123. package/esm/rpc/validation/tracer.js.map +0 -1
  124. package/esm/types/contracts/BundleBulker.d.ts +0 -120
  125. package/esm/types/contracts/BundleBulker.js +0 -157
  126. package/esm/types/contracts/BundleBulker.js.map +0 -1
  127. package/esm/types/contracts/CallEngine.d.ts +0 -28
  128. package/esm/types/contracts/CallEngine.js +0 -37
  129. package/esm/types/contracts/CallEngine.js.map +0 -1
  130. package/esm/types/contracts/CodeHashGetter.d.ts +0 -37
  131. package/esm/types/contracts/CodeHashGetter.js +0 -45
  132. package/esm/types/contracts/CodeHashGetter.js.map +0 -1
  133. package/esm/types/contracts/EntryPoint.d.ts +0 -1789
  134. package/esm/types/contracts/EntryPoint.js +0 -2304
  135. package/esm/types/contracts/EntryPoint.js.map +0 -1
  136. package/esm/types/contracts/EntryPointSimulations.d.ts +0 -153
  137. package/esm/types/contracts/EntryPointSimulations.js +0 -15
  138. package/esm/types/contracts/EntryPointSimulations.js.map +0 -1
  139. package/esm/types/contracts/IOpInflator.d.ts +0 -61
  140. package/esm/types/contracts/IOpInflator.js +0 -80
  141. package/esm/types/contracts/IOpInflator.js.map +0 -1
  142. package/esm/types/contracts/IPaymaster.d.ts +0 -3
  143. package/esm/types/contracts/IPaymaster.js +0 -117
  144. package/esm/types/contracts/IPaymaster.js.map +0 -1
  145. package/esm/types/contracts/Inflator.d.ts +0 -65
  146. package/esm/types/contracts/Inflator.js +0 -84
  147. package/esm/types/contracts/Inflator.js.map +0 -1
  148. package/esm/types/contracts/PerOpInflator.d.ts +0 -176
  149. package/esm/types/contracts/PerOpInflator.js +0 -229
  150. package/esm/types/contracts/PerOpInflator.js.map +0 -1
  151. package/esm/types/contracts/PimlicoEntryPointSimulations.d.ts +0 -23
  152. package/esm/types/contracts/PimlicoEntryPointSimulations.js +0 -33
  153. package/esm/types/contracts/PimlicoEntryPointSimulations.js.map +0 -1
  154. package/esm/types/contracts/SenderCreator.d.ts +0 -4
  155. package/esm/types/contracts/SenderCreator.js +0 -23
  156. package/esm/types/contracts/SenderCreator.js.map +0 -1
  157. package/esm/types/contracts/SimpleAccountFactory.d.ts +0 -57
  158. package/esm/types/contracts/SimpleAccountFactory.js +0 -76
  159. package/esm/types/contracts/SimpleAccountFactory.js.map +0 -1
  160. package/esm/types/contracts/TestOpcodesAccount.d.ts +0 -4
  161. package/esm/types/contracts/TestOpcodesAccount.js +0 -281
  162. package/esm/types/contracts/TestOpcodesAccount.js.map +0 -1
  163. package/esm/types/contracts/TestOpcodesAccountFactory.d.ts +0 -4
  164. package/esm/types/contracts/TestOpcodesAccountFactory.js +0 -23
  165. package/esm/types/contracts/TestOpcodesAccountFactory.js.map +0 -1
  166. package/esm/types/contracts/TestStorageAccount.d.ts +0 -4
  167. package/esm/types/contracts/TestStorageAccount.js +0 -313
  168. package/esm/types/contracts/TestStorageAccount.js.map +0 -1
  169. package/esm/types/contracts/index.d.ts +0 -17
  170. package/esm/types/contracts/index.js +0 -17
  171. package/esm/types/contracts/index.js.map +0 -1
  172. package/esm/types/gasPrice.d.ts +0 -110
  173. package/esm/types/gasPrice.js +0 -52
  174. package/esm/types/gasPrice.js.map +0 -1
  175. package/esm/types/index.d.ts +0 -11
  176. package/esm/types/index.js +0 -11
  177. package/esm/types/index.js.map +0 -1
  178. package/esm/types/interfaces.d.ts +0 -26
  179. package/esm/types/interfaces.js +0 -2
  180. package/esm/types/interfaces.js.map +0 -1
  181. package/esm/types/mempool.d.ts +0 -78
  182. package/esm/types/mempool.js +0 -16
  183. package/esm/types/mempool.js.map +0 -1
  184. package/esm/types/schemas.d.ts +0 -4791
  185. package/esm/types/schemas.js +0 -497
  186. package/esm/types/schemas.js.map +0 -1
  187. package/esm/types/test/validationTestErrors.d.ts +0 -3
  188. package/esm/types/test/validationTestErrors.js +0 -229
  189. package/esm/types/test/validationTestErrors.js.map +0 -1
  190. package/esm/types/utils.d.ts +0 -24
  191. package/esm/types/utils.js +0 -30
  192. package/esm/types/utils.js.map +0 -1
  193. package/esm/types/validation.d.ts +0 -14327
  194. package/esm/types/validation.js +0 -304
  195. package/esm/types/validation.js.map +0 -1
  196. package/esm/utils/bigInt.d.ts +0 -3
  197. package/esm/utils/bigInt.js +0 -9
  198. package/esm/utils/bigInt.js.map +0 -1
  199. package/esm/utils/compressionHandler.d.ts +0 -11
  200. package/esm/utils/compressionHandler.js +0 -39
  201. package/esm/utils/compressionHandler.js.map +0 -1
  202. package/esm/utils/gasPriceManager.d.ts +0 -34
  203. package/esm/utils/gasPriceManager.js +0 -338
  204. package/esm/utils/gasPriceManager.js.map +0 -1
  205. package/esm/utils/helpers.d.ts +0 -4
  206. package/esm/utils/helpers.js +0 -13
  207. package/esm/utils/helpers.js.map +0 -1
  208. package/esm/utils/index.d.ts +0 -11
  209. package/esm/utils/index.js +0 -10
  210. package/esm/utils/index.js.map +0 -1
  211. package/esm/utils/logger.d.ts +0 -6
  212. package/esm/utils/logger.js +0 -76
  213. package/esm/utils/logger.js.map +0 -1
  214. package/esm/utils/metrics.d.ts +0 -22
  215. package/esm/utils/metrics.js +0 -150
  216. package/esm/utils/metrics.js.map +0 -1
  217. package/esm/utils/rpc-reply.d.ts +0 -17
  218. package/esm/utils/rpc-reply.js +0 -41
  219. package/esm/utils/rpc-reply.js.map +0 -1
  220. package/esm/utils/test.d.ts +0 -17
  221. package/esm/utils/test.js +0 -130
  222. package/esm/utils/test.js.map +0 -1
  223. package/esm/utils/userop.d.ts +0 -49
  224. package/esm/utils/userop.js +0 -408
  225. package/esm/utils/userop.js.map +0 -1
  226. package/esm/utils/validation.d.ts +0 -65
  227. package/esm/utils/validation.js +0 -461
  228. package/esm/utils/validation.js.map +0 -1
@@ -1,150 +0,0 @@
1
- import { Counter, Gauge, Histogram, collectDefaultMetrics } from "prom-client";
2
- export function createMetrics(registry, register = true) {
3
- collectDefaultMetrics({ register: registry });
4
- const registers = register ? [registry] : [];
5
- const httpRequests = new Counter({
6
- name: "alto_requests_total",
7
- help: "Total number of requests",
8
- labelNames: [
9
- "route",
10
- "network",
11
- "chainId",
12
- "rpc_method",
13
- "rpc_status",
14
- "code",
15
- "method"
16
- ],
17
- registers
18
- });
19
- const httpRequestsDuration = new Histogram({
20
- name: "alto_requests_duration_seconds",
21
- help: "Duration of requests in seconds",
22
- labelNames: [
23
- "route",
24
- "network",
25
- "chainId",
26
- "rpc_method",
27
- "rpc_status",
28
- "code",
29
- "method",
30
- "api_version"
31
- ],
32
- registers
33
- });
34
- const userOperationsInMempool = new Gauge({
35
- name: "alto_user_operations_in_mempool_count",
36
- help: "Number of user operations in mempool",
37
- labelNames: ["network", "chainId", "status"],
38
- registers
39
- });
40
- const walletsAvailable = new Gauge({
41
- name: "alto_executor_wallets_available_count",
42
- help: "Number of available executor wallets used to bundle",
43
- labelNames: [],
44
- registers
45
- });
46
- const walletsTotal = new Gauge({
47
- name: "alto_executor_wallets_total_count",
48
- help: "Number of total executor wallets used to bundle",
49
- labelNames: [],
50
- registers
51
- });
52
- const userOperationsOnChain = new Counter({
53
- name: "alto_user_operations_on_chain_total",
54
- help: "Number of user operations on-chain by status",
55
- labelNames: ["status"],
56
- registers
57
- });
58
- const userOperationsSubmitted = new Counter({
59
- name: "alto_user_operations_submitted_total",
60
- help: "Number of user operations bundles submitted on-chain",
61
- labelNames: ["status"],
62
- registers
63
- });
64
- const bundlesIncluded = new Counter({
65
- name: "alto_bundles_included_total",
66
- help: "Number of user operations bundles included on-chain",
67
- labelNames: [],
68
- registers
69
- });
70
- const bundlesSubmitted = new Counter({
71
- name: "alto_bundles_submitted_total",
72
- help: "Number of user operations bundles submitted on-chain",
73
- labelNames: ["status"],
74
- registers
75
- });
76
- const userOperationsReceived = new Counter({
77
- name: "alto_user_operations_received_total",
78
- help: "Number of user operations received",
79
- labelNames: ["status", "type"],
80
- registers
81
- });
82
- const userOperationsValidationSuccess = new Counter({
83
- name: "alto_user_operations_validation_success_total",
84
- help: "Number of user operations successfully validated",
85
- labelNames: [],
86
- registers
87
- });
88
- const userOperationsValidationFailure = new Counter({
89
- name: "alto_user_operations_validation_failure_total",
90
- help: "Number of user operations failed to validate",
91
- labelNames: [],
92
- registers
93
- });
94
- const userOperationInclusionDuration = new Histogram({
95
- name: "alto_user_operation_inclusion_duration_seconds",
96
- help: "Duration of user operation inclusion from first submission to inclusion on-chain",
97
- labelNames: [],
98
- registers,
99
- buckets: [
100
- 0.5, 1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 25, 30, 40, 50, 60, 120,
101
- 180, 240, 300, 600, 900, 1200
102
- ]
103
- });
104
- const verificationGasLimitEstimationTime = new Histogram({
105
- name: "alto_verification_gas_limit_estimation_time_seconds",
106
- help: "Total duration of verification gas limit estimation",
107
- labelNames: [],
108
- registers,
109
- buckets: [0.1, 0.2, 0.3, 0.5, 1, 1.5, 2, 2.5, 3, 4, 5]
110
- });
111
- const verificationGasLimitEstimationCount = new Histogram({
112
- name: "alto_verification_gas_limit_estimation_count",
113
- help: "Number of verification gas limit estimation calls",
114
- labelNames: [],
115
- registers,
116
- buckets: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
117
- });
118
- const replacedTransactions = new Counter({
119
- name: "alto_replaced_transactions_total",
120
- help: "Number of replaced transactions",
121
- labelNames: ["reason", "status"],
122
- registers
123
- });
124
- const userOperationsResubmitted = new Counter({
125
- name: "alto_user_operations_resubmitted_total",
126
- help: "Number of user operations resubmitted",
127
- labelNames: [],
128
- registers
129
- });
130
- return {
131
- httpRequests,
132
- httpRequestsDuration,
133
- userOperationsInMempool,
134
- walletsAvailable,
135
- walletsTotal,
136
- userOperationsOnChain,
137
- userOperationsSubmitted,
138
- bundlesIncluded,
139
- bundlesSubmitted,
140
- userOperationsReceived,
141
- userOperationsValidationSuccess,
142
- userOperationsValidationFailure,
143
- userOperationInclusionDuration,
144
- verificationGasLimitEstimationTime,
145
- verificationGasLimitEstimationCount,
146
- replacedTransactions,
147
- userOperationsResubmitted
148
- };
149
- }
150
- //# sourceMappingURL=metrics.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../utils/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,OAAO,EACP,KAAK,EACL,SAAS,EAET,qBAAqB,EACxB,MAAM,aAAa,CAAA;AAIpB,MAAM,UAAU,aAAa,CAAC,QAAkB,EAAE,QAAQ,GAAG,IAAI;IAC7D,qBAAqB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAA;IAE7C,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAE5C,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC;QAC7B,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,0BAA0B;QAChC,UAAU,EAAE;YACR,OAAO;YACP,SAAS;YACT,SAAS;YACT,YAAY;YACZ,YAAY;YACZ,MAAM;YACN,QAAQ;SACF;QACV,SAAS;KACZ,CAAC,CAAA;IAEF,MAAM,oBAAoB,GAAG,IAAI,SAAS,CAAC;QACvC,IAAI,EAAE,gCAAgC;QACtC,IAAI,EAAE,iCAAiC;QACvC,UAAU,EAAE;YACR,OAAO;YACP,SAAS;YACT,SAAS;YACT,YAAY;YACZ,YAAY;YACZ,MAAM;YACN,QAAQ;YACR,aAAa;SACP;QACV,SAAS;KACZ,CAAC,CAAA;IAEF,MAAM,uBAAuB,GAAG,IAAI,KAAK,CAAC;QACtC,IAAI,EAAE,uCAAuC;QAC7C,IAAI,EAAE,sCAAsC;QAC5C,UAAU,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAU;QACrD,SAAS;KACZ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AE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;KAC9C,CAAC,CAAA;IAEF,MAAM,oBAAoB,GAAG,IAAI,OAAO,CAAC;QACrC,IAAI,EAAE,kCAAkC;QACxC,IAAI,EAAE,iCAAiC;QACvC,UAAU,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAU;QACzC,SAAS;KACZ,CAAC,CAAA;IAEF,MAAM,yBAAyB,GAAG,IAAI,OAAO,CAAC;QAC1C,IAAI,EAAE,wCAAwC;QAC9C,IAAI,EAAE,uCAAuC;QAC7C,UAAU,EAAE,EAAW;QACvB,SAAS;KACZ,CAAC,CAAA;IAEF,OAAO;QACH,YAAY;QACZ,oBAAoB;QACpB,uBAAuB;QACvB,gBAAgB;QAChB,YAAY;QACZ,qBAAqB;QACrB,uBAAuB;QACvB,eAAe;QACf,gBAAgB;QAChB,sBAAsB;QACtB,+BAA+B;QAC/B,+BAA+B;QAC/B,8BAA8B;QAC9B,kCAAkC;QAClC,mCAAmC;QACnC,oBAAoB;QACpB,yBAAyB;KAC5B,CAAA;AACL,CAAC"}
@@ -1,17 +0,0 @@
1
- import { FastifyReply } from "fastify";
2
- import * as WebSocket from "ws";
3
- declare class RpcReply {
4
- private http;
5
- private websocket;
6
- private _status;
7
- private _rpcStatus;
8
- constructor(http: FastifyReply | null, websocket: WebSocket.WebSocket | null);
9
- status(status: number): this;
10
- send(data: any): Promise<void>;
11
- static fromHttpReply(reply: FastifyReply): RpcReply;
12
- static fromSocket(socket: WebSocket.WebSocket): RpcReply;
13
- set rpcStatus(status: "failed" | "success");
14
- get rpcStatus(): "failed" | "success";
15
- }
16
- export default RpcReply;
17
- //# sourceMappingURL=rpc-reply.d.ts.map
@@ -1,41 +0,0 @@
1
- class RpcReply {
2
- http;
3
- websocket;
4
- // Used only for HTTP response status code
5
- _status;
6
- _rpcStatus;
7
- constructor(http, websocket) {
8
- this.http = http;
9
- this.websocket = websocket;
10
- this._status = 200;
11
- this._rpcStatus = "failed";
12
- }
13
- status(status) {
14
- this._status = status;
15
- return this;
16
- }
17
- async send(data) {
18
- if (this.http) {
19
- return this.http.status(this._status).send(data);
20
- }
21
- else if (this.websocket) {
22
- return this.websocket.send(JSON.stringify(data));
23
- }
24
- }
25
- static fromHttpReply(reply) {
26
- const rpcReply = new RpcReply(reply, null);
27
- return rpcReply;
28
- }
29
- static fromSocket(socket) {
30
- const rpcReply = new RpcReply(null, socket);
31
- return rpcReply;
32
- }
33
- set rpcStatus(status) {
34
- this._rpcStatus = status;
35
- }
36
- get rpcStatus() {
37
- return this._rpcStatus;
38
- }
39
- }
40
- export default RpcReply;
41
- //# sourceMappingURL=rpc-reply.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rpc-reply.js","sourceRoot":"","sources":["../../utils/rpc-reply.ts"],"names":[],"mappings":"AAGA,MAAM,QAAQ;IACF,IAAI,CAAqB;IACzB,SAAS,CAA4B;IAE7C,0CAA0C;IAClC,OAAO,CAAQ;IACf,UAAU,CAAsB;IAExC,YACI,IAAyB,EACzB,SAAqC;QAErC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,OAAO,GAAG,GAAG,CAAA;QAClB,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAA;IAC9B,CAAC;IAEM,MAAM,CAAC,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QAErB,OAAO,IAAI,CAAA;IACf,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,IAAS;QACvB,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACpD,CAAC;aAAM,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;QACpD,CAAC;IACL,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,KAAmB;QACpC,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAE1C,OAAO,QAAQ,CAAA;IACnB,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,MAA2B;QACzC,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QAE3C,OAAO,QAAQ,CAAA;IACnB,CAAC;IAED,IAAI,SAAS,CAAC,MAA4B;QACtC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAA;IAC5B,CAAC;IAED,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,UAAU,CAAA;IAC1B,CAAC;CACJ;AAED,eAAe,QAAQ,CAAA"}
@@ -1,17 +0,0 @@
1
- /// <reference types="node" />
2
- import { type ChildProcess } from "child_process";
3
- import type { HexData, HexData32, UserOperationV06 } from "../types/index.js";
4
- import { type Abi } from "abitype";
5
- import { type Account, type Address, type PublicClient, type TestClient, type Transport, type WalletClient } from "viem";
6
- import { type Chain } from "viem/chains";
7
- export type Clients = {
8
- public: PublicClient<Transport, Chain>;
9
- test: TestClient;
10
- wallet: WalletClient<Transport, Chain, Account>;
11
- };
12
- export declare const launchAnvil: () => Promise<ChildProcess>;
13
- export declare const createClients: (signer?: Account) => Promise<Clients>;
14
- export declare const deployContract: (clients: Clients, deployer: Address, abi: Abi, args: any[], bytecode: HexData) => Promise<Address>;
15
- export declare function getUserOpHash(op: UserOperationV06, entryPoint: Address, chainId: number): HexData32;
16
- export declare const parseSenderAddressError: (e: Error) => Address;
17
- //# sourceMappingURL=test.d.ts.map
package/esm/utils/test.js DELETED
@@ -1,130 +0,0 @@
1
- // biome-ignore lint/nursery/noNodejsModules: <explanation>
2
- import { exec } from "child_process";
3
- import { entryPointExecutionErrorSchemaV06 } from "../types/index.js";
4
- import * as sentry from "@sentry/node";
5
- import { parseAbiParameters } from "abitype";
6
- import { http, createPublicClient, createTestClient, createWalletClient, encodeAbiParameters, keccak256 } from "viem";
7
- import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
8
- import { foundry } from "viem/chains";
9
- import { fromZodError } from "zod-validation-error";
10
- export const launchAnvil = async () => {
11
- const anvilProcess = exec("anvil");
12
- const client = createPublicClient({
13
- chain: foundry,
14
- transport: http()
15
- });
16
- // keep calling getNetwork every 2ms until it doesn't throw
17
- while (true) {
18
- try {
19
- await client.getChainId();
20
- break;
21
- }
22
- catch (_e) {
23
- await new Promise((resolve) => setTimeout(resolve, 2));
24
- }
25
- }
26
- return anvilProcess;
27
- };
28
- export const createClients = async (signer) => {
29
- const publicClient = createPublicClient({
30
- chain: foundry,
31
- transport: http("http://127.0.0.1:8545")
32
- });
33
- try {
34
- await publicClient.getChainId();
35
- }
36
- catch {
37
- throw new Error("anvil is not running");
38
- }
39
- const testClient = createTestClient({
40
- chain: foundry,
41
- transport: http("http://127.0.0.1:8545"),
42
- mode: "anvil"
43
- });
44
- testClient.key;
45
- const walletClient = createWalletClient({
46
- chain: foundry,
47
- transport: http("http://127.0.0.1:8545"),
48
- account: signer ?? privateKeyToAccount(generatePrivateKey())
49
- });
50
- // : createWalletClient({
51
- // chain: foundry,
52
- // transport: http("http://127.0.0.1:8545"),
53
- // key: testClient.key
54
- // })
55
- return {
56
- public: publicClient,
57
- test: testClient,
58
- wallet: walletClient
59
- };
60
- };
61
- export const deployContract = async (clients, deployer, abi,
62
- // biome-ignore lint/suspicious/noExplicitAny: it's a generic type
63
- args, bytecode) => {
64
- if (clients.wallet.chain === undefined) {
65
- throw new Error("chain is undefined");
66
- }
67
- const hash = await clients.wallet.deployContract({
68
- abi: abi,
69
- account: deployer,
70
- bytecode,
71
- args,
72
- chain: clients.wallet.chain
73
- });
74
- await clients.test.mine({ blocks: 1 });
75
- const rcp = await clients.public.waitForTransactionReceipt({ hash });
76
- const contractAddress = rcp.contractAddress;
77
- if (!contractAddress) {
78
- throw new Error("contract deployment failed");
79
- }
80
- return contractAddress;
81
- };
82
- export function getUserOpHash(op, entryPoint, chainId) {
83
- const hashedUserOp = {
84
- sender: op.sender,
85
- nonce: op.nonce,
86
- initCodeHash: keccak256(op.initCode),
87
- callDataHash: keccak256(op.callData),
88
- callGasLimit: op.callGasLimit,
89
- verificationGasLimit: op.verificationGasLimit,
90
- preVerificationGas: op.preVerificationGas,
91
- maxFeePerGas: op.maxFeePerGas,
92
- maxPriorityFeePerGas: op.maxPriorityFeePerGas,
93
- paymasterAndDataHash: keccak256(op.paymasterAndData)
94
- };
95
- const userOpType = {
96
- components: [
97
- { type: "address", name: "sender" },
98
- { type: "uint256", name: "nonce" },
99
- { type: "bytes32", name: "initCodeHash" },
100
- { type: "bytes32", name: "callDataHash" },
101
- { type: "uint256", name: "callGasLimit" },
102
- { type: "uint256", name: "verificationGasLimit" },
103
- { type: "uint256", name: "preVerificationGas" },
104
- { type: "uint256", name: "maxFeePerGas" },
105
- { type: "uint256", name: "maxPriorityFeePerGas" },
106
- { type: "bytes32", name: "paymasterAndDataHash" }
107
- ],
108
- name: "hashedUserOp",
109
- type: "tuple"
110
- };
111
- const encoded = encodeAbiParameters([userOpType], [{ ...hashedUserOp }]);
112
- // remove leading word (total length) and trailing word (zero-length signature)
113
- const userOpHash = keccak256(encoded);
114
- const enc = encodeAbiParameters(parseAbiParameters("bytes32, address, uint256"), [userOpHash, entryPoint, BigInt(chainId)]);
115
- return keccak256(enc);
116
- }
117
- export const parseSenderAddressError = (e) => {
118
- const entryPointExecutionErrorSchemaParsing = entryPointExecutionErrorSchemaV06.safeParse(e);
119
- if (!entryPointExecutionErrorSchemaParsing.success) {
120
- sentry.captureException(e);
121
- throw fromZodError(entryPointExecutionErrorSchemaParsing.error);
122
- }
123
- const errorData = entryPointExecutionErrorSchemaParsing.data;
124
- if (errorData.errorName !== "SenderAddressResult") {
125
- sentry.captureException(e);
126
- throw e;
127
- }
128
- return errorData.args.sender;
129
- };
130
- //# sourceMappingURL=test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test.js","sourceRoot":"","sources":["../../utils/test.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,OAAO,EAAqB,IAAI,EAAE,MAAM,eAAe,CAAA;AAEvD,OAAO,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAA;AAC/D,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,EAAY,kBAAkB,EAAE,MAAM,SAAS,CAAA;AACtD,OAAO,EACH,IAAI,EAOJ,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,SAAS,EACZ,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACvE,OAAO,EAAc,OAAO,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAQnD,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,IAA2B,EAAE;IACzD,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,CAAA;IAElC,MAAM,MAAM,GAAG,kBAAkB,CAAC;QAC9B,KAAK,EAAE,OAAO;QACd,SAAS,EAAE,IAAI,EAAE;KACpB,CAAC,CAAA;IAEF,2DAA2D;IAC3D,OAAO,IAAI,EAAE,CAAC;QACV,IAAI,CAAC;YACD,MAAM,MAAM,CAAC,UAAU,EAAE,CAAA;YACzB,MAAK;QACT,CAAC;QAAC,OAAO,EAAE,EAAE,CAAC;YACV,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAA;QAC1D,CAAC;IACL,CAAC;IAED,OAAO,YAAY,CAAA;AACvB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,MAAgB,EAAoB,EAAE;I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qBAAqB,EAAE,CAAC;QAChD,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAA;QAC1B,MAAM,CAAC,CAAA;IACX,CAAC;IACD,OAAO,SAAS,CAAC,IAAI,CAAC,MAAM,CAAA;AAChC,CAAC,CAAA"}
@@ -1,49 +0,0 @@
1
- import { type UserOperationV06, type HexData32, type UserOperation, type UserOperationV07, type PackedUserOperation } from "../types/index.js";
2
- import { type Address, type Hex, type PublicClient } from "viem";
3
- export declare function isVersion06(operation: UserOperation): operation is UserOperationV06;
4
- export declare function isVersion07(operation: UserOperation): operation is UserOperationV07;
5
- export declare function getInitCode(unpackedUserOperation: UserOperationV07): `0x${string}`;
6
- export declare function unPackInitCode(initCode: Hex): {
7
- factory: null;
8
- factoryData: null;
9
- } | {
10
- factory: `0x${string}`;
11
- factoryData: `0x${string}`;
12
- };
13
- export declare function getAccountGasLimits(unpackedUserOperation: UserOperationV07): `0x${string}`;
14
- export declare function unpackAccountGasLimits(accountGasLimits: Hex): {
15
- verificationGasLimit: bigint;
16
- callGasLimit: bigint;
17
- };
18
- export declare function getGasLimits(unpackedUserOperation: UserOperationV07): `0x${string}`;
19
- export declare function unpackGasLimits(gasLimits: Hex): {
20
- maxPriorityFeePerGas: bigint;
21
- maxFeePerGas: bigint;
22
- };
23
- export declare function getPaymasterAndData(unpackedUserOperation: UserOperationV07): `0x${string}`;
24
- export declare function unpackPaymasterAndData(paymasterAndData: Hex): {
25
- paymaster: null;
26
- paymasterVerificationGasLimit: null;
27
- paymasterPostOpGasLimit: null;
28
- paymasterData: null;
29
- } | {
30
- paymaster: `0x${string}`;
31
- paymasterVerificationGasLimit: bigint;
32
- paymasterPostOpGasLimit: bigint;
33
- paymasterData: `0x${string}`;
34
- };
35
- export declare function toPackedUserOperation(unpackedUserOperation: UserOperationV07): PackedUserOperation;
36
- export declare function deepHexlify(obj: any): any;
37
- export declare function getAddressFromInitCodeOrPaymasterAndData(data: Hex): Address | null;
38
- export declare const transactionIncluded: (isVersion06: boolean, txHash: HexData32, publicClient: PublicClient, entryPoint: Address) => Promise<{
39
- [userOperationHash: `0x${string}`]: {
40
- accountDeployed: boolean;
41
- };
42
- status: "included" | "reverted" | "failed" | "not_found";
43
- }>;
44
- export declare const getUserOperationHashV06: (userOperation: UserOperationV06, entryPointAddress: Address, chainId: number) => `0x${string}`;
45
- export declare const getUserOperationHashV07: (userOperation: PackedUserOperation, entryPointAddress: Address, chainId: number) => `0x${string}`;
46
- export declare const getUserOperationHash: (userOperation: UserOperation, entryPointAddress: Address, chainId: number) => `0x${string}`;
47
- export declare const getNonceKeyAndValue: (nonce: bigint) => bigint[];
48
- export declare function toUnpackedUserOperation(packedUserOperation: PackedUserOperation): UserOperationV07;
49
- //# sourceMappingURL=userop.d.ts.map