prool 0.0.8 → 0.0.10
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/CHANGELOG.md +12 -0
- package/_lib/exports/index.d.ts +0 -1
- package/_lib/exports/index.d.ts.map +1 -1
- package/_lib/exports/index.js +0 -1
- package/_lib/exports/index.js.map +1 -1
- package/_lib/exports/instances.d.ts +1 -0
- package/_lib/exports/instances.d.ts.map +1 -1
- package/_lib/exports/instances.js +1 -0
- package/_lib/exports/instances.js.map +1 -1
- package/_lib/instances/alto.d.ts +449 -0
- package/_lib/instances/alto.d.ts.map +1 -0
- package/_lib/instances/alto.js +67 -0
- package/_lib/instances/alto.js.map +1 -0
- package/_lib/processes/execa.d.ts.map +1 -1
- package/_lib/processes/execa.js +7 -1
- package/_lib/processes/execa.js.map +1 -1
- package/_lib/utils.d.ts +1 -1
- package/_lib/utils.d.ts.map +1 -1
- package/_lib/utils.js +2 -0
- package/_lib/utils.js.map +1 -1
- package/exports/index.test.ts +0 -1
- package/exports/index.ts +0 -8
- package/exports/instances.test.ts +1 -0
- package/exports/instances.ts +1 -0
- package/instances/alto.test.ts +124 -0
- package/instances/alto.ts +293 -0
- package/instances/anvil.test.ts +1 -1
- package/package.json +9 -1
- package/pool.test.ts +5 -1
- package/processes/execa.ts +14 -1
- package/server.test.ts +63 -28
- package/tsconfig.build.tsbuildinfo +1 -1
- package/utils.test.ts +1 -0
- package/utils.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# prool
|
|
2
2
|
|
|
3
|
+
## 0.0.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`55fb258`](https://github.com/wevm/prool/commit/55fb25899f2e7ace291bf897c92b688740b27206) Thanks [@jxom](https://github.com/jxom)! - Fixed module resolution in `alto` instance.
|
|
8
|
+
|
|
9
|
+
## 0.0.9
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#10](https://github.com/wevm/prool/pull/10) [`b7a4c95`](https://github.com/wevm/prool/commit/b7a4c9595bde2e4568e41d204f310540d0a16e3d) Thanks [@jxom](https://github.com/jxom)! - Added `alto` instance.
|
|
14
|
+
|
|
3
15
|
## 0.0.8
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/_lib/exports/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { type DefineInstanceFn, type DefineInstanceReturnType, type Instance, type InstanceOptions, type InstanceStartOptions, defineInstance, } from '../instance.js';
|
|
2
2
|
export { type DefinePoolParameters, type DefinePoolReturnType, type Pool, definePool, } from '../pool.js';
|
|
3
|
-
export { type ExecaParameters, type ExecaProcess, type ExecaReturnType, type ExecaStartOptions, execa, } from '../processes/execa.js';
|
|
4
3
|
export { type CreateServerParameters, type CreateServerReturnType, createServer, } from '../server.js';
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../exports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,cAAc,GACf,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,IAAI,EACT,UAAU,GACX,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../exports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,cAAc,GACf,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,IAAI,EACT,UAAU,GACX,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,YAAY,GACb,MAAM,cAAc,CAAA"}
|
package/_lib/exports/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../exports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,cAAc,GACf,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAIL,UAAU,GACX,MAAM,YAAY,CAAA;AAEnB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../exports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,cAAc,GACf,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAIL,UAAU,GACX,MAAM,YAAY,CAAA;AAEnB,OAAO,EAGL,YAAY,GACb,MAAM,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../exports/instances.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,EAAE,KAAK,iBAAiB,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA"}
|
|
1
|
+
{"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../exports/instances.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,EAAE,KAAK,iBAAiB,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instances.js","sourceRoot":"","sources":["../../exports/instances.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,EAA0B,OAAO,EAAE,MAAM,yBAAyB,CAAA"}
|
|
1
|
+
{"version":3,"file":"instances.js","sourceRoot":"","sources":["../../exports/instances.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAwB,KAAK,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,EAA0B,OAAO,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -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("../instance.js").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("../processes/execa.js").Process_internal;
|
|
448
|
+
}, AltoParameters | undefined>;
|
|
449
|
+
//# sourceMappingURL=alto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alto.d.ts","sourceRoot":"","sources":["../../instances/alto.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;IAC1C;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACrC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B;;OAEG;IACH,mBAAmB,CAAC,EAAE,KAAK,MAAM,EAAE,GAAG,SAAS,CAAA;IAC/C;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAA;IAC1C;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,UA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|
3
|
+
import { defineInstance } from '../instance.js';
|
|
4
|
+
import { execa } from '../processes/execa.js';
|
|
5
|
+
import { toArgs } from '../utils.js';
|
|
6
|
+
/**
|
|
7
|
+
* Defines an Alto instance.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const instance = alto({
|
|
12
|
+
* entrypoints: ['0x0000000071727De22E5E9d8BAf0edAc6f37da032'],
|
|
13
|
+
* rpcUrl: `http://localhost:8545`,
|
|
14
|
+
* executorPrivateKeys: ['0x...'],
|
|
15
|
+
* })
|
|
16
|
+
* await instance.start()
|
|
17
|
+
* // ...
|
|
18
|
+
* await instance.stop()
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export const alto = defineInstance((parameters) => {
|
|
22
|
+
const { ...args } = (parameters || {});
|
|
23
|
+
const name = 'alto';
|
|
24
|
+
const process = execa({ name });
|
|
25
|
+
return {
|
|
26
|
+
_internal: {
|
|
27
|
+
args,
|
|
28
|
+
get process() {
|
|
29
|
+
return process._internal.process;
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
host: 'localhost',
|
|
33
|
+
name,
|
|
34
|
+
port: args.port ?? 3000,
|
|
35
|
+
async start({ port = args.port ?? 3000 }, options) {
|
|
36
|
+
const binary = (() => {
|
|
37
|
+
if (args.binary)
|
|
38
|
+
return [args.binary];
|
|
39
|
+
const libPath = ('resolve' in import.meta
|
|
40
|
+
? import.meta.resolve('@pimlico/alto').split('file:')[1]
|
|
41
|
+
: require.resolve('@pimlico/alto'));
|
|
42
|
+
// Remove the `type` field from the package.json file.
|
|
43
|
+
// `@pimlico/alto`'s CLI is packaged as a CJS module.
|
|
44
|
+
// TODO: Fix upstream in `@pimlico/alto`.
|
|
45
|
+
const { type: _, ...packageJson } = JSON.parse(readFileSync(resolve(libPath, '../../package.json'), 'utf-8'));
|
|
46
|
+
writeFileSync(resolve(libPath, '../../package.json'), JSON.stringify(packageJson));
|
|
47
|
+
return ['node', resolve(libPath, '../cli/alto.js')];
|
|
48
|
+
})();
|
|
49
|
+
await process.start(($) => $ `${binary} ${toArgs({ port, ...args })}`, {
|
|
50
|
+
...options,
|
|
51
|
+
// Resolve when the process is listening via a "Server listening at" message.
|
|
52
|
+
resolver({ process, reject, resolve }) {
|
|
53
|
+
process.stdout.on('data', (data) => {
|
|
54
|
+
const message = data.toString();
|
|
55
|
+
if (message.includes('Server listening at'))
|
|
56
|
+
resolve();
|
|
57
|
+
});
|
|
58
|
+
process.stderr.on('data', reject);
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
async stop() {
|
|
63
|
+
await process.stop();
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=alto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alto.js","sourceRoot":"","sources":["../../instances/alto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AA0NpC;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,cAAc,CAAC,CAAC,UAA2B,EAAE,EAAE;IACjE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,UAAU,IAAI,EAAE,CAAmB,CAAA;IAExD,MAAM,IAAI,GAAG,MAAM,CAAA;IACnB,MAAM,OAAO,GAAG,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;IAE/B,OAAO;QACL,SAAS,EAAE;YACT,IAAI;YACJ,IAAI,OAAO;gBACT,OAAO,OAAO,CAAC,SAAS,CAAC,OAAO,CA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AO,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAAA;IAChB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACtB,CAAA;AACD,MAAM,MAAM,eAAe,GAAG,YAAY,CAAA;AAE1C,wBAAgB,KAAK,CAAC,UAAU,EAAE,eAAe,GAAG,eAAe,CAmFlE"}
|
package/_lib/processes/execa.js
CHANGED
|
@@ -2,6 +2,7 @@ import { execa as exec } from 'execa';
|
|
|
2
2
|
import { stripColors } from '../utils.js';
|
|
3
3
|
export function execa(parameters) {
|
|
4
4
|
const { name } = parameters;
|
|
5
|
+
const errorMessages = [];
|
|
5
6
|
let process;
|
|
6
7
|
async function stop() {
|
|
7
8
|
const killed = process.kill();
|
|
@@ -40,6 +41,9 @@ export function execa(parameters) {
|
|
|
40
41
|
});
|
|
41
42
|
process.stderr.on('data', async (data) => {
|
|
42
43
|
const message = stripColors(data.toString());
|
|
44
|
+
errorMessages.push(message);
|
|
45
|
+
if (errorMessages.length > 20)
|
|
46
|
+
errorMessages.shift();
|
|
43
47
|
emitter.emit('message', message);
|
|
44
48
|
emitter.emit('stderr', message);
|
|
45
49
|
});
|
|
@@ -49,7 +53,9 @@ export function execa(parameters) {
|
|
|
49
53
|
if (!code) {
|
|
50
54
|
process.removeAllListeners();
|
|
51
55
|
if (status === 'starting')
|
|
52
|
-
reject(new Error(`Failed to start process "${name}":
|
|
56
|
+
reject(new Error(`Failed to start process "${name}": ${errorMessages.length > 0
|
|
57
|
+
? `\n\n${errorMessages.join('\n')}`
|
|
58
|
+
: 'exited'}`));
|
|
53
59
|
}
|
|
54
60
|
});
|
|
55
61
|
return promise;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execa.js","sourceRoot":"","sources":["../../processes/execa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,IAAI,IAAI,EAAE,MAAM,OAAO,CAAA;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;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C,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;gBAClC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;gBAElC,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO,CAAC,kBAAkB,EAAE,CAAA;oBAC5B,IAAI,MAAM,KAAK,UAAU;wBACvB,MAAM,CACJ,IAAI,KAAK,CACP,4BAA4B,IAAI,MAC9B,aAAa,CAAC,MAAM,GAAG,CAAC;4BACtB,CAAC,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;4BACnC,CAAC,CAAC,QACN,EAAE,CACH,CACF,CAAA;gBACL,CAAC;YACH,CAAC,CAAC,CAAA;YAEF,OAAO,OAAO,CAAA;QAChB,CAAC;QACD,KAAK,CAAC,IAAI;YACR,OAAO,CAAC,kBAAkB,EAAE,CAAA;YAC5B,MAAM,IAAI,EAAE,CAAA;QACd,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/_lib/utils.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare function extractPath(request: string): ExtractPathReturnType;
|
|
|
17
17
|
*/
|
|
18
18
|
export declare function stripColors(message: string): string;
|
|
19
19
|
export type ToArgsParameters = {
|
|
20
|
-
[key: string]: Record<string, string> | string | boolean | number | bigint | undefined;
|
|
20
|
+
[key: string]: Record<string, string> | string | readonly string[] | boolean | number | bigint | undefined;
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
23
|
* Converts an object of options to an array of command line arguments.
|
package/_lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,GAAG,SAAS,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAkBlE;AAMD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,UAE1C;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,GAAG,EAAE,MAAM,GACR,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACtB,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,GACN,SAAS,CAAA;CACd,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,UAAU,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,GAAG,SAAS,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAkBlE;AAMD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,UAE1C;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,GAAG,EAAE,MAAM,GACR,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACtB,MAAM,GACN,SAAS,MAAM,EAAE,GACjB,OAAO,GACP,MAAM,GACN,MAAM,GACN,SAAS,CAAA;CACd,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,UAAU,EAAE,gBAAgB,YAwBlD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,UAErC"}
|