@pimlico/alto 0.0.0-prool.20240609T212524 → 0.0.0-prool.20240609T213631
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.
- package/esm/index.d.mts +449 -0
- package/esm/index.mjs +64 -0
- package/esm/index.mjs.map +1 -0
- package/esm/{utils/toArgs.d.ts → toArgs.d.mts} +1 -1
- package/{lib/utils/toArgs.js → esm/toArgs.mjs} +5 -12
- package/esm/toArgs.mjs.map +1 -0
- package/esm/utils/index.d.ts +0 -1
- package/esm/utils/index.js +0 -1
- package/esm/utils/index.js.map +1 -1
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/index.js +0 -1
- package/lib/utils/index.js.map +1 -1
- package/package.json +4 -1
- package/esm/utils/toArgs.js +0 -87
- package/esm/utils/toArgs.js.map +0 -1
- package/lib/utils/toArgs.d.ts +0 -36
- package/lib/utils/toArgs.js.map +0 -1
package/esm/index.d.mts
ADDED
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
export type AltoParameters = {
|
|
2
|
+
/**
|
|
3
|
+
* API version (used for internal Pimlico versioning compatibility).
|
|
4
|
+
*/
|
|
5
|
+
apiVersion?: readonly string[] | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Override the sender native token balance during estimation
|
|
8
|
+
*/
|
|
9
|
+
balanceOverride?: boolean | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Binary path of the `alto` executable.
|
|
12
|
+
*/
|
|
13
|
+
binary?: string | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Address of the `BundleBulker` contract.
|
|
16
|
+
*/
|
|
17
|
+
bundleBulkerAddress?: `0x${string}` | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Set if the bundler bundle user operations automatically or only when calling `debug_bundler_sendBundleNow`.
|
|
20
|
+
* @default "auto"
|
|
21
|
+
*/
|
|
22
|
+
bundleMode?: "auto" | "manual" | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Indicates weather the chain is a OP stack chain, arbitrum chain, or default EVM chain.
|
|
25
|
+
*/
|
|
26
|
+
chainType?: "default" | "op-stack" | "arbitrum" | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Path to JSON config file.
|
|
29
|
+
*/
|
|
30
|
+
config?: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Skip user operation validation, use with caution.
|
|
33
|
+
*/
|
|
34
|
+
dangerousSkipUserOperationValidation?: boolean | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Default API version.
|
|
37
|
+
*/
|
|
38
|
+
defaultApiVersion?: string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Enable debug endpoints.
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
enableDebugEndpoints?: boolean | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Include user ops with the same sender in the single bundle.
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
enforceUniqueSendersPerBundle?: boolean | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* EntryPoint contract addresses.
|
|
51
|
+
*/
|
|
52
|
+
entrypoints: readonly `0x${string}`[];
|
|
53
|
+
/**
|
|
54
|
+
* Address of the EntryPoint simulations contract.
|
|
55
|
+
*/
|
|
56
|
+
entrypointSimulationContract?: `0x${string}` | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Private keys of the executor accounts.
|
|
59
|
+
*/
|
|
60
|
+
executorPrivateKeys?: readonly `0x${string}`[];
|
|
61
|
+
/**
|
|
62
|
+
* Interval to refill the signer balance (seconds).
|
|
63
|
+
* @default 1200
|
|
64
|
+
*/
|
|
65
|
+
executorRefillInterval?: number | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Should the node make expiration checks.
|
|
68
|
+
* @default true
|
|
69
|
+
*/
|
|
70
|
+
expirationCheck?: boolean | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Amount to multiply the gas prices fetched from the node.
|
|
73
|
+
* @default "100"
|
|
74
|
+
*/
|
|
75
|
+
gasPriceBump?: string | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Maximum that the gas prices fetched using pimlico_getUserOperationGasPrice will be accepted for (seconds).
|
|
78
|
+
* @default 10
|
|
79
|
+
*/
|
|
80
|
+
gasPriceExpiry?: number | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* The minimum percentage of incoming user operation gas prices compared to the gas price used by the bundler to submit bundles.
|
|
83
|
+
* @default 101
|
|
84
|
+
*/
|
|
85
|
+
gasPriceFloorPercent?: number | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Amount to multiply the gas prices fetched using `pimlico_getUserOperationGasPrice`.
|
|
88
|
+
* @default "105,110,115"
|
|
89
|
+
*/
|
|
90
|
+
gasPriceMultipliers?: readonly string[] | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Use a fixed value for gas limits during bundle transaction gas limit estimations
|
|
93
|
+
*/
|
|
94
|
+
fixedGasLimitForEstimation?: string | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Flush stuck transactions with old nonces during bundler startup.
|
|
97
|
+
*/
|
|
98
|
+
flushStuckTransactionsDuringStartup?: boolean | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Log in JSON format.
|
|
101
|
+
*/
|
|
102
|
+
json?: boolean | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Send legacy transactions instead of an EIP-1559 transactions.
|
|
105
|
+
* @default false
|
|
106
|
+
*/
|
|
107
|
+
legacyTransactions?: boolean | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Calculate the bundle transaction gas limits locally instead of using the RPC gas limit estimation.
|
|
110
|
+
*/
|
|
111
|
+
localGasLimitCalculation?: boolean | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* Default log level.
|
|
114
|
+
*/
|
|
115
|
+
logLevel?: "trace" | "debug" | "info" | "warn" | "error" | "fatal" | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* Max block range for `eth_getLogs` calls.
|
|
118
|
+
*/
|
|
119
|
+
maxBlockRange?: number | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Maximum number of operations allowed in the mempool before a bundle is submitted.
|
|
122
|
+
* @default 10
|
|
123
|
+
*/
|
|
124
|
+
maxBundleSize?: number | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* Maximum time to wait for a bundle to be submitted (ms).
|
|
127
|
+
* @default 1000
|
|
128
|
+
*/
|
|
129
|
+
maxBundleWait?: number | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* Maximum amount of gas per bundle.
|
|
132
|
+
* @default "5000000"
|
|
133
|
+
*/
|
|
134
|
+
maxGasPerBundle?: string | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* Maximum number of executor accounts to use from the list of executor private keys.
|
|
137
|
+
*/
|
|
138
|
+
maxExecutors?: number | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* Maximum amount of parallel user ops to keep in the meempool (same sender, different nonce keys).
|
|
141
|
+
* @default 10
|
|
142
|
+
*/
|
|
143
|
+
mempoolMaxParallelOps?: number | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* Maximum amount of sequential user ops to keep in the mempool (same sender and nonce key, different nonce values).
|
|
146
|
+
* @default 0
|
|
147
|
+
*/
|
|
148
|
+
mempoolMaxQueuedOps?: number | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* Minimum stake required for a relay (in 10e18).
|
|
151
|
+
* @default 1
|
|
152
|
+
*/
|
|
153
|
+
minEntityStake?: number | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* Minimum unstake delay (seconds).
|
|
156
|
+
* @default 1
|
|
157
|
+
*/
|
|
158
|
+
minEntityUnstakeDelay?: number | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* Minimum balance required for each executor account (below which the utility account will refill).
|
|
161
|
+
*/
|
|
162
|
+
minExecutorBalance?: string | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* Name of the network (used for metrics).
|
|
165
|
+
* @default "localhost"
|
|
166
|
+
*/
|
|
167
|
+
networkName?: string | undefined;
|
|
168
|
+
/**
|
|
169
|
+
* Amount to multiply the paymaster gas limits fetched from simulations.
|
|
170
|
+
*/
|
|
171
|
+
paymasterGasLimitMultiplier?: string | undefined;
|
|
172
|
+
/**
|
|
173
|
+
* Address of the `PerOpInflator` contract.
|
|
174
|
+
*/
|
|
175
|
+
perOpInflatorAddress?: `0x${string}` | undefined;
|
|
176
|
+
/**
|
|
177
|
+
* Polling interval for querying for new blocks (ms).
|
|
178
|
+
* @default 1000
|
|
179
|
+
*/
|
|
180
|
+
pollingInterval?: number | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* Port to listen on.
|
|
183
|
+
* @default 3000
|
|
184
|
+
*/
|
|
185
|
+
port?: number | undefined;
|
|
186
|
+
/**
|
|
187
|
+
* RPC url to connect to.
|
|
188
|
+
*/
|
|
189
|
+
rpcUrl: string;
|
|
190
|
+
/**
|
|
191
|
+
* Enable safe mode (enforcing all ERC-4337 rules).
|
|
192
|
+
* @default true
|
|
193
|
+
*/
|
|
194
|
+
safeMode?: boolean | undefined;
|
|
195
|
+
/**
|
|
196
|
+
* RPC url to send transactions to (e.g. flashbots relay).
|
|
197
|
+
*/
|
|
198
|
+
sendTransactionRpcUrl?: string | undefined;
|
|
199
|
+
/**
|
|
200
|
+
* Timeout for incoming requests (in ms).
|
|
201
|
+
*/
|
|
202
|
+
timeout?: number | undefined;
|
|
203
|
+
/**
|
|
204
|
+
* Private key of the utility account.
|
|
205
|
+
*/
|
|
206
|
+
utilityPrivateKey?: string | undefined;
|
|
207
|
+
/**
|
|
208
|
+
* Maximum payload size for websocket messages in bytes (default to 1MB).
|
|
209
|
+
*/
|
|
210
|
+
websocketMaxPayloadSize?: number | undefined;
|
|
211
|
+
/**
|
|
212
|
+
* Enable websocket server.
|
|
213
|
+
*/
|
|
214
|
+
websocket?: boolean | undefined;
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Defines an Alto instance.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```ts
|
|
221
|
+
* const instance = alto({
|
|
222
|
+
* entrypoints: ['0x0000000071727De22E5E9d8BAf0edAc6f37da032'],
|
|
223
|
+
* rpcUrl: `http://localhost:8545`,
|
|
224
|
+
* executorPrivateKeys: ['0x...'],
|
|
225
|
+
* })
|
|
226
|
+
* await instance.start()
|
|
227
|
+
* // ...
|
|
228
|
+
* await instance.stop()
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
export declare const alto: import("prool").DefineInstanceReturnType<{
|
|
232
|
+
args: {
|
|
233
|
+
/**
|
|
234
|
+
* API version (used for internal Pimlico versioning compatibility).
|
|
235
|
+
*/
|
|
236
|
+
apiVersion?: readonly string[] | undefined;
|
|
237
|
+
/**
|
|
238
|
+
* Override the sender native token balance during estimation
|
|
239
|
+
*/
|
|
240
|
+
balanceOverride?: boolean | undefined;
|
|
241
|
+
/**
|
|
242
|
+
* Binary path of the `alto` executable.
|
|
243
|
+
*/
|
|
244
|
+
binary?: string | undefined;
|
|
245
|
+
/**
|
|
246
|
+
* Address of the `BundleBulker` contract.
|
|
247
|
+
*/
|
|
248
|
+
bundleBulkerAddress?: `0x${string}` | undefined;
|
|
249
|
+
/**
|
|
250
|
+
* Set if the bundler bundle user operations automatically or only when calling `debug_bundler_sendBundleNow`.
|
|
251
|
+
* @default "auto"
|
|
252
|
+
*/
|
|
253
|
+
bundleMode?: "auto" | "manual" | undefined;
|
|
254
|
+
/**
|
|
255
|
+
* Indicates weather the chain is a OP stack chain, arbitrum chain, or default EVM chain.
|
|
256
|
+
*/
|
|
257
|
+
chainType?: "default" | "op-stack" | "arbitrum" | undefined;
|
|
258
|
+
/**
|
|
259
|
+
* Path to JSON config file.
|
|
260
|
+
*/
|
|
261
|
+
config?: string | undefined;
|
|
262
|
+
/**
|
|
263
|
+
* Skip user operation validation, use with caution.
|
|
264
|
+
*/
|
|
265
|
+
dangerousSkipUserOperationValidation?: boolean | undefined;
|
|
266
|
+
/**
|
|
267
|
+
* Default API version.
|
|
268
|
+
*/
|
|
269
|
+
defaultApiVersion?: string | undefined;
|
|
270
|
+
/**
|
|
271
|
+
* Enable debug endpoints.
|
|
272
|
+
* @default false
|
|
273
|
+
*/
|
|
274
|
+
enableDebugEndpoints?: boolean | undefined;
|
|
275
|
+
/**
|
|
276
|
+
* Include user ops with the same sender in the single bundle.
|
|
277
|
+
* @default true
|
|
278
|
+
*/
|
|
279
|
+
enforceUniqueSendersPerBundle?: boolean | undefined;
|
|
280
|
+
/**
|
|
281
|
+
* EntryPoint contract addresses.
|
|
282
|
+
*/
|
|
283
|
+
entrypoints: readonly `0x${string}`[];
|
|
284
|
+
/**
|
|
285
|
+
* Address of the EntryPoint simulations contract.
|
|
286
|
+
*/
|
|
287
|
+
entrypointSimulationContract?: `0x${string}` | undefined;
|
|
288
|
+
/**
|
|
289
|
+
* Private keys of the executor accounts.
|
|
290
|
+
*/
|
|
291
|
+
executorPrivateKeys?: readonly `0x${string}`[] | undefined;
|
|
292
|
+
/**
|
|
293
|
+
* Interval to refill the signer balance (seconds).
|
|
294
|
+
* @default 1200
|
|
295
|
+
*/
|
|
296
|
+
executorRefillInterval?: number | undefined;
|
|
297
|
+
/**
|
|
298
|
+
* Should the node make expiration checks.
|
|
299
|
+
* @default true
|
|
300
|
+
*/
|
|
301
|
+
expirationCheck?: boolean | undefined;
|
|
302
|
+
/**
|
|
303
|
+
* Amount to multiply the gas prices fetched from the node.
|
|
304
|
+
* @default "100"
|
|
305
|
+
*/
|
|
306
|
+
gasPriceBump?: string | undefined;
|
|
307
|
+
/**
|
|
308
|
+
* Maximum that the gas prices fetched using pimlico_getUserOperationGasPrice will be accepted for (seconds).
|
|
309
|
+
* @default 10
|
|
310
|
+
*/
|
|
311
|
+
gasPriceExpiry?: number | undefined;
|
|
312
|
+
/**
|
|
313
|
+
* The minimum percentage of incoming user operation gas prices compared to the gas price used by the bundler to submit bundles.
|
|
314
|
+
* @default 101
|
|
315
|
+
*/
|
|
316
|
+
gasPriceFloorPercent?: number | undefined;
|
|
317
|
+
/**
|
|
318
|
+
* Amount to multiply the gas prices fetched using `pimlico_getUserOperationGasPrice`.
|
|
319
|
+
* @default "105,110,115"
|
|
320
|
+
*/
|
|
321
|
+
gasPriceMultipliers?: readonly string[] | undefined;
|
|
322
|
+
/**
|
|
323
|
+
* Use a fixed value for gas limits during bundle transaction gas limit estimations
|
|
324
|
+
*/
|
|
325
|
+
fixedGasLimitForEstimation?: string | undefined;
|
|
326
|
+
/**
|
|
327
|
+
* Flush stuck transactions with old nonces during bundler startup.
|
|
328
|
+
*/
|
|
329
|
+
flushStuckTransactionsDuringStartup?: boolean | undefined;
|
|
330
|
+
/**
|
|
331
|
+
* Log in JSON format.
|
|
332
|
+
*/
|
|
333
|
+
json?: boolean | undefined;
|
|
334
|
+
/**
|
|
335
|
+
* Send legacy transactions instead of an EIP-1559 transactions.
|
|
336
|
+
* @default false
|
|
337
|
+
*/
|
|
338
|
+
legacyTransactions?: boolean | undefined;
|
|
339
|
+
/**
|
|
340
|
+
* Calculate the bundle transaction gas limits locally instead of using the RPC gas limit estimation.
|
|
341
|
+
*/
|
|
342
|
+
localGasLimitCalculation?: boolean | undefined;
|
|
343
|
+
/**
|
|
344
|
+
* Default log level.
|
|
345
|
+
*/
|
|
346
|
+
logLevel?: "trace" | "debug" | "info" | "warn" | "error" | "fatal" | undefined;
|
|
347
|
+
/**
|
|
348
|
+
* Max block range for `eth_getLogs` calls.
|
|
349
|
+
*/
|
|
350
|
+
maxBlockRange?: number | undefined;
|
|
351
|
+
/**
|
|
352
|
+
* Maximum number of operations allowed in the mempool before a bundle is submitted.
|
|
353
|
+
* @default 10
|
|
354
|
+
*/
|
|
355
|
+
maxBundleSize?: number | undefined;
|
|
356
|
+
/**
|
|
357
|
+
* Maximum time to wait for a bundle to be submitted (ms).
|
|
358
|
+
* @default 1000
|
|
359
|
+
*/
|
|
360
|
+
maxBundleWait?: number | undefined;
|
|
361
|
+
/**
|
|
362
|
+
* Maximum amount of gas per bundle.
|
|
363
|
+
* @default "5000000"
|
|
364
|
+
*/
|
|
365
|
+
maxGasPerBundle?: string | undefined;
|
|
366
|
+
/**
|
|
367
|
+
* Maximum number of executor accounts to use from the list of executor private keys.
|
|
368
|
+
*/
|
|
369
|
+
maxExecutors?: number | undefined;
|
|
370
|
+
/**
|
|
371
|
+
* Maximum amount of parallel user ops to keep in the meempool (same sender, different nonce keys).
|
|
372
|
+
* @default 10
|
|
373
|
+
*/
|
|
374
|
+
mempoolMaxParallelOps?: number | undefined;
|
|
375
|
+
/**
|
|
376
|
+
* Maximum amount of sequential user ops to keep in the mempool (same sender and nonce key, different nonce values).
|
|
377
|
+
* @default 0
|
|
378
|
+
*/
|
|
379
|
+
mempoolMaxQueuedOps?: number | undefined;
|
|
380
|
+
/**
|
|
381
|
+
* Minimum stake required for a relay (in 10e18).
|
|
382
|
+
* @default 1
|
|
383
|
+
*/
|
|
384
|
+
minEntityStake?: number | undefined;
|
|
385
|
+
/**
|
|
386
|
+
* Minimum unstake delay (seconds).
|
|
387
|
+
* @default 1
|
|
388
|
+
*/
|
|
389
|
+
minEntityUnstakeDelay?: number | undefined;
|
|
390
|
+
/**
|
|
391
|
+
* Minimum balance required for each executor account (below which the utility account will refill).
|
|
392
|
+
*/
|
|
393
|
+
minExecutorBalance?: string | undefined;
|
|
394
|
+
/**
|
|
395
|
+
* Name of the network (used for metrics).
|
|
396
|
+
* @default "localhost"
|
|
397
|
+
*/
|
|
398
|
+
networkName?: string | undefined;
|
|
399
|
+
/**
|
|
400
|
+
* Amount to multiply the paymaster gas limits fetched from simulations.
|
|
401
|
+
*/
|
|
402
|
+
paymasterGasLimitMultiplier?: string | undefined;
|
|
403
|
+
/**
|
|
404
|
+
* Address of the `PerOpInflator` contract.
|
|
405
|
+
*/
|
|
406
|
+
perOpInflatorAddress?: `0x${string}` | undefined;
|
|
407
|
+
/**
|
|
408
|
+
* Polling interval for querying for new blocks (ms).
|
|
409
|
+
* @default 1000
|
|
410
|
+
*/
|
|
411
|
+
pollingInterval?: number | undefined;
|
|
412
|
+
/**
|
|
413
|
+
* Port to listen on.
|
|
414
|
+
* @default 3000
|
|
415
|
+
*/
|
|
416
|
+
port?: number | undefined;
|
|
417
|
+
/**
|
|
418
|
+
* RPC url to connect to.
|
|
419
|
+
*/
|
|
420
|
+
rpcUrl: string;
|
|
421
|
+
/**
|
|
422
|
+
* Enable safe mode (enforcing all ERC-4337 rules).
|
|
423
|
+
* @default true
|
|
424
|
+
*/
|
|
425
|
+
safeMode?: boolean | undefined;
|
|
426
|
+
/**
|
|
427
|
+
* RPC url to send transactions to (e.g. flashbots relay).
|
|
428
|
+
*/
|
|
429
|
+
sendTransactionRpcUrl?: string | undefined;
|
|
430
|
+
/**
|
|
431
|
+
* Timeout for incoming requests (in ms).
|
|
432
|
+
*/
|
|
433
|
+
timeout?: number | undefined;
|
|
434
|
+
/**
|
|
435
|
+
* Private key of the utility account.
|
|
436
|
+
*/
|
|
437
|
+
utilityPrivateKey?: string | undefined;
|
|
438
|
+
/**
|
|
439
|
+
* Maximum payload size for websocket messages in bytes (default to 1MB).
|
|
440
|
+
*/
|
|
441
|
+
websocketMaxPayloadSize?: number | undefined;
|
|
442
|
+
/**
|
|
443
|
+
* Enable websocket server.
|
|
444
|
+
*/
|
|
445
|
+
websocket?: boolean | undefined;
|
|
446
|
+
};
|
|
447
|
+
readonly process: import("prool/processes").Process_internal;
|
|
448
|
+
}, AltoParameters | undefined>;
|
|
449
|
+
//# sourceMappingURL=index.d.mts.map
|
package/esm/index.mjs
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { defineInstance } from "prool";
|
|
3
|
+
import { execa } from "prool/processes";
|
|
4
|
+
import { toArgs } from "./toArgs.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Defines an Alto instance.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const instance = alto({
|
|
11
|
+
* entrypoints: ['0x0000000071727De22E5E9d8BAf0edAc6f37da032'],
|
|
12
|
+
* rpcUrl: `http://localhost:8545`,
|
|
13
|
+
* executorPrivateKeys: ['0x...'],
|
|
14
|
+
* })
|
|
15
|
+
* await instance.start()
|
|
16
|
+
* // ...
|
|
17
|
+
* await instance.stop()
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export const alto = defineInstance((parameters) => {
|
|
21
|
+
const { ...args } = (parameters || {});
|
|
22
|
+
const name = "alto";
|
|
23
|
+
const process = execa({ name });
|
|
24
|
+
return {
|
|
25
|
+
_internal: {
|
|
26
|
+
args,
|
|
27
|
+
get process() {
|
|
28
|
+
return process._internal.process;
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
host: "localhost",
|
|
32
|
+
name,
|
|
33
|
+
port: args.port ?? 3000,
|
|
34
|
+
async start({ port = args.port ?? 3000 }, options) {
|
|
35
|
+
const binary = (() => {
|
|
36
|
+
if (args.binary) {
|
|
37
|
+
return [args.binary];
|
|
38
|
+
}
|
|
39
|
+
return ["node", resolve(__dirname, "./cli/alto.js")];
|
|
40
|
+
})();
|
|
41
|
+
await process.start(($) => $ `${binary} ${toArgs({
|
|
42
|
+
port,
|
|
43
|
+
...args,
|
|
44
|
+
safeMode: args.safeMode ?? false
|
|
45
|
+
})}`, {
|
|
46
|
+
...options,
|
|
47
|
+
// Resolve when the process is listening via a "Server listening at" message.
|
|
48
|
+
resolver({ process, reject, resolve }) {
|
|
49
|
+
process.stdout.on("data", (data) => {
|
|
50
|
+
const message = data.toString();
|
|
51
|
+
if (message.includes("Server listening at")) {
|
|
52
|
+
resolve();
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
process.stderr.on("data", reject);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
async stop() {
|
|
60
|
+
await process.stop();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|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BACJ,GAAG,IAAI;gBACP,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,KAAK;aACnC,CAAC,EAAE,EACR;gBACI,GAAG,OAAO;gBACV,6EAA6E;gBAC7E,QAAQ,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;oBACjC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;wBAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;wBAC/B,IAAI,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC;4BAC1C,OAAO,EAAE,CAAA;wBACb,CAAC;oBACL,CAAC,CAAC,CAAA;oBACF,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;gBACrC,CAAC;aACJ,CACJ,CAAA;QACL,CAAC;QACD,KAAK,CAAC,IAAI;YACN,MAAM,OAAO,CAAC,IAAI,EAAE,CAAA;QACxB,CAAC;KACJ,CAAA;AACL,CAAC,CAAC,CAAA"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toFlagCase = exports.toArgs = exports.stripColors = exports.extractPath = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Parse a request url into an object containing the id and path.
|
|
6
3
|
*
|
|
7
4
|
* @param request The request url.
|
|
8
5
|
* @returns The parsed request context or undefined.
|
|
9
6
|
*/
|
|
10
|
-
function extractPath(request) {
|
|
7
|
+
export function extractPath(request) {
|
|
11
8
|
const host = "http://localhost"; // Dummy value for URL constructor
|
|
12
9
|
const url = new URL(`${host}${request ?? "/"}`);
|
|
13
10
|
const [idOrPath, ...pathname] = url.pathname
|
|
@@ -21,7 +18,6 @@ function extractPath(request) {
|
|
|
21
18
|
: [idOrPath, ...pathname].join("/")}`;
|
|
22
19
|
return { id, path };
|
|
23
20
|
}
|
|
24
|
-
exports.extractPath = extractPath;
|
|
25
21
|
const ansiColorRegex =
|
|
26
22
|
// biome-ignore lint/suspicious/noControlCharactersInRegex: <explanation>
|
|
27
23
|
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
|
|
@@ -31,17 +27,16 @@ const ansiColorRegex =
|
|
|
31
27
|
* @param message The string to strip.
|
|
32
28
|
* @returns The stripped string.
|
|
33
29
|
*/
|
|
34
|
-
function stripColors(message) {
|
|
30
|
+
export function stripColors(message) {
|
|
35
31
|
return message.replace(ansiColorRegex, "");
|
|
36
32
|
}
|
|
37
|
-
exports.stripColors = stripColors;
|
|
38
33
|
/**
|
|
39
34
|
* Converts an object of options to an array of command line arguments.
|
|
40
35
|
*
|
|
41
36
|
* @param options The options object.
|
|
42
37
|
* @returns The command line arguments.
|
|
43
38
|
*/
|
|
44
|
-
function toArgs(parameters) {
|
|
39
|
+
export function toArgs(parameters) {
|
|
45
40
|
return Object.entries(parameters).flatMap(([key, value]) => {
|
|
46
41
|
if (value === undefined) {
|
|
47
42
|
return [];
|
|
@@ -73,15 +68,13 @@ function toArgs(parameters) {
|
|
|
73
68
|
return [flag, stringified];
|
|
74
69
|
});
|
|
75
70
|
}
|
|
76
|
-
exports.toArgs = toArgs;
|
|
77
71
|
/**
|
|
78
72
|
* Converts a camelCase string to a flag case string.
|
|
79
73
|
*
|
|
80
74
|
* @param key The camelCase string.
|
|
81
75
|
* @returns The flag case string.
|
|
82
76
|
*/
|
|
83
|
-
function toFlagCase(key) {
|
|
77
|
+
export function toFlagCase(key) {
|
|
84
78
|
return `--${key.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`)}`;
|
|
85
79
|
}
|
|
86
|
-
|
|
87
|
-
//# sourceMappingURL=toArgs.js.map
|
|
80
|
+
//# sourceMappingURL=toArgs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toArg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;AACH,MAAM,UAAU,UAAU,CAAC,GAAW;IAClC,OAAO,KAAK,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE,CAAA;AAC7E,CAAC"}
|
package/esm/utils/index.d.ts
CHANGED
package/esm/utils/index.js
CHANGED
|
@@ -23,5 +23,4 @@ __exportStar(require("./validation.js"), exports);
|
|
|
23
23
|
__exportStar(require("./userop.js"), exports);
|
|
24
24
|
__exportStar(require("./compressionHandler.js"), exports);
|
|
25
25
|
__exportStar(require("./helpers.js"), exports);
|
|
26
|
-
__exportStar(require("./toArgs.js"), exports);
|
|
27
26
|
//# sourceMappingURL=index.js.map
|
package/esm/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,4CAAyB;AACzB,2CAAwB;AACxB,oDAAiC;AACjC,yCAAsB;AACtB,+CAA4B;AAC5B,2CAAwB;AACxB,uDAAoC;AACpC,4CAAyB
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,4CAAyB;AACzB,2CAAwB;AACxB,oDAAiC;AACjC,yCAAsB;AACtB,+CAA4B;AAC5B,2CAAwB;AACxB,uDAAoC;AACpC,4CAAyB"}
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
|
@@ -23,5 +23,4 @@ __exportStar(require("./validation.js"), exports);
|
|
|
23
23
|
__exportStar(require("./userop.js"), exports);
|
|
24
24
|
__exportStar(require("./compressionHandler.js"), exports);
|
|
25
25
|
__exportStar(require("./helpers.js"), exports);
|
|
26
|
-
__exportStar(require("./toArgs.js"), exports);
|
|
27
26
|
//# sourceMappingURL=index.js.map
|
package/lib/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,4CAAyB;AACzB,2CAAwB;AACxB,oDAAiC;AACjC,yCAAsB;AACtB,+CAA4B;AAC5B,2CAAwB;AACxB,uDAAoC;AACpC,4CAAyB
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,4CAAyB;AACzB,2CAAwB;AACxB,oDAAiC;AACjC,yCAAsB;AACtB,+CAA4B;AAC5B,2CAAwB;AACxB,uDAAoC;AACpC,4CAAyB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pimlico/alto",
|
|
3
|
-
"version": "0.0.0-prool.
|
|
3
|
+
"version": "0.0.0-prool.20240609T213631",
|
|
4
4
|
"description": "A performant and modular ERC-4337 Bundler written in Typescript",
|
|
5
5
|
"repository": "https://github.com/pimlicolabs/alto.git",
|
|
6
6
|
"author": "Pimlico",
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
"esm/**/*.d.ts",
|
|
12
12
|
"esm/**/*.js",
|
|
13
13
|
"esm/**/*.js.map",
|
|
14
|
+
"esm/**/*.mjs.map",
|
|
15
|
+
"esm/**/*.mjs",
|
|
16
|
+
"esm/**/*.d.mts",
|
|
14
17
|
"lib/**/*.d.ts",
|
|
15
18
|
"lib/**/*.js",
|
|
16
19
|
"lib/**/*.js.map",
|
package/esm/utils/toArgs.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toFlagCase = exports.toArgs = exports.stripColors = exports.extractPath = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Parse a request url into an object containing the id and path.
|
|
6
|
-
*
|
|
7
|
-
* @param request The request url.
|
|
8
|
-
* @returns The parsed request context or undefined.
|
|
9
|
-
*/
|
|
10
|
-
function extractPath(request) {
|
|
11
|
-
const host = "http://localhost"; // Dummy value for URL constructor
|
|
12
|
-
const url = new URL(`${host}${request ?? "/"}`);
|
|
13
|
-
const [idOrPath, ...pathname] = url.pathname
|
|
14
|
-
.split("/")
|
|
15
|
-
.filter((part) => part !== "");
|
|
16
|
-
const id = !Number.isNaN(Number(idOrPath)) && Number(idOrPath) > 0
|
|
17
|
-
? Number(idOrPath)
|
|
18
|
-
: undefined;
|
|
19
|
-
const path = `/${typeof id === "number"
|
|
20
|
-
? pathname.join("/")
|
|
21
|
-
: [idOrPath, ...pathname].join("/")}`;
|
|
22
|
-
return { id, path };
|
|
23
|
-
}
|
|
24
|
-
exports.extractPath = extractPath;
|
|
25
|
-
const ansiColorRegex =
|
|
26
|
-
// biome-ignore lint/suspicious/noControlCharactersInRegex: <explanation>
|
|
27
|
-
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
|
|
28
|
-
/**
|
|
29
|
-
* Strips ANSI color codes from a string.
|
|
30
|
-
*
|
|
31
|
-
* @param message The string to strip.
|
|
32
|
-
* @returns The stripped string.
|
|
33
|
-
*/
|
|
34
|
-
function stripColors(message) {
|
|
35
|
-
return message.replace(ansiColorRegex, "");
|
|
36
|
-
}
|
|
37
|
-
exports.stripColors = stripColors;
|
|
38
|
-
/**
|
|
39
|
-
* Converts an object of options to an array of command line arguments.
|
|
40
|
-
*
|
|
41
|
-
* @param options The options object.
|
|
42
|
-
* @returns The command line arguments.
|
|
43
|
-
*/
|
|
44
|
-
function toArgs(parameters) {
|
|
45
|
-
return Object.entries(parameters).flatMap(([key, value]) => {
|
|
46
|
-
if (value === undefined) {
|
|
47
|
-
return [];
|
|
48
|
-
}
|
|
49
|
-
if (Array.isArray(value)) {
|
|
50
|
-
return [toFlagCase(key), value.join(",")];
|
|
51
|
-
}
|
|
52
|
-
if (typeof value === "object" && value !== null) {
|
|
53
|
-
return Object.entries(value).flatMap(([subKey, subValue]) => {
|
|
54
|
-
if (subValue === undefined) {
|
|
55
|
-
return [];
|
|
56
|
-
}
|
|
57
|
-
const flag = toFlagCase(key);
|
|
58
|
-
const value = `${subKey}: ${subValue}`;
|
|
59
|
-
return [flag, value];
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
const flag = toFlagCase(key);
|
|
63
|
-
if (value === false) {
|
|
64
|
-
return [flag, "false"];
|
|
65
|
-
}
|
|
66
|
-
if (value === true) {
|
|
67
|
-
return [flag];
|
|
68
|
-
}
|
|
69
|
-
const stringified = value.toString();
|
|
70
|
-
if (stringified === "") {
|
|
71
|
-
return [flag];
|
|
72
|
-
}
|
|
73
|
-
return [flag, stringified];
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
exports.toArgs = toArgs;
|
|
77
|
-
/**
|
|
78
|
-
* Converts a camelCase string to a flag case string.
|
|
79
|
-
*
|
|
80
|
-
* @param key The camelCase string.
|
|
81
|
-
* @returns The flag case string.
|
|
82
|
-
*/
|
|
83
|
-
function toFlagCase(key) {
|
|
84
|
-
return `--${key.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`)}`;
|
|
85
|
-
}
|
|
86
|
-
exports.toFlagCase = toFlagCase;
|
|
87
|
-
//# sourceMappingURL=toArgs.js.map
|
package/esm/utils/toArgs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toArgs.js","sourceRoot":"","sources":["../../utils/toArgs.ts"],"names":[],"mappings":";;;AAKA;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,OAAe;IACvC,MAAM,IAAI,GAAG,kBAAkB,CAAA,CAAC,kCAAkC;IAClE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,OAAO,IAAI,GAAG,EAAE,CAA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/utils/toArgs.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export type ExtractPathReturnType = {
|
|
2
|
-
id: number | undefined;
|
|
3
|
-
path: string;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Parse a request url into an object containing the id and path.
|
|
7
|
-
*
|
|
8
|
-
* @param request The request url.
|
|
9
|
-
* @returns The parsed request context or undefined.
|
|
10
|
-
*/
|
|
11
|
-
export declare function extractPath(request: string): ExtractPathReturnType;
|
|
12
|
-
/**
|
|
13
|
-
* Strips ANSI color codes from a string.
|
|
14
|
-
*
|
|
15
|
-
* @param message The string to strip.
|
|
16
|
-
* @returns The stripped string.
|
|
17
|
-
*/
|
|
18
|
-
export declare function stripColors(message: string): string;
|
|
19
|
-
export type ToArgsParameters = {
|
|
20
|
-
[key: string]: Record<string, string> | string | readonly string[] | boolean | number | bigint | undefined;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Converts an object of options to an array of command line arguments.
|
|
24
|
-
*
|
|
25
|
-
* @param options The options object.
|
|
26
|
-
* @returns The command line arguments.
|
|
27
|
-
*/
|
|
28
|
-
export declare function toArgs(parameters: ToArgsParameters): string[];
|
|
29
|
-
/**
|
|
30
|
-
* Converts a camelCase string to a flag case string.
|
|
31
|
-
*
|
|
32
|
-
* @param key The camelCase string.
|
|
33
|
-
* @returns The flag case string.
|
|
34
|
-
*/
|
|
35
|
-
export declare function toFlagCase(key: string): string;
|
|
36
|
-
//# sourceMappingURL=toArgs.d.ts.map
|
package/lib/utils/toArgs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toArgs.js","sourceRoot":"","sources":["../../utils/toArgs.ts"],"names":[],"mappings":";;;AAKA;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,OAAe;IACvC,MAAM,IAAI,GAAG,kBAAkB,CAAA,CAAC,kCAAkC;IAClE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,GA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