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