@pimlico/alto 0.0.0-prool.20240609T211112 → 0.0.0-prool.20240609T212524
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/cli/alto.js +59 -28
- package/esm/cli/alto.js.map +1 -1
- package/esm/cli/config/bundler.d.ts +38 -38
- package/esm/cli/config/bundler.js +77 -74
- package/esm/cli/config/bundler.js.map +1 -1
- package/esm/cli/config/index.js +18 -2
- package/esm/cli/config/index.js.map +1 -1
- package/esm/cli/config/options.js +13 -10
- package/esm/cli/config/options.js.map +1 -1
- package/esm/cli/customTransport.js +11 -7
- package/esm/cli/customTransport.js.map +1 -1
- package/esm/cli/handler.js +28 -24
- package/esm/cli/handler.js.map +1 -1
- package/esm/cli/index.js +19 -3
- package/esm/cli/index.js.map +1 -1
- package/esm/cli/instrumentation.js +22 -20
- package/esm/cli/instrumentation.js.map +1 -1
- package/esm/cli/setupServer.js +21 -17
- package/esm/cli/setupServer.js.map +1 -1
- package/esm/cli/util.js +5 -1
- package/esm/cli/util.js.map +1 -1
- package/esm/executor/executor.js +84 -56
- package/esm/executor/executor.js.map +1 -1
- package/esm/executor/executorManager.js +11 -7
- package/esm/executor/executorManager.js.map +1 -1
- package/esm/executor/index.js +20 -4
- package/esm/executor/index.js.map +1 -1
- package/esm/executor/senderManager.js +12 -8
- package/esm/executor/senderManager.js.map +1 -1
- package/esm/executor/test/utils.js +28 -22
- package/esm/executor/test/utils.js.map +1 -1
- package/esm/executor/utils.js +61 -31
- package/esm/executor/utils.js.map +1 -1
- package/esm/mempool/index.js +20 -4
- package/esm/mempool/index.js.map +1 -1
- package/esm/mempool/mempool.js +59 -55
- package/esm/mempool/mempool.js.map +1 -1
- package/esm/mempool/monitoring.js +5 -1
- package/esm/mempool/monitoring.js.map +1 -1
- package/esm/mempool/nullMempool.js +5 -1
- package/esm/mempool/nullMempool.js.map +1 -1
- package/esm/mempool/reputationManager.js +49 -44
- package/esm/mempool/reputationManager.js.map +1 -1
- package/esm/mempool/store.js +5 -1
- package/esm/mempool/store.js.map +1 -1
- package/esm/rpc/EntryPointSimulationsV07.js +50 -44
- package/esm/rpc/EntryPointSimulationsV07.js.map +1 -1
- package/esm/rpc/ExecuteSimulator.js +5 -2
- package/esm/rpc/ExecuteSimulator.js.map +1 -1
- package/esm/rpc/gasEstimation.js +69 -62
- package/esm/rpc/gasEstimation.js.map +1 -1
- package/esm/rpc/index.js +20 -4
- package/esm/rpc/index.js.map +1 -1
- package/esm/rpc/nonceQueuer.js +20 -16
- package/esm/rpc/nonceQueuer.js.map +1 -1
- package/esm/rpc/rpcHandler.js +103 -76
- package/esm/rpc/rpcHandler.js.map +1 -1
- package/esm/rpc/server.js +58 -28
- package/esm/rpc/server.js.map +1 -1
- package/esm/rpc/validation/BundlerCollectorTracerV06.js +5 -1
- package/esm/rpc/validation/BundlerCollectorTracerV06.js.map +1 -1
- package/esm/rpc/validation/BundlerCollectorTracerV07.js +5 -1
- package/esm/rpc/validation/BundlerCollectorTracerV07.js.map +1 -1
- package/esm/rpc/validation/SafeValidator.js +69 -65
- package/esm/rpc/validation/SafeValidator.js.map +1 -1
- package/esm/rpc/validation/TracerResultParserV06.js +30 -26
- package/esm/rpc/validation/TracerResultParserV06.js.map +1 -1
- package/esm/rpc/validation/TracerResultParserV07.js +36 -29
- package/esm/rpc/validation/TracerResultParserV07.js.map +1 -1
- package/esm/rpc/validation/UnsafeValidator.js +73 -46
- package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
- package/esm/rpc/validation/index.js +18 -2
- package/esm/rpc/validation/index.js.map +1 -1
- package/esm/rpc/validation/tracer.d.ts +1 -1
- package/esm/rpc/validation/tracer.js +37 -7
- package/esm/rpc/validation/tracer.js.map +1 -1
- package/esm/types/contracts/BundleBulker.js +4 -1
- package/esm/types/contracts/BundleBulker.js.map +1 -1
- package/esm/types/contracts/CallEngine.js +4 -1
- package/esm/types/contracts/CallEngine.js.map +1 -1
- package/esm/types/contracts/CodeHashGetter.js +5 -2
- package/esm/types/contracts/CodeHashGetter.js.map +1 -1
- package/esm/types/contracts/EntryPoint.js +7 -4
- package/esm/types/contracts/EntryPoint.js.map +1 -1
- package/esm/types/contracts/EntryPointSimulations.js +6 -3
- package/esm/types/contracts/EntryPointSimulations.js.map +1 -1
- package/esm/types/contracts/IOpInflator.js +4 -1
- package/esm/types/contracts/IOpInflator.js.map +1 -1
- package/esm/types/contracts/IPaymaster.js +4 -1
- package/esm/types/contracts/IPaymaster.js.map +1 -1
- package/esm/types/contracts/Inflator.js +4 -1
- package/esm/types/contracts/Inflator.js.map +1 -1
- package/esm/types/contracts/PerOpInflator.js +4 -1
- package/esm/types/contracts/PerOpInflator.js.map +1 -1
- package/esm/types/contracts/PimlicoEntryPointSimulations.js +5 -2
- package/esm/types/contracts/PimlicoEntryPointSimulations.js.map +1 -1
- package/esm/types/contracts/SenderCreator.js +5 -2
- package/esm/types/contracts/SenderCreator.js.map +1 -1
- package/esm/types/contracts/SimpleAccountFactory.js +5 -2
- package/esm/types/contracts/SimpleAccountFactory.js.map +1 -1
- package/esm/types/contracts/TestOpcodesAccount.js +5 -2
- package/esm/types/contracts/TestOpcodesAccount.js.map +1 -1
- package/esm/types/contracts/TestOpcodesAccountFactory.js +5 -2
- package/esm/types/contracts/TestOpcodesAccountFactory.js.map +1 -1
- package/esm/types/contracts/TestStorageAccount.js +5 -2
- package/esm/types/contracts/TestStorageAccount.js.map +1 -1
- package/esm/types/contracts/index.js +32 -16
- package/esm/types/contracts/index.js.map +1 -1
- package/esm/types/gasPrice.js +17 -14
- package/esm/types/gasPrice.js.map +1 -1
- package/esm/types/index.js +26 -10
- package/esm/types/index.js.map +1 -1
- package/esm/types/interfaces.js +2 -1
- package/esm/types/mempool.js +10 -5
- package/esm/types/mempool.js.map +1 -1
- package/esm/types/schemas.d.ts +82 -82
- package/esm/types/schemas.js +284 -254
- package/esm/types/schemas.js.map +1 -1
- package/esm/types/test/validationTestErrors.js +5 -2
- package/esm/types/test/validationTestErrors.js.map +1 -1
- package/esm/types/utils.js +9 -5
- package/esm/types/utils.js.map +1 -1
- package/esm/types/validation.js +142 -139
- package/esm/types/validation.js.map +1 -1
- package/esm/utils/bigInt.js +7 -2
- package/esm/utils/bigInt.js.map +1 -1
- package/esm/utils/compressionHandler.js +11 -7
- package/esm/utils/compressionHandler.js.map +1 -1
- package/esm/utils/gasPriceManager.js +57 -30
- package/esm/utils/gasPriceManager.js.map +1 -1
- package/esm/utils/helpers.js +10 -5
- package/esm/utils/helpers.js.map +1 -1
- package/esm/utils/index.js +26 -10
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/logger.js +19 -10
- package/esm/utils/logger.js.map +1 -1
- package/esm/utils/metrics.d.ts +4 -4
- package/esm/utils/metrics.js +24 -20
- package/esm/utils/metrics.js.map +1 -1
- package/esm/utils/rpc-reply.js +3 -1
- package/esm/utils/rpc-reply.js.map +1 -1
- package/esm/utils/test.d.ts +1 -1
- package/esm/utils/test.js +67 -36
- package/esm/utils/test.js.map +1 -1
- package/esm/utils/toArgs.js +11 -4
- package/esm/utils/toArgs.js.map +1 -1
- package/esm/utils/userop.js +107 -62
- package/esm/utils/userop.js.map +1 -1
- package/esm/utils/validation.js +99 -64
- package/esm/utils/validation.js.map +1 -1
- package/lib/cli/config/bundler.d.ts +37 -37
- package/lib/rpc/validation/tracer.d.ts +1 -1
- package/lib/types/schemas.d.ts +116 -116
- package/lib/types/validation.d.ts +12 -12
- package/lib/utils/metrics.d.ts +4 -4
- package/lib/utils/test.d.ts +1 -1
- package/package.json +3 -3
- package/esm/index.d.ts +0 -449
- package/esm/index.js +0 -64
- package/esm/index.js.map +0 -1
- package/lib/index.d.ts +0 -449
- package/lib/index.js +0 -67
- package/lib/index.js.map +0 -1
package/esm/index.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { resolve } from "node:path";
|
|
2
|
-
import { defineInstance } from "prool";
|
|
3
|
-
import { execa } from "prool/exports/processes";
|
|
4
|
-
import { toArgs } from "./utils/index.js";
|
|
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.js.map
|
package/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAiOhC;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,cAAc,CAAC,CAAC,UAA2B,EAAE,EAAE;IAC/D,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;QACH,SAAS,EAAE;YACP,IAAI;YACJ,IAAI,OAAO;gBACP,OAAO,OAAO,CAAC,SAAS,CAAC,OAAO,CAAA;YACpC,CAAC;SACJ;QACD,IAAI,EAAE,WAAW;QACjB,IAAI;QACJ,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI;QACvB,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,EAAE,OAAO;YAC7C,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE;gBACjB,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;oBACd,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBACxB,CAAC;gBACD,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC,CAAA;YACxD,CAAC,CAAC,EAAE,CAAA;YAEJ,MAAM,OAAO,CAAC,KAAK,CACf,CAAC,CAAC,EAAE,EAAE,CACF,CAAC,CAAA,GAAG,MAAM,IAAI,MAAM,CAAC;gBACjB,IAAI;gBACJ,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"}
|
package/lib/index.d.ts
DELETED
|
@@ -1,449 +0,0 @@
|
|
|
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/execa").Process_internal;
|
|
448
|
-
}, AltoParameters | undefined>;
|
|
449
|
-
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.alto = void 0;
|
|
4
|
-
const node_path_1 = require("node:path");
|
|
5
|
-
const prool_1 = require("prool");
|
|
6
|
-
const processes_1 = require("prool/exports/processes");
|
|
7
|
-
const utils_1 = require("./utils/index.js");
|
|
8
|
-
/**
|
|
9
|
-
* Defines an Alto instance.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* const instance = alto({
|
|
14
|
-
* entrypoints: ['0x0000000071727De22E5E9d8BAf0edAc6f37da032'],
|
|
15
|
-
* rpcUrl: `http://localhost:8545`,
|
|
16
|
-
* executorPrivateKeys: ['0x...'],
|
|
17
|
-
* })
|
|
18
|
-
* await instance.start()
|
|
19
|
-
* // ...
|
|
20
|
-
* await instance.stop()
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
exports.alto = (0, prool_1.defineInstance)((parameters) => {
|
|
24
|
-
const { ...args } = (parameters || {});
|
|
25
|
-
const name = "alto";
|
|
26
|
-
const process = (0, processes_1.execa)({ name });
|
|
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) {
|
|
40
|
-
return [args.binary];
|
|
41
|
-
}
|
|
42
|
-
return ["node", (0, node_path_1.resolve)(__dirname, "./cli/alto.js")];
|
|
43
|
-
})();
|
|
44
|
-
await process.start(($) => $ `${binary} ${(0, utils_1.toArgs)({
|
|
45
|
-
port,
|
|
46
|
-
...args,
|
|
47
|
-
safeMode: args.safeMode ?? false
|
|
48
|
-
})}`, {
|
|
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")) {
|
|
55
|
-
resolve();
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
process.stderr.on("data", reject);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
},
|
|
62
|
-
async stop() {
|
|
63
|
-
await process.stop();
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
});
|
|
67
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,yCAAmC;AACnC,iCAAsC;AACtC,uDAA+C;AAC/C,mCAAgC;AAiOhC;;;;;;;;;;;;;;GAcG;AACU,QAAA,IAAI,GAAG,IAAA,sBAAc,EAAC,CAAC,UAA2B,EAAE,EAAE;IAC/D,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,UAAU,IAAI,EAAE,CAAmB,CAAA;IAExD,MAAM,IAAI,GAAG,MAAM,CAAA;IACnB,MAAM,OAAO,GAAG,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,CAAA;IAE/B,OAAO;QACH,SAAS,EAAE;YACP,IAAI;YACJ,IAAI,OAAO;gBACP,OAAO,OAAO,CAAC,SAAS,CAAC,OAAO,CAAA;YACpC,CAAC;SACJ;QACD,IAAI,EAAE,WAAW;QACjB,IAAI;QACJ,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI;QACvB,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,EAAE,OAAO;YAC7C,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE;gBACjB,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;oBACd,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBACxB,CAAC;gBACD,OAAO,CAAC,MAAM,EAAE,IAAA,mBAAO,EAAC,SAAS,EAAE,eAAe,CAAC,CAAC,CAAA;YACxD,CAAC,CAAC,EAAE,CAAA;YAEJ,MAAM,OAAO,CAAC,KAAK,CACf,CAAC,CAAC,EAAE,EAAE,CACF,CAAC,CAAA,GAAG,MAAM,IAAI,IAAA,cAAM,EAAC;gBACjB,IAAI;gBACJ,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"}
|