prool 0.0.24 → 0.1.0
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/{LICENSE → LICENSE.md} +1 -1
- package/README.md +46 -163
- package/{_lib/instance.d.ts → dist/Instance.d.ts} +28 -25
- package/dist/Instance.d.ts.map +1 -0
- package/{_lib/instance.js → dist/Instance.js} +9 -4
- package/dist/Instance.js.map +1 -0
- package/{_lib/pool.d.ts → dist/Pool.d.ts} +15 -13
- package/dist/Pool.d.ts.map +1 -0
- package/{_lib/pool.js → dist/Pool.js} +3 -3
- package/dist/Pool.js.map +1 -0
- package/{_lib/server.d.ts → dist/Server.d.ts} +7 -10
- package/dist/Server.d.ts.map +1 -0
- package/{_lib/server.js → dist/Server.js} +31 -10
- package/dist/Server.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/instances/alto.d.ts +452 -0
- package/dist/instances/alto.d.ts.map +1 -0
- package/{_lib → dist}/instances/alto.js +4 -4
- package/dist/instances/alto.js.map +1 -0
- package/dist/instances/anvil.d.ts +458 -0
- package/dist/instances/anvil.d.ts.map +1 -0
- package/{_lib → dist}/instances/anvil.js +4 -4
- package/dist/instances/anvil.js.map +1 -0
- package/dist/instances/tempo.d.ts +157 -0
- package/dist/instances/tempo.d.ts.map +1 -0
- package/dist/instances/tempo.js +187 -0
- package/dist/instances/tempo.js.map +1 -0
- package/dist/internal/utils.d.ts.map +1 -0
- package/{_lib → dist/internal}/utils.js +1 -1
- package/dist/internal/utils.js.map +1 -0
- package/{_lib → dist}/processes/execa.d.ts +11 -10
- package/dist/processes/execa.d.ts.map +1 -0
- package/{_lib → dist}/processes/execa.js +1 -1
- package/dist/processes/execa.js.map +1 -0
- package/package.json +17 -16
- package/{instance.test.ts → src/Instance.test.ts} +12 -12
- package/{instance.ts → src/Instance.ts} +51 -42
- package/{pool.test.ts → src/Pool.test.ts} +41 -55
- package/{pool.ts → src/Pool.ts} +21 -19
- package/{server.test.ts → src/Server.test.ts} +26 -149
- package/{server.ts → src/Server.ts} +34 -12
- package/src/index.ts +3 -0
- package/{instances → src/instances}/alto.test.ts +8 -11
- package/src/instances/alto.ts +289 -0
- package/{instances → src/instances}/anvil.test.ts +5 -6
- package/src/instances/anvil.ts +306 -0
- package/{instances/silius.test.ts → src/instances/tempo.test.ts} +20 -44
- package/src/instances/tempo.ts +278 -0
- package/{utils.test.ts → src/internal/utils.test.ts} +6 -6
- package/{utils.ts → src/internal/utils.ts} +1 -1
- package/{processes → src/processes}/execa.test.ts +6 -11
- package/{processes → src/processes}/execa.ts +19 -15
- package/src/processes/index.ts +1 -0
- package/CHANGELOG.md +0 -148
- package/_lib/exports/index.d.ts +0 -5
- package/_lib/exports/index.d.ts.map +0 -1
- package/_lib/exports/index.js +0 -5
- package/_lib/exports/index.js.map +0 -1
- package/_lib/exports/instances.d.ts +0 -7
- package/_lib/exports/instances.d.ts.map +0 -1
- package/_lib/exports/instances.js +0 -7
- package/_lib/exports/instances.js.map +0 -1
- package/_lib/exports/processes.d.ts +0 -2
- package/_lib/exports/processes.d.ts.map +0 -1
- package/_lib/exports/processes.js +0 -2
- package/_lib/exports/processes.js.map +0 -1
- package/_lib/instance.d.ts.map +0 -1
- package/_lib/instance.js.map +0 -1
- package/_lib/instances/alto.d.ts +0 -449
- package/_lib/instances/alto.d.ts.map +0 -1
- package/_lib/instances/alto.js.map +0 -1
- package/_lib/instances/anvil.d.ts +0 -455
- package/_lib/instances/anvil.d.ts.map +0 -1
- package/_lib/instances/anvil.js.map +0 -1
- package/_lib/instances/rundler.d.ts +0 -604
- package/_lib/instances/rundler.d.ts.map +0 -1
- package/_lib/instances/rundler.js +0 -86
- package/_lib/instances/rundler.js.map +0 -1
- package/_lib/instances/silius.d.ts +0 -224
- package/_lib/instances/silius.d.ts.map +0 -1
- package/_lib/instances/silius.js +0 -117
- package/_lib/instances/silius.js.map +0 -1
- package/_lib/instances/stackup.d.ts +0 -86
- package/_lib/instances/stackup.d.ts.map +0 -1
- package/_lib/instances/stackup.js +0 -89
- package/_lib/instances/stackup.js.map +0 -1
- package/_lib/pool.d.ts.map +0 -1
- package/_lib/pool.js.map +0 -1
- package/_lib/processes/execa.d.ts.map +0 -1
- package/_lib/processes/execa.js.map +0 -1
- package/_lib/server.d.ts.map +0 -1
- package/_lib/server.js.map +0 -1
- package/_lib/utils.d.ts.map +0 -1
- package/_lib/utils.js.map +0 -1
- package/exports/index.test.ts +0 -16
- package/exports/index.ts +0 -29
- package/exports/instances.test.ts +0 -15
- package/exports/instances.ts +0 -13
- package/exports/processes.test.ts +0 -10
- package/exports/processes.ts +0 -8
- package/instances/alto.ts +0 -280
- package/instances/anvil.ts +0 -304
- package/instances/package.json +0 -5
- package/instances/rundler.test.ts +0 -111
- package/instances/rundler.ts +0 -451
- package/instances/silius.ts +0 -347
- package/instances/stackup.test.ts +0 -106
- package/instances/stackup.ts +0 -162
- package/processes/package.json +0 -5
- package/tsconfig.build.tsbuildinfo +0 -1
- /package/{_lib → dist/internal}/utils.d.ts +0 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { resolve } from 'node:path'
|
|
2
|
+
import * as Instance from '../Instance.js'
|
|
3
|
+
import { toArgs } from '../internal/utils.js'
|
|
4
|
+
import { execa } from '../processes/execa.js'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Defines an Alto instance.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const instance = 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 = Instance.define((parameters?: alto.Parameters) => {
|
|
22
|
+
const { ...args } = (parameters || {}) as alto.Parameters
|
|
23
|
+
|
|
24
|
+
const name = 'alto'
|
|
25
|
+
const process = execa({ name })
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
_internal: {
|
|
29
|
+
args,
|
|
30
|
+
get process() {
|
|
31
|
+
return process._internal.process
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
host: 'localhost',
|
|
35
|
+
name,
|
|
36
|
+
port: args.port ?? 3000,
|
|
37
|
+
async start({ port = args.port ?? 3000 }, options) {
|
|
38
|
+
const binary = (() => {
|
|
39
|
+
if (args.binary) return [args.binary]
|
|
40
|
+
const libPath = (
|
|
41
|
+
'resolve' in import.meta
|
|
42
|
+
? import.meta.resolve('@pimlico/alto').split('file:')[1]
|
|
43
|
+
: require.resolve('@pimlico/alto')
|
|
44
|
+
)!
|
|
45
|
+
return ['node', resolve(libPath, '../cli/alto.js')]
|
|
46
|
+
})()
|
|
47
|
+
|
|
48
|
+
await process.start(($) => $`${binary} ${toArgs({ port, ...args })}`, {
|
|
49
|
+
...options,
|
|
50
|
+
// Resolve when the process is listening via a "Server listening at" message.
|
|
51
|
+
resolver({ process, reject, resolve }) {
|
|
52
|
+
process.stdout.on('data', (data) => {
|
|
53
|
+
const message = data.toString()
|
|
54
|
+
if (message.includes('Server listening at')) resolve()
|
|
55
|
+
})
|
|
56
|
+
process.stderr.on('data', reject)
|
|
57
|
+
},
|
|
58
|
+
})
|
|
59
|
+
},
|
|
60
|
+
async stop() {
|
|
61
|
+
await process.stop()
|
|
62
|
+
},
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
export declare namespace alto {
|
|
67
|
+
export type Parameters = {
|
|
68
|
+
/**
|
|
69
|
+
* API version (used for internal Pimlico versioning compatibility).
|
|
70
|
+
*/
|
|
71
|
+
apiVersion?: readonly string[] | undefined
|
|
72
|
+
/**
|
|
73
|
+
* Override the sender native token balance during estimation
|
|
74
|
+
*/
|
|
75
|
+
balanceOverride?: boolean | undefined
|
|
76
|
+
/**
|
|
77
|
+
* Binary path of the `alto` executable.
|
|
78
|
+
*/
|
|
79
|
+
binary?: string | undefined
|
|
80
|
+
/**
|
|
81
|
+
* Address of the `BundleBulker` contract.
|
|
82
|
+
*/
|
|
83
|
+
bundleBulkerAddress?: `0x${string}` | undefined
|
|
84
|
+
/**
|
|
85
|
+
* Set if the bundler bundle user operations automatically or only when calling `debug_bundler_sendBundleNow`.
|
|
86
|
+
* @default "auto"
|
|
87
|
+
*/
|
|
88
|
+
bundleMode?: 'auto' | 'manual' | undefined
|
|
89
|
+
/**
|
|
90
|
+
* Indicates weather the chain is a OP stack chain, arbitrum chain, or default EVM chain.
|
|
91
|
+
*/
|
|
92
|
+
chainType?: 'default' | 'op-stack' | 'arbitrum' | undefined
|
|
93
|
+
/**
|
|
94
|
+
* Path to JSON config file.
|
|
95
|
+
*/
|
|
96
|
+
config?: string | undefined
|
|
97
|
+
/**
|
|
98
|
+
* Skip user operation validation, use with caution.
|
|
99
|
+
*/
|
|
100
|
+
dangerousSkipUserOperationValidation?: boolean | undefined
|
|
101
|
+
/**
|
|
102
|
+
* Default API version.
|
|
103
|
+
*/
|
|
104
|
+
defaultApiVersion?: string | undefined
|
|
105
|
+
/**
|
|
106
|
+
* Enable debug endpoints.
|
|
107
|
+
* @default false
|
|
108
|
+
*/
|
|
109
|
+
enableDebugEndpoints?: boolean | undefined
|
|
110
|
+
/**
|
|
111
|
+
* Include user ops with the same sender in the single bundle.
|
|
112
|
+
* @default true
|
|
113
|
+
*/
|
|
114
|
+
enforceUniqueSendersPerBundle?: boolean | undefined
|
|
115
|
+
/**
|
|
116
|
+
* EntryPoint contract addresses.
|
|
117
|
+
*/
|
|
118
|
+
entrypoints: readonly `0x${string}`[]
|
|
119
|
+
/**
|
|
120
|
+
* Address of the EntryPoint simulations contract.
|
|
121
|
+
*/
|
|
122
|
+
entrypointSimulationContract?: `0x${string}` | undefined
|
|
123
|
+
/**
|
|
124
|
+
* Private keys of the executor accounts.
|
|
125
|
+
*/
|
|
126
|
+
executorPrivateKeys?: readonly `0x${string}`[]
|
|
127
|
+
/**
|
|
128
|
+
* Interval to refill the signer balance (seconds).
|
|
129
|
+
* @default 1200
|
|
130
|
+
*/
|
|
131
|
+
executorRefillInterval?: number | undefined
|
|
132
|
+
/**
|
|
133
|
+
* Should the node make expiration checks.
|
|
134
|
+
* @default true
|
|
135
|
+
*/
|
|
136
|
+
expirationCheck?: boolean | undefined
|
|
137
|
+
/**
|
|
138
|
+
* Amount to multiply the gas prices fetched from the node.
|
|
139
|
+
* @default "100"
|
|
140
|
+
*/
|
|
141
|
+
gasPriceBump?: string | undefined
|
|
142
|
+
/**
|
|
143
|
+
* Maximum that the gas prices fetched using pimlico_getUserOperationGasPrice will be accepted for (seconds).
|
|
144
|
+
* @default 10
|
|
145
|
+
*/
|
|
146
|
+
gasPriceExpiry?: number | undefined
|
|
147
|
+
/**
|
|
148
|
+
* The minimum percentage of incoming user operation gas prices compared to the gas price used by the bundler to submit bundles.
|
|
149
|
+
* @default 101
|
|
150
|
+
*/
|
|
151
|
+
gasPriceFloorPercent?: number | undefined
|
|
152
|
+
/**
|
|
153
|
+
* Amount to multiply the gas prices fetched using `pimlico_getUserOperationGasPrice`.
|
|
154
|
+
* @default "105,110,115"
|
|
155
|
+
*/
|
|
156
|
+
gasPriceMultipliers?: readonly string[] | undefined
|
|
157
|
+
/**
|
|
158
|
+
* Use a fixed value for gas limits during bundle transaction gas limit estimations
|
|
159
|
+
*/
|
|
160
|
+
fixedGasLimitForEstimation?: string | undefined
|
|
161
|
+
/**
|
|
162
|
+
* Flush stuck transactions with old nonces during bundler startup.
|
|
163
|
+
*/
|
|
164
|
+
flushStuckTransactionsDuringStartup?: boolean | undefined
|
|
165
|
+
/**
|
|
166
|
+
* Log in JSON format.
|
|
167
|
+
*/
|
|
168
|
+
json?: boolean | undefined
|
|
169
|
+
/**
|
|
170
|
+
* Send legacy transactions instead of an EIP-1559 transactions.
|
|
171
|
+
* @default false
|
|
172
|
+
*/
|
|
173
|
+
legacyTransactions?: boolean | undefined
|
|
174
|
+
/**
|
|
175
|
+
* Calculate the bundle transaction gas limits locally instead of using the RPC gas limit estimation.
|
|
176
|
+
*/
|
|
177
|
+
localGasLimitCalculation?: boolean | undefined
|
|
178
|
+
/**
|
|
179
|
+
* Default log level.
|
|
180
|
+
*/
|
|
181
|
+
logLevel?:
|
|
182
|
+
| 'trace'
|
|
183
|
+
| 'debug'
|
|
184
|
+
| 'info'
|
|
185
|
+
| 'warn'
|
|
186
|
+
| 'error'
|
|
187
|
+
| 'fatal'
|
|
188
|
+
| undefined
|
|
189
|
+
/**
|
|
190
|
+
* Max block range for `eth_getLogs` calls.
|
|
191
|
+
*/
|
|
192
|
+
maxBlockRange?: number | undefined
|
|
193
|
+
/**
|
|
194
|
+
* Maximum number of operations allowed in the mempool before a bundle is submitted.
|
|
195
|
+
* @default 10
|
|
196
|
+
*/
|
|
197
|
+
maxBundleSize?: number | undefined
|
|
198
|
+
/**
|
|
199
|
+
* Maximum time to wait for a bundle to be submitted (ms).
|
|
200
|
+
* @default 1000
|
|
201
|
+
*/
|
|
202
|
+
maxBundleWait?: number | undefined
|
|
203
|
+
/**
|
|
204
|
+
* Maximum amount of gas per bundle.
|
|
205
|
+
* @default "5000000"
|
|
206
|
+
*/
|
|
207
|
+
maxGasPerBundle?: string | undefined
|
|
208
|
+
/**
|
|
209
|
+
* Maximum number of executor accounts to use from the list of executor private keys.
|
|
210
|
+
*/
|
|
211
|
+
maxExecutors?: number | undefined
|
|
212
|
+
/**
|
|
213
|
+
* Maximum amount of parallel user ops to keep in the meempool (same sender, different nonce keys).
|
|
214
|
+
* @default 10
|
|
215
|
+
*/
|
|
216
|
+
mempoolMaxParallelOps?: number | undefined
|
|
217
|
+
/**
|
|
218
|
+
* Maximum amount of sequential user ops to keep in the mempool (same sender and nonce key, different nonce values).
|
|
219
|
+
* @default 0
|
|
220
|
+
*/
|
|
221
|
+
mempoolMaxQueuedOps?: number | undefined
|
|
222
|
+
/**
|
|
223
|
+
* Minimum stake required for a relay (in 10e18).
|
|
224
|
+
* @default 1
|
|
225
|
+
*/
|
|
226
|
+
minEntityStake?: number | undefined
|
|
227
|
+
/**
|
|
228
|
+
* Minimum unstake delay (seconds).
|
|
229
|
+
* @default 1
|
|
230
|
+
*/
|
|
231
|
+
minEntityUnstakeDelay?: number | undefined
|
|
232
|
+
/**
|
|
233
|
+
* Minimum balance required for each executor account (below which the utility account will refill).
|
|
234
|
+
*/
|
|
235
|
+
minExecutorBalance?: string | undefined
|
|
236
|
+
/**
|
|
237
|
+
* Name of the network (used for metrics).
|
|
238
|
+
* @default "localhost"
|
|
239
|
+
*/
|
|
240
|
+
networkName?: string | undefined
|
|
241
|
+
/**
|
|
242
|
+
* Amount to multiply the paymaster gas limits fetched from simulations.
|
|
243
|
+
*/
|
|
244
|
+
paymasterGasLimitMultiplier?: string | undefined
|
|
245
|
+
/**
|
|
246
|
+
* Address of the `PerOpInflator` contract.
|
|
247
|
+
*/
|
|
248
|
+
perOpInflatorAddress?: `0x${string}` | undefined
|
|
249
|
+
/**
|
|
250
|
+
* Polling interval for querying for new blocks (ms).
|
|
251
|
+
* @default 1000
|
|
252
|
+
*/
|
|
253
|
+
pollingInterval?: number | undefined
|
|
254
|
+
/**
|
|
255
|
+
* Port to listen on.
|
|
256
|
+
* @default 3000
|
|
257
|
+
*/
|
|
258
|
+
port?: number | undefined
|
|
259
|
+
/**
|
|
260
|
+
* RPC url to connect to.
|
|
261
|
+
*/
|
|
262
|
+
rpcUrl: string
|
|
263
|
+
/**
|
|
264
|
+
* Enable safe mode (enforcing all ERC-4337 rules).
|
|
265
|
+
* @default true
|
|
266
|
+
*/
|
|
267
|
+
safeMode?: boolean | undefined
|
|
268
|
+
/**
|
|
269
|
+
* RPC url to send transactions to (e.g. flashbots relay).
|
|
270
|
+
*/
|
|
271
|
+
sendTransactionRpcUrl?: string | undefined
|
|
272
|
+
/**
|
|
273
|
+
* Timeout for incoming requests (in ms).
|
|
274
|
+
*/
|
|
275
|
+
timeout?: number | undefined
|
|
276
|
+
/**
|
|
277
|
+
* Private key of the utility account.
|
|
278
|
+
*/
|
|
279
|
+
utilityPrivateKey?: string | undefined
|
|
280
|
+
/**
|
|
281
|
+
* Maximum payload size for websocket messages in bytes (default to 1MB).
|
|
282
|
+
*/
|
|
283
|
+
websocketMaxPayloadSize?: number | undefined
|
|
284
|
+
/**
|
|
285
|
+
* Enable websocket server.
|
|
286
|
+
*/
|
|
287
|
+
websocket?: boolean | undefined
|
|
288
|
+
}
|
|
289
|
+
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
+
import { Instance } from 'prool'
|
|
1
2
|
import { afterEach, expect, test } from 'vitest'
|
|
2
|
-
import type { Instance } from '../instance.js'
|
|
3
|
-
import { type AnvilParameters, anvil } from './anvil.js'
|
|
4
3
|
|
|
5
|
-
const instances: Instance[] = []
|
|
4
|
+
const instances: Instance.Instance[] = []
|
|
6
5
|
const timestamp = 1717114065
|
|
7
6
|
|
|
8
|
-
const defineInstance = (parameters:
|
|
9
|
-
const instance = anvil(parameters)
|
|
7
|
+
const defineInstance = (parameters: Instance.anvil.Parameters = {}) => {
|
|
8
|
+
const instance = Instance.anvil(parameters)
|
|
10
9
|
instances.push(instance)
|
|
11
10
|
return instance
|
|
12
11
|
}
|
|
@@ -100,7 +99,7 @@ test.skip('behavior: starts anvil with custom options', async () => {
|
|
|
100
99
|
test('behavior: exit', async () => {
|
|
101
100
|
const instance = defineInstance({ timestamp })
|
|
102
101
|
|
|
103
|
-
let exitCode: number | null | undefined
|
|
102
|
+
let exitCode: number | null | undefined
|
|
104
103
|
instance.on('exit', (code) => {
|
|
105
104
|
exitCode = code
|
|
106
105
|
})
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import * as Instance from '../Instance.js'
|
|
2
|
+
import { toArgs } from '../internal/utils.js'
|
|
3
|
+
import { execa } from '../processes/execa.js'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Defines an Anvil instance.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const instance = Instance.anvil({ forkRpcUrl: 'https://cloudflare-eth.com', port: 8546 })
|
|
11
|
+
* await instance.start()
|
|
12
|
+
* // ...
|
|
13
|
+
* await instance.stop()
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export const anvil = Instance.define((parameters?: anvil.Parameters) => {
|
|
17
|
+
const { binary = 'anvil', ...args } = parameters || {}
|
|
18
|
+
|
|
19
|
+
const name = 'anvil'
|
|
20
|
+
const process = execa({ name })
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
_internal: {
|
|
24
|
+
args,
|
|
25
|
+
get process() {
|
|
26
|
+
return process._internal.process
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
host: args.host ?? 'localhost',
|
|
30
|
+
name,
|
|
31
|
+
port: args.port ?? 8545,
|
|
32
|
+
async start({ port = args.port }, options) {
|
|
33
|
+
return await process.start(
|
|
34
|
+
($) =>
|
|
35
|
+
$({
|
|
36
|
+
env: {
|
|
37
|
+
FOUNDRY_DISABLE_NIGHTLY_WARNING: 'true',
|
|
38
|
+
},
|
|
39
|
+
})`${binary} ${toArgs({ ...args, port })}`,
|
|
40
|
+
{
|
|
41
|
+
...options,
|
|
42
|
+
// Resolve when the process is listening via a "Listening on" message.
|
|
43
|
+
resolver({ process, reject, resolve }) {
|
|
44
|
+
process.stdout.on('data', (data) => {
|
|
45
|
+
const message = data.toString()
|
|
46
|
+
if (message.includes('Listening on')) resolve()
|
|
47
|
+
})
|
|
48
|
+
process.stderr.on('data', (data) => {
|
|
49
|
+
const message = data.toString()
|
|
50
|
+
if (message.includes('Warning')) return
|
|
51
|
+
reject(message)
|
|
52
|
+
})
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
)
|
|
56
|
+
},
|
|
57
|
+
async stop() {
|
|
58
|
+
await process.stop()
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
export declare namespace anvil {
|
|
64
|
+
export type Parameters = {
|
|
65
|
+
/**
|
|
66
|
+
* Number of dev accounts to generate and configure.
|
|
67
|
+
*
|
|
68
|
+
* @defaultValue 10
|
|
69
|
+
*/
|
|
70
|
+
accounts?: number | undefined
|
|
71
|
+
/**
|
|
72
|
+
* Set the Access-Control-Allow-Origin response header (CORS).
|
|
73
|
+
*
|
|
74
|
+
* @defaultValue *
|
|
75
|
+
*/
|
|
76
|
+
allowOrigin?: string | undefined
|
|
77
|
+
/**
|
|
78
|
+
* Enable autoImpersonate on startup
|
|
79
|
+
*/
|
|
80
|
+
autoImpersonate?: boolean | undefined
|
|
81
|
+
/**
|
|
82
|
+
* The balance of every dev account in Ether.
|
|
83
|
+
*
|
|
84
|
+
* @defaultValue 10000
|
|
85
|
+
*/
|
|
86
|
+
balance?: number | bigint | undefined
|
|
87
|
+
/**
|
|
88
|
+
* The base fee in a block.
|
|
89
|
+
*/
|
|
90
|
+
blockBaseFeePerGas?: number | bigint | undefined
|
|
91
|
+
/**
|
|
92
|
+
* Block time in seconds for interval mining.
|
|
93
|
+
*/
|
|
94
|
+
blockTime?: number | undefined
|
|
95
|
+
/**
|
|
96
|
+
* Path or alias to the Anvil binary.
|
|
97
|
+
*/
|
|
98
|
+
binary?: string | undefined
|
|
99
|
+
/**
|
|
100
|
+
* The chain id.
|
|
101
|
+
*/
|
|
102
|
+
chainId?: number | undefined
|
|
103
|
+
/**
|
|
104
|
+
* EIP-170: Contract code size limit in bytes. Useful to increase this because of tests.
|
|
105
|
+
*
|
|
106
|
+
* @defaultValue 0x6000 (~25kb)
|
|
107
|
+
*/
|
|
108
|
+
codeSizeLimit?: number | undefined
|
|
109
|
+
/**
|
|
110
|
+
* Sets the number of assumed available compute units per second for this fork provider.
|
|
111
|
+
*
|
|
112
|
+
* @defaultValue 350
|
|
113
|
+
* @see https://github.com/alchemyplatform/alchemy-docs/blob/master/documentation/compute-units.md#rate-limits-cups
|
|
114
|
+
*/
|
|
115
|
+
computeUnitsPerSecond?: number | undefined
|
|
116
|
+
/**
|
|
117
|
+
* Writes output of `anvil` as json to user-specified file.
|
|
118
|
+
*/
|
|
119
|
+
configOut?: string | undefined
|
|
120
|
+
/**
|
|
121
|
+
* Sets the derivation path of the child key to be derived.
|
|
122
|
+
*
|
|
123
|
+
* @defaultValue m/44'/60'/0'/0/
|
|
124
|
+
*/
|
|
125
|
+
derivationPath?: string | undefined
|
|
126
|
+
/**
|
|
127
|
+
* Disable the `call.gas_limit <= block.gas_limit` constraint.
|
|
128
|
+
*/
|
|
129
|
+
disableBlockGasLimit?: boolean | undefined
|
|
130
|
+
/**
|
|
131
|
+
* Dump the state of chain on exit to the given file. If the value is a directory, the state will be
|
|
132
|
+
* written to `<VALUE>/state.json`.
|
|
133
|
+
*/
|
|
134
|
+
dumpState?: string | undefined
|
|
135
|
+
/**
|
|
136
|
+
* Fetch state over a remote endpoint instead of starting from an empty state.
|
|
137
|
+
*
|
|
138
|
+
* If you want to fetch state from a specific block number, add a block number like `http://localhost:8545@1400000`
|
|
139
|
+
* or use the `forkBlockNumber` option.
|
|
140
|
+
*/
|
|
141
|
+
forkUrl?: string | undefined
|
|
142
|
+
/**
|
|
143
|
+
* Fetch state from a specific block number over a remote endpoint.
|
|
144
|
+
*
|
|
145
|
+
* Requires `forkUrl` to be set.
|
|
146
|
+
*/
|
|
147
|
+
forkBlockNumber?: number | bigint | undefined
|
|
148
|
+
/**
|
|
149
|
+
* Specify chain id to skip fetching it from remote endpoint. This enables offline-start mode.
|
|
150
|
+
*
|
|
151
|
+
* You still must pass both `forkUrl` and `forkBlockNumber`, and already have your required state cached
|
|
152
|
+
* on disk, anything missing locally would be fetched from the remote.
|
|
153
|
+
*/
|
|
154
|
+
forkChainId?: number | undefined
|
|
155
|
+
/**
|
|
156
|
+
* Specify headers to send along with any request to the remote JSON-RPC server in forking mode.
|
|
157
|
+
*
|
|
158
|
+
* e.g. "User-Agent: test-agent"
|
|
159
|
+
*
|
|
160
|
+
* Requires `forkUrl` to be set.
|
|
161
|
+
*/
|
|
162
|
+
forkHeader?: Record<string, string> | undefined
|
|
163
|
+
/**
|
|
164
|
+
* Initial retry backoff on encountering errors.
|
|
165
|
+
*/
|
|
166
|
+
forkRetryBackoff?: number | undefined
|
|
167
|
+
/**
|
|
168
|
+
* The block gas limit.
|
|
169
|
+
*/
|
|
170
|
+
gasLimit?: number | bigint | undefined
|
|
171
|
+
/**
|
|
172
|
+
* The gas price.
|
|
173
|
+
*/
|
|
174
|
+
gasPrice?: number | bigint | undefined
|
|
175
|
+
/**
|
|
176
|
+
* The EVM hardfork to use.
|
|
177
|
+
*/
|
|
178
|
+
hardfork?:
|
|
179
|
+
| 'Frontier'
|
|
180
|
+
| 'Homestead'
|
|
181
|
+
| 'Dao'
|
|
182
|
+
| 'Tangerine'
|
|
183
|
+
| 'SpuriousDragon'
|
|
184
|
+
| 'Byzantium'
|
|
185
|
+
| 'Constantinople'
|
|
186
|
+
| 'Petersburg'
|
|
187
|
+
| 'Istanbul'
|
|
188
|
+
| 'Muirglacier'
|
|
189
|
+
| 'Berlin'
|
|
190
|
+
| 'London'
|
|
191
|
+
| 'ArrowGlacier'
|
|
192
|
+
| 'GrayGlacier'
|
|
193
|
+
| 'Paris'
|
|
194
|
+
| 'Shanghai'
|
|
195
|
+
| 'Cancun'
|
|
196
|
+
| 'Prague'
|
|
197
|
+
| 'Latest'
|
|
198
|
+
| undefined
|
|
199
|
+
/**
|
|
200
|
+
* The host the server will listen on.
|
|
201
|
+
*/
|
|
202
|
+
host?: string | undefined
|
|
203
|
+
/**
|
|
204
|
+
* Initialize the genesis block with the given `genesis.json` file.
|
|
205
|
+
*/
|
|
206
|
+
init?: string | undefined
|
|
207
|
+
/**
|
|
208
|
+
* Launch an ipc server at the given path or default path = `/tmp/anvil.ipc`.
|
|
209
|
+
*/
|
|
210
|
+
ipc?: string | undefined
|
|
211
|
+
/**
|
|
212
|
+
* Initialize the chain from a previously saved state snapshot.
|
|
213
|
+
*/
|
|
214
|
+
loadState?: string | undefined
|
|
215
|
+
/**
|
|
216
|
+
* BIP39 mnemonic phrase used for generating accounts.
|
|
217
|
+
*/
|
|
218
|
+
mnemonic?: string | undefined
|
|
219
|
+
/**
|
|
220
|
+
* Automatically generates a BIP39 mnemonic phrase, and derives accounts from it.
|
|
221
|
+
*/
|
|
222
|
+
mnemonicRandom?: boolean | undefined
|
|
223
|
+
/**
|
|
224
|
+
* Disable CORS.
|
|
225
|
+
*/
|
|
226
|
+
noCors?: boolean | undefined
|
|
227
|
+
/**
|
|
228
|
+
* Disable auto and interval mining, and mine on demand instead.
|
|
229
|
+
*/
|
|
230
|
+
noMining?: boolean | undefined
|
|
231
|
+
/**
|
|
232
|
+
* Disables rate limiting for this node's provider.
|
|
233
|
+
*
|
|
234
|
+
* @defaultValue false
|
|
235
|
+
* @see https://github.com/alchemyplatform/alchemy-docs/blob/master/documentation/compute-units.md#rate-limits-cups
|
|
236
|
+
*/
|
|
237
|
+
noRateLimit?: boolean | undefined
|
|
238
|
+
/**
|
|
239
|
+
* Explicitly disables the use of RPC caching.
|
|
240
|
+
*
|
|
241
|
+
* All storage slots are read entirely from the endpoint.
|
|
242
|
+
*/
|
|
243
|
+
noStorageCaching?: boolean | undefined
|
|
244
|
+
/**
|
|
245
|
+
* How transactions are sorted in the mempool.
|
|
246
|
+
*
|
|
247
|
+
* @defaultValue fees
|
|
248
|
+
*/
|
|
249
|
+
order?: string | undefined
|
|
250
|
+
/**
|
|
251
|
+
* Run an Optimism chain.
|
|
252
|
+
*/
|
|
253
|
+
optimism?: boolean | undefined
|
|
254
|
+
/**
|
|
255
|
+
* Port number to listen on.
|
|
256
|
+
*
|
|
257
|
+
* @defaultValue 8545
|
|
258
|
+
*/
|
|
259
|
+
port?: number | undefined
|
|
260
|
+
/**
|
|
261
|
+
* Don't keep full chain history. If a number argument is specified, at most this number of states is kept in memory.
|
|
262
|
+
*/
|
|
263
|
+
pruneHistory?: number | undefined | boolean
|
|
264
|
+
/**
|
|
265
|
+
* Number of retry requests for spurious networks (timed out requests).
|
|
266
|
+
*
|
|
267
|
+
* @defaultValue 5
|
|
268
|
+
*/
|
|
269
|
+
retries?: number | undefined
|
|
270
|
+
/**
|
|
271
|
+
* Don't print anything on startup and don't print logs.
|
|
272
|
+
*/
|
|
273
|
+
silent?: boolean | undefined
|
|
274
|
+
/**
|
|
275
|
+
* Slots in an epoch.
|
|
276
|
+
*/
|
|
277
|
+
slotsInAnEpoch?: number | undefined
|
|
278
|
+
/**
|
|
279
|
+
* Enable steps tracing used for debug calls returning geth-style traces.
|
|
280
|
+
*/
|
|
281
|
+
stepsTracing?: boolean | undefined
|
|
282
|
+
/**
|
|
283
|
+
* Interval in seconds at which the status is to be dumped to disk.
|
|
284
|
+
*/
|
|
285
|
+
stateInterval?: number | undefined
|
|
286
|
+
/**
|
|
287
|
+
* This is an alias for both `loadState` and `dumpState`. It initializes the chain with the state stored at the
|
|
288
|
+
* file, if it exists, and dumps the chain's state on exit
|
|
289
|
+
*/
|
|
290
|
+
state?: string | undefined
|
|
291
|
+
/**
|
|
292
|
+
* Timeout in ms for requests sent to remote JSON-RPC server in forking mode.
|
|
293
|
+
*
|
|
294
|
+
* @defaultValue 45000
|
|
295
|
+
*/
|
|
296
|
+
timeout?: number | undefined
|
|
297
|
+
/**
|
|
298
|
+
* The timestamp of the genesis block.
|
|
299
|
+
*/
|
|
300
|
+
timestamp?: number | bigint | undefined
|
|
301
|
+
/**
|
|
302
|
+
* Number of blocks with transactions to keep in memory.
|
|
303
|
+
*/
|
|
304
|
+
transactionBlockKeeper?: number | undefined
|
|
305
|
+
}
|
|
306
|
+
}
|