@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/lib/types/schemas.js
CHANGED
|
@@ -1,44 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.receiptSchema = exports.logSchema = exports.hexDataSchema = exports.hexData32Schema = exports.addressSchema = exports.bundlerResponseSchema = exports.pimlicoGetUserOperationGasPriceResponseSchema = exports.pimlicoGetUserOperationStatusResponseSchema = exports.bundlerDumpReputationsResponseSchema = exports.bundlerSetReputationsResponseSchema = exports.bundlerSetBundlingModeResponseSchema = exports.bundlerSendBundleNowResponseSchema = exports.bundlerGetStakeStatusResponseSchema = exports.bundlerDumpMempoolResponseSchema = exports.bundlerClearMempoolResponseSchema = exports.bundlerClearStateResponseSchema = exports.userOperationSchema = exports.jsonRpcResultSchema = exports.jsonRpcSchema = exports.bundlerRequestSchema = exports.pimlicoGetUserOperationGasPriceRequestSchema = exports.pimlicoGetUserOperationStatusRequestSchema = exports.pimlicoGetStakeStatusRequestSchema = exports.bundlerDumpReputationsRequestSchema = exports.bundlerSetReputationsRequestSchema = exports.bundlerSetBundlingModeRequestSchema = exports.bundlerSendBundleNowRequestSchema = exports.bundlerDumpMempoolRequestSchema = exports.bundlerClearMempoolRequestSchema = exports.bundlerClearStateRequestSchema = exports.altoVersions = exports.hexNumberSchema = exports.commaSeperatedAddressPattern = exports.hexData32Pattern = void 0;
|
|
4
|
-
const viem_1 = require("viem");
|
|
5
|
-
const zod_1 = require("zod");
|
|
1
|
+
import { getAddress } from "viem";
|
|
2
|
+
import { z } from "zod";
|
|
6
3
|
const hexDataPattern = /^0x[0-9A-Fa-f]*$/;
|
|
7
4
|
const addressPattern = /^0x[0-9,a-f,A-F]{40}$/;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const addressSchema =
|
|
5
|
+
export const hexData32Pattern = /^0x([0-9a-fA-F][0-9a-fA-F]){0,32}$/;
|
|
6
|
+
export const commaSeperatedAddressPattern = /^(0x[0-9a-fA-F]{40})(,\s*(0x[0-9a-fA-F]{40}))*$/;
|
|
7
|
+
const addressSchema = z
|
|
11
8
|
.string()
|
|
12
9
|
.regex(addressPattern, { message: "not a valid hex address" })
|
|
13
|
-
.transform((val) =>
|
|
14
|
-
|
|
15
|
-
exports.hexNumberSchema = zod_1.z
|
|
10
|
+
.transform((val) => getAddress(val));
|
|
11
|
+
export const hexNumberSchema = z
|
|
16
12
|
.string()
|
|
17
13
|
.regex(hexDataPattern)
|
|
18
|
-
.or(
|
|
19
|
-
.or(
|
|
14
|
+
.or(z.number())
|
|
15
|
+
.or(z.bigint())
|
|
20
16
|
.transform((val) => BigInt(val));
|
|
21
|
-
const hexDataSchema =
|
|
17
|
+
const hexDataSchema = z
|
|
22
18
|
.string()
|
|
23
19
|
.regex(hexDataPattern, { message: "not valid hex data" })
|
|
24
20
|
.transform((val) => val);
|
|
25
|
-
|
|
26
|
-
const hexData32Schema = zod_1.z
|
|
21
|
+
const hexData32Schema = z
|
|
27
22
|
.string()
|
|
28
|
-
.regex(
|
|
23
|
+
.regex(hexData32Pattern, { message: "not valid 32-byte hex data" })
|
|
29
24
|
.transform((val) => val);
|
|
30
|
-
|
|
31
|
-
const userOperationV06Schema = zod_1.z
|
|
25
|
+
const userOperationV06Schema = z
|
|
32
26
|
.object({
|
|
33
27
|
sender: addressSchema,
|
|
34
|
-
nonce:
|
|
28
|
+
nonce: hexNumberSchema,
|
|
35
29
|
initCode: hexDataSchema,
|
|
36
30
|
callData: hexDataSchema,
|
|
37
|
-
callGasLimit:
|
|
38
|
-
verificationGasLimit:
|
|
39
|
-
preVerificationGas:
|
|
40
|
-
maxPriorityFeePerGas:
|
|
41
|
-
maxFeePerGas:
|
|
31
|
+
callGasLimit: hexNumberSchema,
|
|
32
|
+
verificationGasLimit: hexNumberSchema,
|
|
33
|
+
preVerificationGas: hexNumberSchema,
|
|
34
|
+
maxPriorityFeePerGas: hexNumberSchema,
|
|
35
|
+
maxFeePerGas: hexNumberSchema,
|
|
42
36
|
paymasterAndData: hexDataSchema,
|
|
43
37
|
signature: hexDataSchema
|
|
44
38
|
})
|
|
@@ -46,10 +40,10 @@ const userOperationV06Schema = zod_1.z
|
|
|
46
40
|
.transform((val) => {
|
|
47
41
|
return val;
|
|
48
42
|
});
|
|
49
|
-
const userOperationV07Schema =
|
|
43
|
+
const userOperationV07Schema = z
|
|
50
44
|
.object({
|
|
51
45
|
sender: addressSchema,
|
|
52
|
-
nonce:
|
|
46
|
+
nonce: hexNumberSchema,
|
|
53
47
|
factory: addressSchema
|
|
54
48
|
.nullable()
|
|
55
49
|
.optional()
|
|
@@ -59,20 +53,20 @@ const userOperationV07Schema = zod_1.z
|
|
|
59
53
|
.optional()
|
|
60
54
|
.transform((val) => val ?? null),
|
|
61
55
|
callData: hexDataSchema,
|
|
62
|
-
callGasLimit:
|
|
63
|
-
verificationGasLimit:
|
|
64
|
-
preVerificationGas:
|
|
65
|
-
maxFeePerGas:
|
|
66
|
-
maxPriorityFeePerGas:
|
|
56
|
+
callGasLimit: hexNumberSchema,
|
|
57
|
+
verificationGasLimit: hexNumberSchema,
|
|
58
|
+
preVerificationGas: hexNumberSchema,
|
|
59
|
+
maxFeePerGas: hexNumberSchema,
|
|
60
|
+
maxPriorityFeePerGas: hexNumberSchema,
|
|
67
61
|
paymaster: addressSchema
|
|
68
62
|
.nullable()
|
|
69
63
|
.optional()
|
|
70
64
|
.transform((val) => val ?? null),
|
|
71
|
-
paymasterVerificationGasLimit:
|
|
65
|
+
paymasterVerificationGasLimit: hexNumberSchema
|
|
72
66
|
.nullable()
|
|
73
67
|
.optional()
|
|
74
68
|
.transform((val) => val ?? null),
|
|
75
|
-
paymasterPostOpGasLimit:
|
|
69
|
+
paymasterPostOpGasLimit: hexNumberSchema
|
|
76
70
|
.nullable()
|
|
77
71
|
.optional()
|
|
78
72
|
.transform((val) => val ?? null),
|
|
@@ -84,17 +78,17 @@ const userOperationV07Schema = zod_1.z
|
|
|
84
78
|
})
|
|
85
79
|
.strict()
|
|
86
80
|
.transform((val) => val);
|
|
87
|
-
const partialUserOperationV06Schema =
|
|
81
|
+
const partialUserOperationV06Schema = z
|
|
88
82
|
.object({
|
|
89
83
|
sender: addressSchema,
|
|
90
|
-
nonce:
|
|
84
|
+
nonce: hexNumberSchema,
|
|
91
85
|
initCode: hexDataSchema,
|
|
92
86
|
callData: hexDataSchema,
|
|
93
|
-
callGasLimit:
|
|
94
|
-
verificationGasLimit:
|
|
95
|
-
preVerificationGas:
|
|
96
|
-
maxPriorityFeePerGas:
|
|
97
|
-
maxFeePerGas:
|
|
87
|
+
callGasLimit: hexNumberSchema.default(1n),
|
|
88
|
+
verificationGasLimit: hexNumberSchema.default(1n),
|
|
89
|
+
preVerificationGas: hexNumberSchema.default(1n),
|
|
90
|
+
maxPriorityFeePerGas: hexNumberSchema.default(1n),
|
|
91
|
+
maxFeePerGas: hexNumberSchema.default(1n),
|
|
98
92
|
paymasterAndData: hexDataSchema,
|
|
99
93
|
signature: hexDataSchema
|
|
100
94
|
})
|
|
@@ -102,10 +96,10 @@ const partialUserOperationV06Schema = zod_1.z
|
|
|
102
96
|
.transform((val) => {
|
|
103
97
|
return val;
|
|
104
98
|
});
|
|
105
|
-
const partialUserOperationV07Schema =
|
|
99
|
+
const partialUserOperationV07Schema = z
|
|
106
100
|
.object({
|
|
107
101
|
sender: addressSchema,
|
|
108
|
-
nonce:
|
|
102
|
+
nonce: hexNumberSchema,
|
|
109
103
|
factory: addressSchema
|
|
110
104
|
.nullable()
|
|
111
105
|
.optional()
|
|
@@ -115,20 +109,20 @@ const partialUserOperationV07Schema = zod_1.z
|
|
|
115
109
|
.optional()
|
|
116
110
|
.transform((val) => val ?? null),
|
|
117
111
|
callData: hexDataSchema,
|
|
118
|
-
callGasLimit:
|
|
119
|
-
verificationGasLimit:
|
|
120
|
-
preVerificationGas:
|
|
121
|
-
maxFeePerGas:
|
|
122
|
-
maxPriorityFeePerGas:
|
|
112
|
+
callGasLimit: hexNumberSchema.default(1n),
|
|
113
|
+
verificationGasLimit: hexNumberSchema.default(1n),
|
|
114
|
+
preVerificationGas: hexNumberSchema.default(1n),
|
|
115
|
+
maxFeePerGas: hexNumberSchema.default(1n),
|
|
116
|
+
maxPriorityFeePerGas: hexNumberSchema.default(1n),
|
|
123
117
|
paymaster: addressSchema
|
|
124
118
|
.nullable()
|
|
125
119
|
.optional()
|
|
126
120
|
.transform((val) => val ?? null),
|
|
127
|
-
paymasterVerificationGasLimit:
|
|
121
|
+
paymasterVerificationGasLimit: hexNumberSchema
|
|
128
122
|
.nullable()
|
|
129
123
|
.optional()
|
|
130
124
|
.transform((val) => val ?? null),
|
|
131
|
-
paymasterPostOpGasLimit:
|
|
125
|
+
paymasterPostOpGasLimit: hexNumberSchema
|
|
132
126
|
.nullable()
|
|
133
127
|
.optional()
|
|
134
128
|
.transform((val) => val ?? null),
|
|
@@ -140,160 +134,147 @@ const partialUserOperationV07Schema = zod_1.z
|
|
|
140
134
|
})
|
|
141
135
|
.strict()
|
|
142
136
|
.transform((val) => val);
|
|
143
|
-
const packerUserOperationSchema =
|
|
137
|
+
const packerUserOperationSchema = z
|
|
144
138
|
.object({
|
|
145
139
|
sender: addressSchema,
|
|
146
|
-
nonce:
|
|
140
|
+
nonce: hexNumberSchema,
|
|
147
141
|
initCode: hexDataSchema,
|
|
148
142
|
callData: hexDataSchema,
|
|
149
143
|
accountGasLimits: hexData32Schema,
|
|
150
|
-
preVerificationGas:
|
|
144
|
+
preVerificationGas: hexNumberSchema,
|
|
151
145
|
gasFees: hexData32Schema,
|
|
152
146
|
paymasterAndData: hexDataSchema,
|
|
153
147
|
signature: hexDataSchema
|
|
154
148
|
})
|
|
155
149
|
.strict()
|
|
156
150
|
.transform((val) => val);
|
|
157
|
-
const partialUserOperationSchema =
|
|
151
|
+
const partialUserOperationSchema = z.union([
|
|
158
152
|
partialUserOperationV06Schema,
|
|
159
153
|
partialUserOperationV07Schema
|
|
160
154
|
]);
|
|
161
|
-
const userOperationSchema =
|
|
155
|
+
const userOperationSchema = z.union([
|
|
162
156
|
userOperationV06Schema,
|
|
163
157
|
userOperationV07Schema
|
|
164
158
|
]);
|
|
165
|
-
|
|
166
|
-
const jsonRpcSchema = zod_1.z
|
|
159
|
+
const jsonRpcSchema = z
|
|
167
160
|
.object({
|
|
168
|
-
jsonrpc:
|
|
169
|
-
id:
|
|
170
|
-
method:
|
|
171
|
-
params:
|
|
172
|
-
.array(
|
|
161
|
+
jsonrpc: z.literal("2.0"),
|
|
162
|
+
id: z.number(),
|
|
163
|
+
method: z.string(),
|
|
164
|
+
params: z
|
|
165
|
+
.array(z.unknown())
|
|
173
166
|
.optional()
|
|
174
167
|
.transform((val) => val ?? [])
|
|
175
168
|
})
|
|
176
169
|
.strict();
|
|
177
|
-
|
|
178
|
-
const jsonRpcResultSchema = zod_1.z
|
|
170
|
+
const jsonRpcResultSchema = z
|
|
179
171
|
.object({
|
|
180
|
-
jsonrpc:
|
|
181
|
-
id:
|
|
182
|
-
result:
|
|
172
|
+
jsonrpc: z.literal("2.0"),
|
|
173
|
+
id: z.number(),
|
|
174
|
+
result: z.unknown()
|
|
183
175
|
})
|
|
184
176
|
.strict();
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
nonce: exports.hexNumberSchema.optional(),
|
|
177
|
+
const chainIdRequestSchema = z.object({
|
|
178
|
+
method: z.literal("eth_chainId"),
|
|
179
|
+
params: z.tuple([])
|
|
180
|
+
});
|
|
181
|
+
const supportedEntryPointsRequestSchema = z.object({
|
|
182
|
+
method: z.literal("eth_supportedEntryPoints"),
|
|
183
|
+
params: z.tuple([])
|
|
184
|
+
});
|
|
185
|
+
const stateOverridesSchema = z.record(addressSchema, z.object({
|
|
186
|
+
balance: hexNumberSchema.optional(),
|
|
187
|
+
nonce: hexNumberSchema.optional(),
|
|
197
188
|
code: hexDataSchema.optional(),
|
|
198
|
-
state:
|
|
199
|
-
stateDiff:
|
|
189
|
+
state: z.unknown().optional(),
|
|
190
|
+
stateDiff: z.unknown().optional()
|
|
200
191
|
}));
|
|
201
|
-
const estimateUserOperationGasRequestSchema =
|
|
202
|
-
method:
|
|
203
|
-
params:
|
|
204
|
-
|
|
205
|
-
|
|
192
|
+
const estimateUserOperationGasRequestSchema = z.object({
|
|
193
|
+
method: z.literal("eth_estimateUserOperationGas"),
|
|
194
|
+
params: z.union([
|
|
195
|
+
z.tuple([partialUserOperationSchema, addressSchema]),
|
|
196
|
+
z.tuple([
|
|
206
197
|
partialUserOperationSchema,
|
|
207
198
|
addressSchema,
|
|
208
199
|
stateOverridesSchema
|
|
209
200
|
])
|
|
210
201
|
])
|
|
211
202
|
});
|
|
212
|
-
const sendUserOperationRequestSchema =
|
|
213
|
-
method:
|
|
214
|
-
params:
|
|
203
|
+
const sendUserOperationRequestSchema = z.object({
|
|
204
|
+
method: z.literal("eth_sendUserOperation"),
|
|
205
|
+
params: z.tuple([userOperationSchema, addressSchema])
|
|
215
206
|
});
|
|
216
|
-
const getUserOperationByHashRequestSchema =
|
|
217
|
-
method:
|
|
218
|
-
params:
|
|
219
|
-
|
|
207
|
+
const getUserOperationByHashRequestSchema = z.object({
|
|
208
|
+
method: z.literal("eth_getUserOperationByHash"),
|
|
209
|
+
params: z.tuple([
|
|
210
|
+
z
|
|
220
211
|
.string()
|
|
221
|
-
.regex(
|
|
212
|
+
.regex(hexData32Pattern, { message: "Missing/invalid userOpHash" })
|
|
222
213
|
.transform((val) => val)
|
|
223
214
|
])
|
|
224
215
|
});
|
|
225
|
-
const getUserOperationReceiptRequestSchema =
|
|
226
|
-
method:
|
|
227
|
-
params:
|
|
228
|
-
|
|
216
|
+
const getUserOperationReceiptRequestSchema = z.object({
|
|
217
|
+
method: z.literal("eth_getUserOperationReceipt"),
|
|
218
|
+
params: z.tuple([
|
|
219
|
+
z
|
|
229
220
|
.string()
|
|
230
|
-
.regex(
|
|
221
|
+
.regex(hexData32Pattern, { message: "Missing/invalid userOpHash" })
|
|
231
222
|
.transform((val) => val)
|
|
232
223
|
])
|
|
233
224
|
});
|
|
234
|
-
const bundlerClearStateRequestSchema =
|
|
235
|
-
method:
|
|
236
|
-
params:
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
method:
|
|
256
|
-
params:
|
|
257
|
-
|
|
258
|
-
exports.bundlerSetBundlingModeRequestSchema = bundlerSetBundlingModeRequestSchema;
|
|
259
|
-
const bundlerSetReputationsRequestSchema = zod_1.z.object({
|
|
260
|
-
method: zod_1.z.literal("debug_bundler_setReputation"),
|
|
261
|
-
params: zod_1.z.tuple([
|
|
262
|
-
zod_1.z.array(zod_1.z.object({
|
|
225
|
+
const bundlerClearStateRequestSchema = z.object({
|
|
226
|
+
method: z.literal("debug_bundler_clearState"),
|
|
227
|
+
params: z.tuple([])
|
|
228
|
+
});
|
|
229
|
+
const bundlerClearMempoolRequestSchema = z.object({
|
|
230
|
+
method: z.literal("debug_bundler_clearMempool"),
|
|
231
|
+
params: z.tuple([])
|
|
232
|
+
});
|
|
233
|
+
const bundlerDumpMempoolRequestSchema = z.object({
|
|
234
|
+
method: z.literal("debug_bundler_dumpMempool"),
|
|
235
|
+
params: z.tuple([addressSchema])
|
|
236
|
+
});
|
|
237
|
+
const bundlerSendBundleNowRequestSchema = z.object({
|
|
238
|
+
method: z.literal("debug_bundler_sendBundleNow"),
|
|
239
|
+
params: z.tuple([])
|
|
240
|
+
});
|
|
241
|
+
const bundlerSetBundlingModeRequestSchema = z.object({
|
|
242
|
+
method: z.literal("debug_bundler_setBundlingMode"),
|
|
243
|
+
params: z.tuple([z.enum(["manual", "auto"])])
|
|
244
|
+
});
|
|
245
|
+
const bundlerSetReputationsRequestSchema = z.object({
|
|
246
|
+
method: z.literal("debug_bundler_setReputation"),
|
|
247
|
+
params: z.tuple([
|
|
248
|
+
z.array(z.object({
|
|
263
249
|
address: addressSchema,
|
|
264
|
-
opsSeen:
|
|
265
|
-
opsIncluded:
|
|
250
|
+
opsSeen: hexNumberSchema,
|
|
251
|
+
opsIncluded: hexNumberSchema
|
|
266
252
|
})),
|
|
267
253
|
addressSchema
|
|
268
254
|
])
|
|
269
255
|
});
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
const
|
|
287
|
-
method:
|
|
288
|
-
params:
|
|
289
|
-
});
|
|
290
|
-
|
|
291
|
-
const
|
|
292
|
-
method: zod_1.z.literal("pimlico_sendCompressedUserOperation"),
|
|
293
|
-
params: zod_1.z.tuple([hexDataSchema, addressSchema, addressSchema])
|
|
294
|
-
});
|
|
295
|
-
exports.altoVersions = zod_1.z.enum(["v1", "v2"]);
|
|
296
|
-
const bundlerRequestSchema = zod_1.z.discriminatedUnion("method", [
|
|
256
|
+
const bundlerDumpReputationsRequestSchema = z.object({
|
|
257
|
+
method: z.literal("debug_bundler_dumpReputation"),
|
|
258
|
+
params: z.tuple([addressSchema])
|
|
259
|
+
});
|
|
260
|
+
const pimlicoGetStakeStatusRequestSchema = z.object({
|
|
261
|
+
method: z.literal("debug_bundler_getStakeStatus"),
|
|
262
|
+
params: z.tuple([addressSchema, addressSchema])
|
|
263
|
+
});
|
|
264
|
+
const pimlicoGetUserOperationStatusRequestSchema = z.object({
|
|
265
|
+
method: z.literal("pimlico_getUserOperationStatus"),
|
|
266
|
+
params: z.tuple([hexData32Schema])
|
|
267
|
+
});
|
|
268
|
+
const pimlicoGetUserOperationGasPriceRequestSchema = z.object({
|
|
269
|
+
method: z.literal("pimlico_getUserOperationGasPrice"),
|
|
270
|
+
params: z.tuple([])
|
|
271
|
+
});
|
|
272
|
+
const pimlicoSendCompressedUserOperationRequestSchema = z.object({
|
|
273
|
+
method: z.literal("pimlico_sendCompressedUserOperation"),
|
|
274
|
+
params: z.tuple([hexDataSchema, addressSchema, addressSchema])
|
|
275
|
+
});
|
|
276
|
+
export const altoVersions = z.enum(["v1", "v2"]);
|
|
277
|
+
const bundlerRequestSchema = z.discriminatedUnion("method", [
|
|
297
278
|
chainIdRequestSchema,
|
|
298
279
|
supportedEntryPointsRequestSchema,
|
|
299
280
|
estimateUserOperationGasRequestSchema,
|
|
@@ -312,160 +293,149 @@ const bundlerRequestSchema = zod_1.z.discriminatedUnion("method", [
|
|
|
312
293
|
pimlicoGetUserOperationGasPriceRequestSchema,
|
|
313
294
|
pimlicoSendCompressedUserOperationRequestSchema
|
|
314
295
|
]);
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
verificationGas: exports.hexNumberSchema.optional()
|
|
296
|
+
const chainIdResponseSchema = z.object({
|
|
297
|
+
method: z.literal("eth_chainId"),
|
|
298
|
+
result: hexNumberSchema
|
|
299
|
+
});
|
|
300
|
+
const supportedEntryPointsResponseSchema = z.object({
|
|
301
|
+
method: z.literal("eth_supportedEntryPoints"),
|
|
302
|
+
result: z.array(addressSchema)
|
|
303
|
+
});
|
|
304
|
+
const estimateUserOperationGasResponseSchema = z.object({
|
|
305
|
+
method: z.literal("eth_estimateUserOperationGas"),
|
|
306
|
+
result: z.union([
|
|
307
|
+
z.object({
|
|
308
|
+
callGasLimit: hexNumberSchema,
|
|
309
|
+
preVerificationGas: hexNumberSchema,
|
|
310
|
+
verificationGasLimit: hexNumberSchema,
|
|
311
|
+
verificationGas: hexNumberSchema.optional()
|
|
332
312
|
}),
|
|
333
|
-
|
|
334
|
-
callGasLimit:
|
|
335
|
-
preVerificationGas:
|
|
336
|
-
verificationGasLimit:
|
|
337
|
-
paymasterVerificationGasLimit:
|
|
338
|
-
paymasterPostOpGasLimit:
|
|
313
|
+
z.object({
|
|
314
|
+
callGasLimit: hexNumberSchema,
|
|
315
|
+
preVerificationGas: hexNumberSchema,
|
|
316
|
+
verificationGasLimit: hexNumberSchema,
|
|
317
|
+
paymasterVerificationGasLimit: hexNumberSchema.optional(),
|
|
318
|
+
paymasterPostOpGasLimit: hexNumberSchema.optional()
|
|
339
319
|
})
|
|
340
320
|
])
|
|
341
321
|
});
|
|
342
|
-
const sendUserOperationResponseSchema =
|
|
343
|
-
method:
|
|
322
|
+
const sendUserOperationResponseSchema = z.object({
|
|
323
|
+
method: z.literal("eth_sendUserOperation"),
|
|
344
324
|
result: hexData32Schema
|
|
345
325
|
});
|
|
346
|
-
const getUserOperationByHashResponseSchema =
|
|
347
|
-
method:
|
|
348
|
-
result:
|
|
326
|
+
const getUserOperationByHashResponseSchema = z.object({
|
|
327
|
+
method: z.literal("eth_getUserOperationByHash"),
|
|
328
|
+
result: z
|
|
349
329
|
.object({
|
|
350
330
|
userOperation: userOperationSchema,
|
|
351
331
|
entryPoint: addressSchema,
|
|
352
|
-
blockNumber:
|
|
332
|
+
blockNumber: hexNumberSchema,
|
|
353
333
|
blockHash: hexData32Schema,
|
|
354
334
|
transactionHash: hexData32Schema
|
|
355
335
|
})
|
|
356
|
-
.or(
|
|
336
|
+
.or(z.null())
|
|
357
337
|
});
|
|
358
|
-
const logSchema =
|
|
338
|
+
const logSchema = z.object({
|
|
359
339
|
//removed: z.boolean().optional(),
|
|
360
|
-
logIndex:
|
|
361
|
-
transactionIndex:
|
|
340
|
+
logIndex: hexNumberSchema,
|
|
341
|
+
transactionIndex: hexNumberSchema,
|
|
362
342
|
transactionHash: hexData32Schema,
|
|
363
343
|
blockHash: hexData32Schema,
|
|
364
|
-
blockNumber:
|
|
344
|
+
blockNumber: hexNumberSchema,
|
|
365
345
|
address: addressSchema,
|
|
366
346
|
data: hexDataSchema,
|
|
367
|
-
topics:
|
|
347
|
+
topics: z.array(hexData32Schema)
|
|
368
348
|
});
|
|
369
|
-
|
|
370
|
-
const receiptSchema = zod_1.z.object({
|
|
349
|
+
const receiptSchema = z.object({
|
|
371
350
|
transactionHash: hexData32Schema,
|
|
372
|
-
transactionIndex:
|
|
351
|
+
transactionIndex: hexNumberSchema,
|
|
373
352
|
blockHash: hexData32Schema,
|
|
374
|
-
blockNumber:
|
|
353
|
+
blockNumber: hexNumberSchema,
|
|
375
354
|
from: addressSchema,
|
|
376
|
-
to: addressSchema.or(
|
|
377
|
-
cumulativeGasUsed:
|
|
378
|
-
gasUsed:
|
|
379
|
-
contractAddress: addressSchema.or(
|
|
380
|
-
logs:
|
|
381
|
-
logsBloom:
|
|
355
|
+
to: addressSchema.or(z.null()),
|
|
356
|
+
cumulativeGasUsed: hexNumberSchema,
|
|
357
|
+
gasUsed: hexNumberSchema,
|
|
358
|
+
contractAddress: addressSchema.or(z.null()),
|
|
359
|
+
logs: z.array(logSchema),
|
|
360
|
+
logsBloom: z.string().regex(/^0x[0-9a-f]{512}$/),
|
|
382
361
|
//root: hexData32Schema,
|
|
383
|
-
status:
|
|
384
|
-
effectiveGasPrice:
|
|
362
|
+
status: hexNumberSchema.or(z.null()),
|
|
363
|
+
effectiveGasPrice: hexNumberSchema
|
|
385
364
|
//type: hexNumberSchema
|
|
386
365
|
});
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
result: zod_1.z
|
|
366
|
+
const getUserOperationReceiptResponseSchema = z.object({
|
|
367
|
+
method: z.literal("eth_getUserOperationReceipt"),
|
|
368
|
+
result: z
|
|
391
369
|
.object({
|
|
392
370
|
userOpHash: hexData32Schema,
|
|
393
371
|
entryPoint: addressSchema,
|
|
394
372
|
sender: addressSchema,
|
|
395
|
-
nonce:
|
|
373
|
+
nonce: hexNumberSchema,
|
|
396
374
|
paymaster: addressSchema.optional(),
|
|
397
|
-
actualGasCost:
|
|
398
|
-
actualGasUsed:
|
|
399
|
-
success:
|
|
375
|
+
actualGasCost: hexNumberSchema,
|
|
376
|
+
actualGasUsed: hexNumberSchema,
|
|
377
|
+
success: z.boolean(),
|
|
400
378
|
reason: hexDataSchema.optional(), // revert reason
|
|
401
|
-
logs:
|
|
379
|
+
logs: z.array(logSchema),
|
|
402
380
|
receipt: receiptSchema
|
|
403
381
|
})
|
|
404
|
-
.or(
|
|
405
|
-
});
|
|
406
|
-
const bundlerClearStateResponseSchema =
|
|
407
|
-
method:
|
|
408
|
-
result:
|
|
409
|
-
});
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
stakeInfo: zod_1.z.object({
|
|
425
|
-
addr: zod_1.z.string(),
|
|
426
|
-
stake: zod_1.z
|
|
382
|
+
.or(z.null())
|
|
383
|
+
});
|
|
384
|
+
const bundlerClearStateResponseSchema = z.object({
|
|
385
|
+
method: z.literal("debug_bundler_clearState"),
|
|
386
|
+
result: z.literal("ok")
|
|
387
|
+
});
|
|
388
|
+
const bundlerClearMempoolResponseSchema = z.object({
|
|
389
|
+
method: z.literal("debug_bundler_clearMempool"),
|
|
390
|
+
result: z.literal("ok")
|
|
391
|
+
});
|
|
392
|
+
const bundlerDumpMempoolResponseSchema = z.object({
|
|
393
|
+
method: z.literal("debug_bundler_dumpMempool"),
|
|
394
|
+
result: z.array(userOperationSchema)
|
|
395
|
+
});
|
|
396
|
+
const bundlerGetStakeStatusResponseSchema = z.object({
|
|
397
|
+
method: z.literal("debug_bundler_getStakeStatus"),
|
|
398
|
+
result: z.object({
|
|
399
|
+
stakeInfo: z.object({
|
|
400
|
+
addr: z.string(),
|
|
401
|
+
stake: z
|
|
427
402
|
.string()
|
|
428
|
-
.or(
|
|
429
|
-
.or(
|
|
403
|
+
.or(z.number())
|
|
404
|
+
.or(z.bigint())
|
|
430
405
|
.transform((val) => Number(val).toString()),
|
|
431
|
-
unstakeDelaySec:
|
|
406
|
+
unstakeDelaySec: z
|
|
432
407
|
.string()
|
|
433
|
-
.or(
|
|
434
|
-
.or(
|
|
408
|
+
.or(z.number())
|
|
409
|
+
.or(z.bigint())
|
|
435
410
|
.transform((val) => Number(val).toString())
|
|
436
411
|
}),
|
|
437
|
-
isStaked:
|
|
412
|
+
isStaked: z.boolean()
|
|
438
413
|
})
|
|
439
414
|
});
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
method: zod_1.z.literal("debug_bundler_sendBundleNow"),
|
|
415
|
+
const bundlerSendBundleNowResponseSchema = z.object({
|
|
416
|
+
method: z.literal("debug_bundler_sendBundleNow"),
|
|
443
417
|
result: hexData32Schema
|
|
444
418
|
});
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
result: zod_1.z.literal("ok")
|
|
419
|
+
const bundlerSetBundlingModeResponseSchema = z.object({
|
|
420
|
+
method: z.literal("debug_bundler_setBundlingMode"),
|
|
421
|
+
result: z.literal("ok")
|
|
449
422
|
});
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
result: zod_1.z.literal("ok")
|
|
423
|
+
const bundlerSetReputationsResponseSchema = z.object({
|
|
424
|
+
method: z.literal("debug_bundler_setReputation"),
|
|
425
|
+
result: z.literal("ok")
|
|
454
426
|
});
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
method: zod_1.z.literal("debug_bundler_dumpReputation"),
|
|
427
|
+
const bundlerDumpReputationsResponseSchema = z.object({
|
|
428
|
+
method: z.literal("debug_bundler_dumpReputation"),
|
|
458
429
|
// TODO: FIX
|
|
459
|
-
result:
|
|
430
|
+
result: z.array(z.object({
|
|
460
431
|
address: addressSchema,
|
|
461
|
-
opsSeen:
|
|
462
|
-
opsIncluded:
|
|
463
|
-
status:
|
|
432
|
+
opsSeen: hexNumberSchema,
|
|
433
|
+
opsIncluded: hexNumberSchema,
|
|
434
|
+
status: hexNumberSchema.optional()
|
|
464
435
|
}))
|
|
465
436
|
});
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
status: zod_1.z.enum([
|
|
437
|
+
const userOperationStatus = z.object({
|
|
438
|
+
status: z.enum([
|
|
469
439
|
"not_found",
|
|
470
440
|
"not_submitted",
|
|
471
441
|
"submitted",
|
|
@@ -474,37 +444,35 @@ const userOperationStatus = zod_1.z.object({
|
|
|
474
444
|
"included",
|
|
475
445
|
"failed"
|
|
476
446
|
]),
|
|
477
|
-
transactionHash: hexData32Schema.or(
|
|
447
|
+
transactionHash: hexData32Schema.or(z.null())
|
|
478
448
|
});
|
|
479
|
-
const pimlicoGetUserOperationStatusResponseSchema =
|
|
480
|
-
method:
|
|
449
|
+
const pimlicoGetUserOperationStatusResponseSchema = z.object({
|
|
450
|
+
method: z.literal("pimlico_getUserOperationStatus"),
|
|
481
451
|
result: userOperationStatus
|
|
482
452
|
});
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
maxPriorityFeePerGas: zod_1.z.bigint()
|
|
453
|
+
const gasPriceSchema = z.object({
|
|
454
|
+
slow: z.object({
|
|
455
|
+
maxFeePerGas: z.bigint(),
|
|
456
|
+
maxPriorityFeePerGas: z.bigint()
|
|
488
457
|
}),
|
|
489
|
-
standard:
|
|
490
|
-
maxFeePerGas:
|
|
491
|
-
maxPriorityFeePerGas:
|
|
458
|
+
standard: z.object({
|
|
459
|
+
maxFeePerGas: z.bigint(),
|
|
460
|
+
maxPriorityFeePerGas: z.bigint()
|
|
492
461
|
}),
|
|
493
|
-
fast:
|
|
494
|
-
maxFeePerGas:
|
|
495
|
-
maxPriorityFeePerGas:
|
|
462
|
+
fast: z.object({
|
|
463
|
+
maxFeePerGas: z.bigint(),
|
|
464
|
+
maxPriorityFeePerGas: z.bigint()
|
|
496
465
|
})
|
|
497
466
|
});
|
|
498
|
-
const pimlicoGetUserOperationGasPriceResponseSchema =
|
|
499
|
-
method:
|
|
467
|
+
const pimlicoGetUserOperationGasPriceResponseSchema = z.object({
|
|
468
|
+
method: z.literal("pimlico_getUserOperationGasPrice"),
|
|
500
469
|
result: gasPriceSchema
|
|
501
470
|
});
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
method: zod_1.z.literal("pimlico_sendCompressedUserOperation"),
|
|
471
|
+
const pimlicoSendCompressedUserOperationResponseSchema = z.object({
|
|
472
|
+
method: z.literal("pimlico_sendCompressedUserOperation"),
|
|
505
473
|
result: hexData32Schema
|
|
506
474
|
});
|
|
507
|
-
const bundlerResponseSchema =
|
|
475
|
+
const bundlerResponseSchema = z.discriminatedUnion("method", [
|
|
508
476
|
chainIdResponseSchema,
|
|
509
477
|
supportedEntryPointsResponseSchema,
|
|
510
478
|
estimateUserOperationGasResponseSchema,
|
|
@@ -523,5 +491,7 @@ const bundlerResponseSchema = zod_1.z.discriminatedUnion("method", [
|
|
|
523
491
|
pimlicoGetUserOperationGasPriceResponseSchema,
|
|
524
492
|
pimlicoSendCompressedUserOperationResponseSchema
|
|
525
493
|
]);
|
|
526
|
-
|
|
494
|
+
export { bundlerClearStateRequestSchema, bundlerClearMempoolRequestSchema, bundlerDumpMempoolRequestSchema, bundlerSendBundleNowRequestSchema, bundlerSetBundlingModeRequestSchema, bundlerSetReputationsRequestSchema, bundlerDumpReputationsRequestSchema, pimlicoGetStakeStatusRequestSchema, pimlicoGetUserOperationStatusRequestSchema, pimlicoGetUserOperationGasPriceRequestSchema, bundlerRequestSchema, jsonRpcSchema, jsonRpcResultSchema, userOperationSchema };
|
|
495
|
+
export { bundlerClearStateResponseSchema, bundlerClearMempoolResponseSchema, bundlerDumpMempoolResponseSchema, bundlerGetStakeStatusResponseSchema, bundlerSendBundleNowResponseSchema, bundlerSetBundlingModeResponseSchema, bundlerSetReputationsResponseSchema, bundlerDumpReputationsResponseSchema, pimlicoGetUserOperationStatusResponseSchema, pimlicoGetUserOperationGasPriceResponseSchema, bundlerResponseSchema };
|
|
496
|
+
export { addressSchema, hexData32Schema, hexDataSchema, logSchema, receiptSchema };
|
|
527
497
|
//# sourceMappingURL=schemas.js.map
|