@pimlico/alto 0.0.0-main.20250214T163421 → 0.0.0-main.20250225T164854
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/setupServer.js +4 -4
- package/esm/cli/setupServer.js.map +1 -1
- package/esm/executor/executorManager.d.ts +9 -9
- package/esm/mempool/index.d.ts +1 -0
- package/esm/mempool/index.js +1 -0
- package/esm/mempool/index.js.map +1 -1
- package/esm/{rpc → mempool}/nonceQueuer.d.ts +1 -1
- package/esm/mempool/nonceQueuer.js.map +1 -0
- package/esm/mempool/reputationManager.d.ts +3 -2
- package/esm/mempool/reputationManager.js.map +1 -1
- package/esm/rpc/createMethodHandler.d.ts +31 -0
- package/esm/rpc/createMethodHandler.js +30 -0
- package/esm/rpc/createMethodHandler.js.map +1 -0
- package/esm/rpc/estimation/gasEstimationHandler.d.ts +3 -3
- package/esm/rpc/estimation/gasEstimationHandler.js +17 -10
- package/esm/rpc/estimation/gasEstimationHandler.js.map +1 -1
- package/esm/rpc/index.d.ts +0 -1
- package/esm/rpc/index.js +0 -1
- package/esm/rpc/index.js.map +1 -1
- package/esm/rpc/methods/debug_bundler_clearReputation.d.ts +22 -0
- package/esm/rpc/methods/debug_bundler_clearReputation.js +12 -0
- package/esm/rpc/methods/debug_bundler_clearReputation.js.map +1 -0
- package/esm/rpc/methods/debug_bundler_clearState.d.ts +22 -0
- package/esm/rpc/methods/debug_bundler_clearState.js +13 -0
- package/esm/rpc/methods/debug_bundler_clearState.js.map +1 -0
- package/esm/rpc/methods/debug_bundler_dumpMempool.d.ts +468 -0
- package/esm/rpc/methods/debug_bundler_dumpMempool.js +13 -0
- package/esm/rpc/methods/debug_bundler_dumpMempool.js.map +1 -0
- package/esm/rpc/methods/debug_bundler_dumpReputation.d.ts +57 -0
- package/esm/rpc/methods/debug_bundler_dumpReputation.js +13 -0
- package/esm/rpc/methods/debug_bundler_dumpReputation.js.map +1 -0
- package/esm/rpc/methods/debug_bundler_getStakeStatus.d.ts +79 -0
- package/esm/rpc/methods/debug_bundler_getStakeStatus.js +14 -0
- package/esm/rpc/methods/debug_bundler_getStakeStatus.js.map +1 -0
- package/esm/rpc/methods/debug_bundler_sendBundleNow.d.ts +22 -0
- package/esm/rpc/methods/debug_bundler_sendBundleNow.js +12 -0
- package/esm/rpc/methods/debug_bundler_sendBundleNow.js.map +1 -0
- package/esm/rpc/methods/debug_bundler_setBundlingMode.d.ts +22 -0
- package/esm/rpc/methods/debug_bundler_setBundlingMode.js +13 -0
- package/esm/rpc/methods/debug_bundler_setBundlingMode.js.map +1 -0
- package/esm/rpc/methods/debug_bundler_setReputation.d.ts +46 -0
- package/esm/rpc/methods/debug_bundler_setReputation.js +13 -0
- package/esm/rpc/methods/debug_bundler_setReputation.js.map +1 -0
- package/esm/rpc/methods/eth_chainId.d.ts +22 -0
- package/esm/rpc/methods/eth_chainId.js +10 -0
- package/esm/rpc/methods/eth_chainId.js.map +1 -0
- package/esm/rpc/methods/eth_estimateUserOperationGas.d.ts +979 -0
- package/esm/rpc/methods/eth_estimateUserOperationGas.js +18 -0
- package/esm/rpc/methods/eth_estimateUserOperationGas.js.map +1 -0
- package/esm/rpc/methods/eth_getUserOperationByHash.d.ts +878 -0
- package/esm/rpc/methods/eth_getUserOperationByHash.js +98 -0
- package/esm/rpc/methods/eth_getUserOperationByHash.js.map +1 -0
- package/esm/rpc/methods/eth_getUserOperationReceipt.d.ts +412 -0
- package/esm/rpc/methods/eth_getUserOperationReceipt.js +11 -0
- package/esm/rpc/methods/eth_getUserOperationReceipt.js.map +1 -0
- package/esm/rpc/methods/eth_sendUserOperation.d.ts +422 -0
- package/esm/rpc/methods/eth_sendUserOperation.js +30 -0
- package/esm/rpc/methods/eth_sendUserOperation.js.map +1 -0
- package/esm/rpc/methods/eth_supportedEntryPoints.d.ts +22 -0
- package/esm/rpc/methods/eth_supportedEntryPoints.js +10 -0
- package/esm/rpc/methods/eth_supportedEntryPoints.js.map +1 -0
- package/esm/rpc/methods/index.d.ts +3 -0
- package/esm/rpc/methods/index.js +45 -0
- package/esm/rpc/methods/index.js.map +1 -0
- package/esm/rpc/methods/pimlico_experimental_estimateUserOperationGas7702.d.ts +979 -0
- package/esm/rpc/methods/pimlico_experimental_estimateUserOperationGas7702.js +20 -0
- package/esm/rpc/methods/pimlico_experimental_estimateUserOperationGas7702.js.map +1 -0
- package/esm/rpc/methods/pimlico_experimental_sendUserOperation7702.d.ts +422 -0
- package/esm/rpc/methods/pimlico_experimental_sendUserOperation7702.js +16 -0
- package/esm/rpc/methods/pimlico_experimental_sendUserOperation7702.js.map +1 -0
- package/esm/rpc/methods/pimlico_getUserOperationGasPrice.d.ts +131 -0
- package/esm/rpc/methods/pimlico_getUserOperationGasPrice.js +30 -0
- package/esm/rpc/methods/pimlico_getUserOperationGasPrice.js.map +1 -0
- package/esm/rpc/methods/pimlico_getUserOperationStatus.d.ts +43 -0
- package/esm/rpc/methods/pimlico_getUserOperationStatus.js +11 -0
- package/esm/rpc/methods/pimlico_getUserOperationStatus.js.map +1 -0
- package/esm/rpc/methods/pimlico_sendUserOperationNow.d.ts +812 -0
- package/esm/rpc/methods/pimlico_sendUserOperationNow.js +41 -0
- package/esm/rpc/methods/pimlico_sendUserOperationNow.js.map +1 -0
- package/esm/rpc/rpcHandler.d.ts +13 -104
- package/esm/rpc/rpcHandler.js +35 -374
- package/esm/rpc/rpcHandler.js.map +1 -1
- package/esm/rpc/server.d.ts +2 -2
- package/esm/rpc/server.js +1 -1
- package/esm/rpc/server.js.map +1 -1
- package/esm/rpc/validation/TracerResultParserV07.js +5 -5
- package/esm/rpc/validation/TracerResultParserV07.js.map +1 -1
- package/esm/rpc/validation/UnsafeValidator.d.ts +2 -2
- package/esm/rpc/validation/UnsafeValidator.js +3 -3
- package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
- package/esm/types/interfaces.d.ts +1 -1
- package/esm/types/schemas.d.ts +9368 -3502
- package/esm/types/schemas.js +213 -273
- package/esm/types/schemas.js.map +1 -1
- package/esm/utils/userop.d.ts +9 -9
- package/esm/utils/userop.js.map +1 -1
- package/lib/cli/setupServer.js +3 -3
- package/lib/cli/setupServer.js.map +1 -1
- package/lib/executor/executorManager.d.ts +9 -9
- package/lib/mempool/index.d.ts +1 -0
- package/lib/mempool/index.js +1 -0
- package/lib/mempool/index.js.map +1 -1
- package/lib/{rpc → mempool}/nonceQueuer.d.ts +1 -1
- package/lib/mempool/nonceQueuer.js.map +1 -0
- package/lib/mempool/reputationManager.d.ts +3 -2
- package/lib/mempool/reputationManager.js.map +1 -1
- package/lib/rpc/createMethodHandler.d.ts +31 -0
- package/lib/rpc/createMethodHandler.js +34 -0
- package/lib/rpc/createMethodHandler.js.map +1 -0
- package/lib/rpc/estimation/gasEstimationHandler.d.ts +3 -3
- package/lib/rpc/estimation/gasEstimationHandler.js +16 -9
- package/lib/rpc/estimation/gasEstimationHandler.js.map +1 -1
- package/lib/rpc/index.d.ts +0 -1
- package/lib/rpc/index.js +0 -1
- package/lib/rpc/index.js.map +1 -1
- package/lib/rpc/methods/debug_bundler_clearReputation.d.ts +22 -0
- package/lib/rpc/methods/debug_bundler_clearReputation.js +15 -0
- package/lib/rpc/methods/debug_bundler_clearReputation.js.map +1 -0
- package/lib/rpc/methods/debug_bundler_clearState.d.ts +22 -0
- package/lib/rpc/methods/debug_bundler_clearState.js +16 -0
- package/lib/rpc/methods/debug_bundler_clearState.js.map +1 -0
- package/lib/rpc/methods/debug_bundler_dumpMempool.d.ts +468 -0
- package/lib/rpc/methods/debug_bundler_dumpMempool.js +16 -0
- package/lib/rpc/methods/debug_bundler_dumpMempool.js.map +1 -0
- package/lib/rpc/methods/debug_bundler_dumpReputation.d.ts +57 -0
- package/lib/rpc/methods/debug_bundler_dumpReputation.js +16 -0
- package/lib/rpc/methods/debug_bundler_dumpReputation.js.map +1 -0
- package/lib/rpc/methods/debug_bundler_getStakeStatus.d.ts +79 -0
- package/lib/rpc/methods/debug_bundler_getStakeStatus.js +17 -0
- package/lib/rpc/methods/debug_bundler_getStakeStatus.js.map +1 -0
- package/lib/rpc/methods/debug_bundler_sendBundleNow.d.ts +22 -0
- package/lib/rpc/methods/debug_bundler_sendBundleNow.js +15 -0
- package/lib/rpc/methods/debug_bundler_sendBundleNow.js.map +1 -0
- package/lib/rpc/methods/debug_bundler_setBundlingMode.d.ts +22 -0
- package/lib/rpc/methods/debug_bundler_setBundlingMode.js +16 -0
- package/lib/rpc/methods/debug_bundler_setBundlingMode.js.map +1 -0
- package/lib/rpc/methods/debug_bundler_setReputation.d.ts +46 -0
- package/lib/rpc/methods/debug_bundler_setReputation.js +16 -0
- package/lib/rpc/methods/debug_bundler_setReputation.js.map +1 -0
- package/lib/rpc/methods/eth_chainId.d.ts +22 -0
- package/lib/rpc/methods/eth_chainId.js +13 -0
- package/lib/rpc/methods/eth_chainId.js.map +1 -0
- package/lib/rpc/methods/eth_estimateUserOperationGas.d.ts +979 -0
- package/lib/rpc/methods/eth_estimateUserOperationGas.js +21 -0
- package/lib/rpc/methods/eth_estimateUserOperationGas.js.map +1 -0
- package/lib/rpc/methods/eth_getUserOperationByHash.d.ts +878 -0
- package/lib/rpc/methods/eth_getUserOperationByHash.js +101 -0
- package/lib/rpc/methods/eth_getUserOperationByHash.js.map +1 -0
- package/lib/rpc/methods/eth_getUserOperationReceipt.d.ts +412 -0
- package/lib/rpc/methods/eth_getUserOperationReceipt.js +14 -0
- package/lib/rpc/methods/eth_getUserOperationReceipt.js.map +1 -0
- package/lib/rpc/methods/eth_sendUserOperation.d.ts +422 -0
- package/lib/rpc/methods/eth_sendUserOperation.js +33 -0
- package/lib/rpc/methods/eth_sendUserOperation.js.map +1 -0
- package/lib/rpc/methods/eth_supportedEntryPoints.d.ts +22 -0
- package/lib/rpc/methods/eth_supportedEntryPoints.js +13 -0
- package/lib/rpc/methods/eth_supportedEntryPoints.js.map +1 -0
- package/lib/rpc/methods/index.d.ts +3 -0
- package/lib/rpc/methods/index.js +49 -0
- package/lib/rpc/methods/index.js.map +1 -0
- package/lib/rpc/methods/pimlico_experimental_estimateUserOperationGas7702.d.ts +979 -0
- package/lib/rpc/methods/pimlico_experimental_estimateUserOperationGas7702.js +23 -0
- package/lib/rpc/methods/pimlico_experimental_estimateUserOperationGas7702.js.map +1 -0
- package/lib/rpc/methods/pimlico_experimental_sendUserOperation7702.d.ts +422 -0
- package/lib/rpc/methods/pimlico_experimental_sendUserOperation7702.js +19 -0
- package/lib/rpc/methods/pimlico_experimental_sendUserOperation7702.js.map +1 -0
- package/lib/rpc/methods/pimlico_getUserOperationGasPrice.d.ts +131 -0
- package/lib/rpc/methods/pimlico_getUserOperationGasPrice.js +33 -0
- package/lib/rpc/methods/pimlico_getUserOperationGasPrice.js.map +1 -0
- package/lib/rpc/methods/pimlico_getUserOperationStatus.d.ts +43 -0
- package/lib/rpc/methods/pimlico_getUserOperationStatus.js +14 -0
- package/lib/rpc/methods/pimlico_getUserOperationStatus.js.map +1 -0
- package/lib/rpc/methods/pimlico_sendUserOperationNow.d.ts +812 -0
- package/lib/rpc/methods/pimlico_sendUserOperationNow.js +44 -0
- package/lib/rpc/methods/pimlico_sendUserOperationNow.js.map +1 -0
- package/lib/rpc/rpcHandler.d.ts +13 -104
- package/lib/rpc/rpcHandler.js +32 -371
- package/lib/rpc/rpcHandler.js.map +1 -1
- package/lib/rpc/server.d.ts +2 -2
- package/lib/rpc/server.js +1 -1
- package/lib/rpc/server.js.map +1 -1
- package/lib/rpc/validation/TracerResultParserV07.js +4 -4
- package/lib/rpc/validation/TracerResultParserV07.js.map +1 -1
- package/lib/rpc/validation/UnsafeValidator.d.ts +2 -2
- package/lib/rpc/validation/UnsafeValidator.js +3 -3
- package/lib/rpc/validation/UnsafeValidator.js.map +1 -1
- package/lib/types/interfaces.d.ts +1 -1
- package/lib/types/schemas.d.ts +9368 -3502
- package/lib/types/schemas.js +261 -348
- package/lib/types/schemas.js.map +1 -1
- package/lib/utils/userop.d.ts +9 -9
- package/lib/utils/userop.js.map +1 -1
- package/package.json +2 -1
- package/esm/rpc/nonceQueuer.js.map +0 -1
- package/lib/rpc/nonceQueuer.js.map +0 -1
- /package/esm/{rpc → mempool}/nonceQueuer.js +0 -0
- /package/lib/{rpc → mempool}/nonceQueuer.js +0 -0
package/lib/types/schemas.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.bundlerRpcSchema = exports.bundlerRequestSchema = exports.altoVersions = exports.pimlicoExperimentalSendUserOperation7702Schema = exports.pimlicoExperimentalEstimateUserOperationGas7702Schema = exports.pimlicoSendUserOperationNowSchema = exports.pimlicoGetUserOperationGasPriceSchema = exports.pimlicoGetUserOperationStatusSchema = exports.debugGetStakeStatusSchema = exports.debugClearReputationSchema = exports.debugDumpReputationSchema = exports.debugSetReputationSchema = exports.debugSetBundlingModeSchema = exports.debugSendBundleNowSchema = exports.debugDumpMempoolSchema = exports.debugClearMempoolSchema = exports.debugClearStateSchema = exports.getUserOperationReceiptSchema = exports.getUserOperationByHashSchema = exports.sendUserOperationSchema = exports.estimateUserOperationGasSchema = exports.supportedEntryPointsSchema = exports.chainIdSchema = exports.receiptSchema = exports.logSchema = exports.jsonRpcSchema = exports.stateOverridesSchema = exports.hexData32Schema = exports.hexDataSchema = exports.hexNumberSchema = exports.addressSchema = exports.commaSeperatedAddressPattern = exports.hexData32Pattern = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const hexDataPattern = /^0x[0-9A-Fa-f]*$/;
|
|
7
7
|
const addressPattern = /^0x[0-9,a-f,A-F]{40}$/;
|
|
8
8
|
exports.hexData32Pattern = /^0x([0-9a-fA-F][0-9a-fA-F]){32}$/;
|
|
9
9
|
exports.commaSeperatedAddressPattern = /^(0x[0-9a-fA-F]{40})(,\s*(0x[0-9a-fA-F]{40}))*$/;
|
|
10
|
-
|
|
10
|
+
exports.addressSchema = zod_1.z
|
|
11
11
|
.string()
|
|
12
12
|
.regex(addressPattern, { message: "not a valid hex address" })
|
|
13
13
|
.transform((val) => (0, viem_1.getAddress)(val));
|
|
14
|
-
exports.addressSchema = addressSchema;
|
|
15
14
|
exports.hexNumberSchema = zod_1.z
|
|
16
15
|
.string()
|
|
17
16
|
.regex(hexDataPattern)
|
|
@@ -21,38 +20,43 @@ exports.hexNumberSchema = zod_1.z
|
|
|
21
20
|
.refine((val) => val <= viem_1.maxUint256, {
|
|
22
21
|
message: "not a valid uint256"
|
|
23
22
|
});
|
|
24
|
-
|
|
23
|
+
exports.hexDataSchema = zod_1.z
|
|
25
24
|
.string()
|
|
26
25
|
.regex(hexDataPattern, { message: "not valid hex data" })
|
|
27
26
|
.transform((val) => val);
|
|
28
|
-
exports.
|
|
29
|
-
const hexData32Schema = zod_1.z
|
|
27
|
+
exports.hexData32Schema = zod_1.z
|
|
30
28
|
.string()
|
|
31
29
|
.regex(exports.hexData32Pattern, { message: "not valid 32-byte hex data" })
|
|
32
30
|
.transform((val) => val);
|
|
33
|
-
exports.
|
|
31
|
+
exports.stateOverridesSchema = zod_1.z.record(exports.addressSchema, zod_1.z.object({
|
|
32
|
+
balance: exports.hexNumberSchema.optional(),
|
|
33
|
+
nonce: exports.hexNumberSchema.optional(),
|
|
34
|
+
code: exports.hexDataSchema.optional(),
|
|
35
|
+
state: zod_1.z.record(exports.hexData32Schema, exports.hexData32Schema).optional(),
|
|
36
|
+
stateDiff: zod_1.z.record(exports.hexData32Schema, exports.hexData32Schema).optional()
|
|
37
|
+
}));
|
|
34
38
|
const signedAuthorizationSchema = zod_1.z.object({
|
|
35
|
-
contractAddress: addressSchema,
|
|
39
|
+
contractAddress: exports.addressSchema,
|
|
36
40
|
chainId: exports.hexNumberSchema.transform((val) => Number(val)),
|
|
37
41
|
nonce: exports.hexNumberSchema.transform((val) => Number(val)),
|
|
38
|
-
r: hexData32Schema.transform((val) => val),
|
|
39
|
-
s: hexData32Schema.transform((val) => val),
|
|
42
|
+
r: exports.hexData32Schema.transform((val) => val),
|
|
43
|
+
s: exports.hexData32Schema.transform((val) => val),
|
|
40
44
|
v: exports.hexNumberSchema,
|
|
41
45
|
yParity: exports.hexNumberSchema.transform((val) => Number(val))
|
|
42
46
|
});
|
|
43
47
|
const userOperationV06Schema = zod_1.z
|
|
44
48
|
.object({
|
|
45
|
-
sender: addressSchema,
|
|
49
|
+
sender: exports.addressSchema,
|
|
46
50
|
nonce: exports.hexNumberSchema,
|
|
47
|
-
initCode: hexDataSchema,
|
|
48
|
-
callData: hexDataSchema,
|
|
51
|
+
initCode: exports.hexDataSchema,
|
|
52
|
+
callData: exports.hexDataSchema,
|
|
49
53
|
callGasLimit: exports.hexNumberSchema,
|
|
50
54
|
verificationGasLimit: exports.hexNumberSchema,
|
|
51
55
|
preVerificationGas: exports.hexNumberSchema,
|
|
52
56
|
maxPriorityFeePerGas: exports.hexNumberSchema,
|
|
53
57
|
maxFeePerGas: exports.hexNumberSchema,
|
|
54
|
-
paymasterAndData: hexDataSchema,
|
|
55
|
-
signature: hexDataSchema,
|
|
58
|
+
paymasterAndData: exports.hexDataSchema,
|
|
59
|
+
signature: exports.hexDataSchema,
|
|
56
60
|
eip7702auth: signedAuthorizationSchema.optional().nullable()
|
|
57
61
|
})
|
|
58
62
|
.strict()
|
|
@@ -61,23 +65,23 @@ const userOperationV06Schema = zod_1.z
|
|
|
61
65
|
});
|
|
62
66
|
const userOperationV07Schema = zod_1.z
|
|
63
67
|
.object({
|
|
64
|
-
sender: addressSchema,
|
|
68
|
+
sender: exports.addressSchema,
|
|
65
69
|
nonce: exports.hexNumberSchema,
|
|
66
|
-
factory: addressSchema
|
|
70
|
+
factory: exports.addressSchema
|
|
67
71
|
.nullable()
|
|
68
72
|
.optional()
|
|
69
73
|
.transform((val) => val ?? null),
|
|
70
|
-
factoryData: hexDataSchema
|
|
74
|
+
factoryData: exports.hexDataSchema
|
|
71
75
|
.nullable()
|
|
72
76
|
.optional()
|
|
73
77
|
.transform((val) => val ?? null),
|
|
74
|
-
callData: hexDataSchema,
|
|
78
|
+
callData: exports.hexDataSchema,
|
|
75
79
|
callGasLimit: exports.hexNumberSchema,
|
|
76
80
|
verificationGasLimit: exports.hexNumberSchema,
|
|
77
81
|
preVerificationGas: exports.hexNumberSchema,
|
|
78
82
|
maxFeePerGas: exports.hexNumberSchema,
|
|
79
83
|
maxPriorityFeePerGas: exports.hexNumberSchema,
|
|
80
|
-
paymaster: addressSchema
|
|
84
|
+
paymaster: exports.addressSchema
|
|
81
85
|
.nullable()
|
|
82
86
|
.optional()
|
|
83
87
|
.transform((val) => val ?? null),
|
|
@@ -89,28 +93,28 @@ const userOperationV07Schema = zod_1.z
|
|
|
89
93
|
.nullable()
|
|
90
94
|
.optional()
|
|
91
95
|
.transform((val) => val ?? null),
|
|
92
|
-
paymasterData: hexDataSchema
|
|
96
|
+
paymasterData: exports.hexDataSchema
|
|
93
97
|
.nullable()
|
|
94
98
|
.optional()
|
|
95
99
|
.transform((val) => val ?? null),
|
|
96
|
-
signature: hexDataSchema,
|
|
100
|
+
signature: exports.hexDataSchema,
|
|
97
101
|
eip7702auth: signedAuthorizationSchema.optional().nullable()
|
|
98
102
|
})
|
|
99
103
|
.strict()
|
|
100
104
|
.transform((val) => val);
|
|
101
105
|
const partialUserOperationV06Schema = zod_1.z
|
|
102
106
|
.object({
|
|
103
|
-
sender: addressSchema,
|
|
107
|
+
sender: exports.addressSchema,
|
|
104
108
|
nonce: exports.hexNumberSchema,
|
|
105
|
-
initCode: hexDataSchema,
|
|
106
|
-
callData: hexDataSchema,
|
|
109
|
+
initCode: exports.hexDataSchema,
|
|
110
|
+
callData: exports.hexDataSchema,
|
|
107
111
|
callGasLimit: exports.hexNumberSchema.default(1n),
|
|
108
112
|
verificationGasLimit: exports.hexNumberSchema.default(1n),
|
|
109
113
|
preVerificationGas: exports.hexNumberSchema.default(1n),
|
|
110
114
|
maxPriorityFeePerGas: exports.hexNumberSchema.default(1n),
|
|
111
115
|
maxFeePerGas: exports.hexNumberSchema.default(1n),
|
|
112
|
-
paymasterAndData: hexDataSchema,
|
|
113
|
-
signature: hexDataSchema,
|
|
116
|
+
paymasterAndData: exports.hexDataSchema,
|
|
117
|
+
signature: exports.hexDataSchema,
|
|
114
118
|
eip7702auth: signedAuthorizationSchema.optional()
|
|
115
119
|
})
|
|
116
120
|
.strict()
|
|
@@ -119,23 +123,23 @@ const partialUserOperationV06Schema = zod_1.z
|
|
|
119
123
|
});
|
|
120
124
|
const partialUserOperationV07Schema = zod_1.z
|
|
121
125
|
.object({
|
|
122
|
-
sender: addressSchema,
|
|
126
|
+
sender: exports.addressSchema,
|
|
123
127
|
nonce: exports.hexNumberSchema,
|
|
124
|
-
factory: addressSchema
|
|
128
|
+
factory: exports.addressSchema
|
|
125
129
|
.nullable()
|
|
126
130
|
.optional()
|
|
127
131
|
.transform((val) => val ?? null),
|
|
128
|
-
factoryData: hexDataSchema
|
|
132
|
+
factoryData: exports.hexDataSchema
|
|
129
133
|
.nullable()
|
|
130
134
|
.optional()
|
|
131
135
|
.transform((val) => val ?? null),
|
|
132
|
-
callData: hexDataSchema,
|
|
136
|
+
callData: exports.hexDataSchema,
|
|
133
137
|
callGasLimit: exports.hexNumberSchema.default(1n),
|
|
134
138
|
verificationGasLimit: exports.hexNumberSchema.default(1n),
|
|
135
139
|
preVerificationGas: exports.hexNumberSchema.default(1n),
|
|
136
140
|
maxFeePerGas: exports.hexNumberSchema.default(1n),
|
|
137
141
|
maxPriorityFeePerGas: exports.hexNumberSchema.default(1n),
|
|
138
|
-
paymaster: addressSchema
|
|
142
|
+
paymaster: exports.addressSchema
|
|
139
143
|
.nullable()
|
|
140
144
|
.optional()
|
|
141
145
|
.transform((val) => val ?? null),
|
|
@@ -147,26 +151,26 @@ const partialUserOperationV07Schema = zod_1.z
|
|
|
147
151
|
.nullable()
|
|
148
152
|
.optional()
|
|
149
153
|
.transform((val) => val ?? null),
|
|
150
|
-
paymasterData: hexDataSchema
|
|
154
|
+
paymasterData: exports.hexDataSchema
|
|
151
155
|
.nullable()
|
|
152
156
|
.optional()
|
|
153
157
|
.transform((val) => val ?? null),
|
|
154
|
-
signature: hexDataSchema,
|
|
158
|
+
signature: exports.hexDataSchema,
|
|
155
159
|
eip7702auth: signedAuthorizationSchema.optional().nullable()
|
|
156
160
|
})
|
|
157
161
|
.strict()
|
|
158
162
|
.transform((val) => val);
|
|
159
163
|
const packerUserOperationSchema = zod_1.z
|
|
160
164
|
.object({
|
|
161
|
-
sender: addressSchema,
|
|
165
|
+
sender: exports.addressSchema,
|
|
162
166
|
nonce: exports.hexNumberSchema,
|
|
163
|
-
initCode: hexDataSchema,
|
|
164
|
-
callData: hexDataSchema,
|
|
165
|
-
accountGasLimits: hexData32Schema,
|
|
167
|
+
initCode: exports.hexDataSchema,
|
|
168
|
+
callData: exports.hexDataSchema,
|
|
169
|
+
accountGasLimits: exports.hexData32Schema,
|
|
166
170
|
preVerificationGas: exports.hexNumberSchema,
|
|
167
|
-
gasFees: hexData32Schema,
|
|
168
|
-
paymasterAndData: hexDataSchema,
|
|
169
|
-
signature: hexDataSchema
|
|
171
|
+
gasFees: exports.hexData32Schema,
|
|
172
|
+
paymasterAndData: exports.hexDataSchema,
|
|
173
|
+
signature: exports.hexDataSchema
|
|
170
174
|
})
|
|
171
175
|
.strict()
|
|
172
176
|
.transform((val) => val);
|
|
@@ -178,8 +182,7 @@ const userOperationSchema = zod_1.z.union([
|
|
|
178
182
|
userOperationV06Schema,
|
|
179
183
|
userOperationV07Schema
|
|
180
184
|
]);
|
|
181
|
-
exports.
|
|
182
|
-
const jsonRpcSchema = zod_1.z
|
|
185
|
+
exports.jsonRpcSchema = zod_1.z
|
|
183
186
|
.object({
|
|
184
187
|
jsonrpc: zod_1.z.literal("2.0"),
|
|
185
188
|
id: zod_1.z.number(),
|
|
@@ -190,7 +193,6 @@ const jsonRpcSchema = zod_1.z
|
|
|
190
193
|
.transform((val) => val ?? [])
|
|
191
194
|
})
|
|
192
195
|
.strict();
|
|
193
|
-
exports.jsonRpcSchema = jsonRpcSchema;
|
|
194
196
|
const jsonRpcResultSchema = zod_1.z
|
|
195
197
|
.object({
|
|
196
198
|
jsonrpc: zod_1.z.literal("2.0"),
|
|
@@ -198,169 +200,96 @@ const jsonRpcResultSchema = zod_1.z
|
|
|
198
200
|
result: zod_1.z.unknown()
|
|
199
201
|
})
|
|
200
202
|
.strict();
|
|
201
|
-
exports.
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
balance: exports.hexNumberSchema.optional(),
|
|
212
|
-
nonce: exports.hexNumberSchema.optional(),
|
|
213
|
-
code: hexDataSchema.optional(),
|
|
214
|
-
state: zod_1.z.record(hexData32Schema, hexData32Schema).optional(),
|
|
215
|
-
stateDiff: zod_1.z.record(hexData32Schema, hexData32Schema).optional()
|
|
216
|
-
}));
|
|
217
|
-
const estimateUserOperationGasRequestSchema = zod_1.z.object({
|
|
218
|
-
method: zod_1.z.literal("eth_estimateUserOperationGas"),
|
|
219
|
-
params: zod_1.z.union([
|
|
220
|
-
zod_1.z.tuple([partialUserOperationSchema, addressSchema]),
|
|
221
|
-
zod_1.z.tuple([
|
|
222
|
-
partialUserOperationSchema,
|
|
223
|
-
addressSchema,
|
|
224
|
-
stateOverridesSchema
|
|
225
|
-
])
|
|
226
|
-
])
|
|
227
|
-
});
|
|
228
|
-
const sendUserOperationRequestSchema = zod_1.z.object({
|
|
229
|
-
method: zod_1.z.literal("eth_sendUserOperation"),
|
|
230
|
-
params: zod_1.z.tuple([userOperationSchema, addressSchema])
|
|
231
|
-
});
|
|
232
|
-
const getUserOperationByHashRequestSchema = zod_1.z.object({
|
|
233
|
-
method: zod_1.z.literal("eth_getUserOperationByHash"),
|
|
234
|
-
params: zod_1.z.tuple([
|
|
235
|
-
zod_1.z
|
|
236
|
-
.string()
|
|
237
|
-
.regex(exports.hexData32Pattern, { message: "Missing/invalid userOpHash" })
|
|
238
|
-
.transform((val) => val)
|
|
239
|
-
])
|
|
240
|
-
});
|
|
241
|
-
const getUserOperationReceiptRequestSchema = zod_1.z.object({
|
|
242
|
-
method: zod_1.z.literal("eth_getUserOperationReceipt"),
|
|
243
|
-
params: zod_1.z.tuple([
|
|
244
|
-
zod_1.z
|
|
245
|
-
.string()
|
|
246
|
-
.regex(exports.hexData32Pattern, { message: "Missing/invalid userOpHash" })
|
|
247
|
-
.transform((val) => val)
|
|
248
|
-
])
|
|
249
|
-
});
|
|
250
|
-
const bundlerClearStateRequestSchema = zod_1.z.object({
|
|
251
|
-
method: zod_1.z.literal("debug_bundler_clearState"),
|
|
252
|
-
params: zod_1.z.tuple([])
|
|
253
|
-
});
|
|
254
|
-
exports.bundlerClearStateRequestSchema = bundlerClearStateRequestSchema;
|
|
255
|
-
const bundlerClearMempoolRequestSchema = zod_1.z.object({
|
|
256
|
-
method: zod_1.z.literal("debug_bundler_clearMempool"),
|
|
257
|
-
params: zod_1.z.tuple([])
|
|
258
|
-
});
|
|
259
|
-
exports.bundlerClearMempoolRequestSchema = bundlerClearMempoolRequestSchema;
|
|
260
|
-
const bundlerDumpMempoolRequestSchema = zod_1.z.object({
|
|
261
|
-
method: zod_1.z.literal("debug_bundler_dumpMempool"),
|
|
262
|
-
params: zod_1.z.tuple([addressSchema])
|
|
263
|
-
});
|
|
264
|
-
exports.bundlerDumpMempoolRequestSchema = bundlerDumpMempoolRequestSchema;
|
|
265
|
-
const bundlerSendBundleNowRequestSchema = zod_1.z.object({
|
|
266
|
-
method: zod_1.z.literal("debug_bundler_sendBundleNow"),
|
|
267
|
-
params: zod_1.z.tuple([])
|
|
268
|
-
});
|
|
269
|
-
exports.bundlerSendBundleNowRequestSchema = bundlerSendBundleNowRequestSchema;
|
|
270
|
-
const bundlerSetBundlingModeRequestSchema = zod_1.z.object({
|
|
271
|
-
method: zod_1.z.literal("debug_bundler_setBundlingMode"),
|
|
272
|
-
params: zod_1.z.tuple([zod_1.z.enum(["manual", "auto"])])
|
|
273
|
-
});
|
|
274
|
-
exports.bundlerSetBundlingModeRequestSchema = bundlerSetBundlingModeRequestSchema;
|
|
275
|
-
const bundlerSetReputationsRequestSchema = zod_1.z.object({
|
|
276
|
-
method: zod_1.z.literal("debug_bundler_setReputation"),
|
|
277
|
-
params: zod_1.z.tuple([
|
|
278
|
-
zod_1.z.array(zod_1.z.object({
|
|
279
|
-
address: addressSchema,
|
|
280
|
-
opsSeen: exports.hexNumberSchema,
|
|
281
|
-
opsIncluded: exports.hexNumberSchema
|
|
282
|
-
})),
|
|
283
|
-
addressSchema
|
|
284
|
-
])
|
|
285
|
-
});
|
|
286
|
-
exports.bundlerSetReputationsRequestSchema = bundlerSetReputationsRequestSchema;
|
|
287
|
-
const bundlerDumpReputationsRequestSchema = zod_1.z.object({
|
|
288
|
-
method: zod_1.z.literal("debug_bundler_dumpReputation"),
|
|
289
|
-
params: zod_1.z.tuple([addressSchema])
|
|
290
|
-
});
|
|
291
|
-
exports.bundlerDumpReputationsRequestSchema = bundlerDumpReputationsRequestSchema;
|
|
292
|
-
const bundlerClearReputationRequestSchema = zod_1.z.object({
|
|
293
|
-
method: zod_1.z.literal("debug_bundler_clearReputation"),
|
|
294
|
-
params: zod_1.z.tuple([])
|
|
295
|
-
});
|
|
296
|
-
const pimlicoGetStakeStatusRequestSchema = zod_1.z.object({
|
|
297
|
-
method: zod_1.z.literal("debug_bundler_getStakeStatus"),
|
|
298
|
-
params: zod_1.z.tuple([addressSchema, addressSchema])
|
|
299
|
-
});
|
|
300
|
-
exports.pimlicoGetStakeStatusRequestSchema = pimlicoGetStakeStatusRequestSchema;
|
|
301
|
-
const pimlicoGetUserOperationStatusRequestSchema = zod_1.z.object({
|
|
302
|
-
method: zod_1.z.literal("pimlico_getUserOperationStatus"),
|
|
303
|
-
params: zod_1.z.tuple([hexData32Schema])
|
|
304
|
-
});
|
|
305
|
-
exports.pimlicoGetUserOperationStatusRequestSchema = pimlicoGetUserOperationStatusRequestSchema;
|
|
306
|
-
const pimlicoGetUserOperationGasPriceRequestSchema = zod_1.z.object({
|
|
307
|
-
method: zod_1.z.literal("pimlico_getUserOperationGasPrice"),
|
|
308
|
-
params: zod_1.z.tuple([])
|
|
203
|
+
exports.logSchema = zod_1.z.object({
|
|
204
|
+
//removed: z.boolean().optional(),
|
|
205
|
+
logIndex: exports.hexNumberSchema,
|
|
206
|
+
transactionIndex: exports.hexNumberSchema,
|
|
207
|
+
transactionHash: exports.hexData32Schema,
|
|
208
|
+
blockHash: exports.hexData32Schema,
|
|
209
|
+
blockNumber: exports.hexNumberSchema,
|
|
210
|
+
address: exports.addressSchema,
|
|
211
|
+
data: exports.hexDataSchema,
|
|
212
|
+
topics: zod_1.z.array(exports.hexData32Schema)
|
|
309
213
|
});
|
|
310
|
-
exports.
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
214
|
+
exports.receiptSchema = zod_1.z.object({
|
|
215
|
+
transactionHash: exports.hexData32Schema,
|
|
216
|
+
transactionIndex: exports.hexNumberSchema,
|
|
217
|
+
blockHash: exports.hexData32Schema,
|
|
218
|
+
blockNumber: exports.hexNumberSchema,
|
|
219
|
+
from: exports.addressSchema,
|
|
220
|
+
to: exports.addressSchema.or(zod_1.z.null()),
|
|
221
|
+
cumulativeGasUsed: exports.hexNumberSchema,
|
|
222
|
+
gasUsed: exports.hexNumberSchema,
|
|
223
|
+
contractAddress: exports.addressSchema.or(zod_1.z.null()),
|
|
224
|
+
logs: zod_1.z.array(exports.logSchema),
|
|
225
|
+
logsBloom: zod_1.z.string().regex(/^0x[0-9a-f]{512}$/),
|
|
226
|
+
//root: hexData32Schema,
|
|
227
|
+
status: exports.hexNumberSchema.or(zod_1.z.null()),
|
|
228
|
+
effectiveGasPrice: exports.hexNumberSchema.nullish()
|
|
229
|
+
//type: hexNumberSchema
|
|
314
230
|
});
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
231
|
+
const userOperationReceiptSchema = zod_1.z
|
|
232
|
+
.object({
|
|
233
|
+
userOpHash: exports.hexData32Schema,
|
|
234
|
+
entryPoint: exports.addressSchema,
|
|
235
|
+
sender: exports.addressSchema,
|
|
236
|
+
nonce: exports.hexNumberSchema,
|
|
237
|
+
paymaster: exports.addressSchema.optional(),
|
|
238
|
+
actualGasCost: exports.hexNumberSchema,
|
|
239
|
+
actualGasUsed: exports.hexNumberSchema,
|
|
240
|
+
success: zod_1.z.boolean(),
|
|
241
|
+
reason: exports.hexDataSchema.optional(), // revert reason
|
|
242
|
+
logs: zod_1.z.array(exports.logSchema),
|
|
243
|
+
receipt: exports.receiptSchema
|
|
244
|
+
})
|
|
245
|
+
.or(zod_1.z.null());
|
|
246
|
+
const userOperationStatus = zod_1.z.object({
|
|
247
|
+
status: zod_1.z.enum([
|
|
248
|
+
"not_found",
|
|
249
|
+
"not_submitted",
|
|
250
|
+
"submitted",
|
|
251
|
+
"rejected",
|
|
252
|
+
"reverted",
|
|
253
|
+
"included",
|
|
254
|
+
"failed"
|
|
255
|
+
]),
|
|
256
|
+
transactionHash: exports.hexData32Schema.or(zod_1.z.null())
|
|
325
257
|
});
|
|
326
|
-
const
|
|
327
|
-
|
|
328
|
-
|
|
258
|
+
const gasPriceSchema = zod_1.z.object({
|
|
259
|
+
slow: zod_1.z.object({
|
|
260
|
+
maxFeePerGas: zod_1.z.bigint(),
|
|
261
|
+
maxPriorityFeePerGas: zod_1.z.bigint()
|
|
262
|
+
}),
|
|
263
|
+
standard: zod_1.z.object({
|
|
264
|
+
maxFeePerGas: zod_1.z.bigint(),
|
|
265
|
+
maxPriorityFeePerGas: zod_1.z.bigint()
|
|
266
|
+
}),
|
|
267
|
+
fast: zod_1.z.object({
|
|
268
|
+
maxFeePerGas: zod_1.z.bigint(),
|
|
269
|
+
maxPriorityFeePerGas: zod_1.z.bigint()
|
|
270
|
+
})
|
|
329
271
|
});
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
chainIdRequestSchema,
|
|
333
|
-
supportedEntryPointsRequestSchema,
|
|
334
|
-
estimateUserOperationGasRequestSchema,
|
|
335
|
-
sendUserOperationRequestSchema,
|
|
336
|
-
getUserOperationByHashRequestSchema,
|
|
337
|
-
getUserOperationReceiptRequestSchema,
|
|
338
|
-
bundlerClearStateRequestSchema,
|
|
339
|
-
bundlerClearMempoolRequestSchema,
|
|
340
|
-
bundlerDumpMempoolRequestSchema,
|
|
341
|
-
bundlerSendBundleNowRequestSchema,
|
|
342
|
-
bundlerSetBundlingModeRequestSchema,
|
|
343
|
-
bundlerSetReputationsRequestSchema,
|
|
344
|
-
bundlerDumpReputationsRequestSchema,
|
|
345
|
-
bundlerClearReputationRequestSchema,
|
|
346
|
-
pimlicoGetStakeStatusRequestSchema,
|
|
347
|
-
pimlicoGetUserOperationStatusRequestSchema,
|
|
348
|
-
pimlicoGetUserOperationGasPriceRequestSchema,
|
|
349
|
-
pimlicoSendUserOperationNowRequestSchema,
|
|
350
|
-
pimlicoExperimentalSendUserOperation7702RequestSchema,
|
|
351
|
-
pimlicoExperimentalEstimateUserOperationGas7702RequestSchema
|
|
352
|
-
]);
|
|
353
|
-
exports.bundlerRequestSchema = bundlerRequestSchema;
|
|
354
|
-
const chainIdResponseSchema = zod_1.z.object({
|
|
272
|
+
// Combined schemas (request + response)
|
|
273
|
+
exports.chainIdSchema = zod_1.z.object({
|
|
355
274
|
method: zod_1.z.literal("eth_chainId"),
|
|
275
|
+
params: zod_1.z.tuple([]),
|
|
356
276
|
result: exports.hexNumberSchema
|
|
357
277
|
});
|
|
358
|
-
|
|
278
|
+
exports.supportedEntryPointsSchema = zod_1.z.object({
|
|
359
279
|
method: zod_1.z.literal("eth_supportedEntryPoints"),
|
|
360
|
-
|
|
280
|
+
params: zod_1.z.tuple([]),
|
|
281
|
+
result: zod_1.z.array(exports.addressSchema)
|
|
361
282
|
});
|
|
362
|
-
|
|
283
|
+
exports.estimateUserOperationGasSchema = zod_1.z.object({
|
|
363
284
|
method: zod_1.z.literal("eth_estimateUserOperationGas"),
|
|
285
|
+
params: zod_1.z.union([
|
|
286
|
+
zod_1.z.tuple([partialUserOperationSchema, exports.addressSchema]),
|
|
287
|
+
zod_1.z.tuple([
|
|
288
|
+
partialUserOperationSchema,
|
|
289
|
+
exports.addressSchema,
|
|
290
|
+
exports.stateOverridesSchema
|
|
291
|
+
])
|
|
292
|
+
]),
|
|
364
293
|
result: zod_1.z.union([
|
|
365
294
|
zod_1.z.object({
|
|
366
295
|
callGasLimit: exports.hexNumberSchema,
|
|
@@ -377,182 +306,136 @@ const estimateUserOperationGasResponseSchema = zod_1.z.object({
|
|
|
377
306
|
})
|
|
378
307
|
])
|
|
379
308
|
});
|
|
380
|
-
|
|
309
|
+
exports.sendUserOperationSchema = zod_1.z.object({
|
|
381
310
|
method: zod_1.z.literal("eth_sendUserOperation"),
|
|
382
|
-
|
|
311
|
+
params: zod_1.z.tuple([userOperationSchema, exports.addressSchema]),
|
|
312
|
+
result: exports.hexData32Schema
|
|
383
313
|
});
|
|
384
|
-
|
|
314
|
+
exports.getUserOperationByHashSchema = zod_1.z.object({
|
|
385
315
|
method: zod_1.z.literal("eth_getUserOperationByHash"),
|
|
316
|
+
params: zod_1.z.tuple([
|
|
317
|
+
zod_1.z
|
|
318
|
+
.string()
|
|
319
|
+
.regex(exports.hexData32Pattern, { message: "Missing/invalid userOpHash" })
|
|
320
|
+
.transform((val) => val)
|
|
321
|
+
]),
|
|
386
322
|
result: zod_1.z
|
|
387
323
|
.object({
|
|
388
324
|
userOperation: userOperationSchema,
|
|
389
|
-
entryPoint: addressSchema,
|
|
325
|
+
entryPoint: exports.addressSchema,
|
|
390
326
|
blockNumber: exports.hexNumberSchema,
|
|
391
|
-
blockHash: hexData32Schema,
|
|
392
|
-
transactionHash: hexData32Schema
|
|
327
|
+
blockHash: exports.hexData32Schema,
|
|
328
|
+
transactionHash: exports.hexData32Schema
|
|
393
329
|
})
|
|
394
330
|
.or(zod_1.z.null())
|
|
395
331
|
});
|
|
396
|
-
|
|
397
|
-
//removed: z.boolean().optional(),
|
|
398
|
-
logIndex: exports.hexNumberSchema,
|
|
399
|
-
transactionIndex: exports.hexNumberSchema,
|
|
400
|
-
transactionHash: hexData32Schema,
|
|
401
|
-
blockHash: hexData32Schema,
|
|
402
|
-
blockNumber: exports.hexNumberSchema,
|
|
403
|
-
address: addressSchema,
|
|
404
|
-
data: hexDataSchema,
|
|
405
|
-
topics: zod_1.z.array(hexData32Schema)
|
|
406
|
-
});
|
|
407
|
-
exports.logSchema = logSchema;
|
|
408
|
-
const receiptSchema = zod_1.z.object({
|
|
409
|
-
transactionHash: hexData32Schema,
|
|
410
|
-
transactionIndex: exports.hexNumberSchema,
|
|
411
|
-
blockHash: hexData32Schema,
|
|
412
|
-
blockNumber: exports.hexNumberSchema,
|
|
413
|
-
from: addressSchema,
|
|
414
|
-
to: addressSchema.or(zod_1.z.null()),
|
|
415
|
-
cumulativeGasUsed: exports.hexNumberSchema,
|
|
416
|
-
gasUsed: exports.hexNumberSchema,
|
|
417
|
-
contractAddress: addressSchema.or(zod_1.z.null()),
|
|
418
|
-
logs: zod_1.z.array(logSchema),
|
|
419
|
-
logsBloom: zod_1.z.string().regex(/^0x[0-9a-f]{512}$/),
|
|
420
|
-
//root: hexData32Schema,
|
|
421
|
-
status: exports.hexNumberSchema.or(zod_1.z.null()),
|
|
422
|
-
effectiveGasPrice: exports.hexNumberSchema.nullish()
|
|
423
|
-
//type: hexNumberSchema
|
|
424
|
-
});
|
|
425
|
-
exports.receiptSchema = receiptSchema;
|
|
426
|
-
const userOperationReceiptSchema = zod_1.z
|
|
427
|
-
.object({
|
|
428
|
-
userOpHash: hexData32Schema,
|
|
429
|
-
entryPoint: addressSchema,
|
|
430
|
-
sender: addressSchema,
|
|
431
|
-
nonce: exports.hexNumberSchema,
|
|
432
|
-
paymaster: addressSchema.optional(),
|
|
433
|
-
actualGasCost: exports.hexNumberSchema,
|
|
434
|
-
actualGasUsed: exports.hexNumberSchema,
|
|
435
|
-
success: zod_1.z.boolean(),
|
|
436
|
-
reason: hexDataSchema.optional(), // revert reason
|
|
437
|
-
logs: zod_1.z.array(logSchema),
|
|
438
|
-
receipt: receiptSchema
|
|
439
|
-
})
|
|
440
|
-
.or(zod_1.z.null());
|
|
441
|
-
const getUserOperationReceiptResponseSchema = zod_1.z.object({
|
|
332
|
+
exports.getUserOperationReceiptSchema = zod_1.z.object({
|
|
442
333
|
method: zod_1.z.literal("eth_getUserOperationReceipt"),
|
|
334
|
+
params: zod_1.z.tuple([
|
|
335
|
+
zod_1.z
|
|
336
|
+
.string()
|
|
337
|
+
.regex(exports.hexData32Pattern, { message: "Missing/invalid userOpHash" })
|
|
338
|
+
.transform((val) => val)
|
|
339
|
+
]),
|
|
443
340
|
result: userOperationReceiptSchema
|
|
444
341
|
});
|
|
445
|
-
|
|
342
|
+
exports.debugClearStateSchema = zod_1.z.object({
|
|
446
343
|
method: zod_1.z.literal("debug_bundler_clearState"),
|
|
344
|
+
params: zod_1.z.tuple([]),
|
|
447
345
|
result: zod_1.z.literal("ok")
|
|
448
346
|
});
|
|
449
|
-
exports.
|
|
450
|
-
const bundlerClearMempoolResponseSchema = zod_1.z.object({
|
|
347
|
+
exports.debugClearMempoolSchema = zod_1.z.object({
|
|
451
348
|
method: zod_1.z.literal("debug_bundler_clearMempool"),
|
|
349
|
+
params: zod_1.z.tuple([]),
|
|
452
350
|
result: zod_1.z.literal("ok")
|
|
453
351
|
});
|
|
454
|
-
exports.
|
|
455
|
-
const bundlerDumpMempoolResponseSchema = zod_1.z.object({
|
|
352
|
+
exports.debugDumpMempoolSchema = zod_1.z.object({
|
|
456
353
|
method: zod_1.z.literal("debug_bundler_dumpMempool"),
|
|
354
|
+
params: zod_1.z.tuple([exports.addressSchema]),
|
|
457
355
|
result: zod_1.z.array(userOperationSchema)
|
|
458
356
|
});
|
|
459
|
-
exports.
|
|
460
|
-
const bundlerGetStakeStatusResponseSchema = zod_1.z.object({
|
|
461
|
-
method: zod_1.z.literal("debug_bundler_getStakeStatus"),
|
|
462
|
-
result: zod_1.z.object({
|
|
463
|
-
stakeInfo: zod_1.z.object({
|
|
464
|
-
addr: zod_1.z.string(),
|
|
465
|
-
stake: zod_1.z
|
|
466
|
-
.string()
|
|
467
|
-
.or(zod_1.z.number())
|
|
468
|
-
.or(zod_1.z.bigint())
|
|
469
|
-
.transform((val) => Number(val).toString()),
|
|
470
|
-
unstakeDelaySec: zod_1.z
|
|
471
|
-
.string()
|
|
472
|
-
.or(zod_1.z.number())
|
|
473
|
-
.or(zod_1.z.bigint())
|
|
474
|
-
.transform((val) => Number(val).toString())
|
|
475
|
-
}),
|
|
476
|
-
isStaked: zod_1.z.boolean()
|
|
477
|
-
})
|
|
478
|
-
});
|
|
479
|
-
exports.bundlerGetStakeStatusResponseSchema = bundlerGetStakeStatusResponseSchema;
|
|
480
|
-
const bundlerSendBundleNowResponseSchema = zod_1.z.object({
|
|
357
|
+
exports.debugSendBundleNowSchema = zod_1.z.object({
|
|
481
358
|
method: zod_1.z.literal("debug_bundler_sendBundleNow"),
|
|
359
|
+
params: zod_1.z.tuple([]),
|
|
482
360
|
result: zod_1.z.literal("ok")
|
|
483
361
|
});
|
|
484
|
-
exports.
|
|
485
|
-
const bundlerSetBundlingModeResponseSchema = zod_1.z.object({
|
|
362
|
+
exports.debugSetBundlingModeSchema = zod_1.z.object({
|
|
486
363
|
method: zod_1.z.literal("debug_bundler_setBundlingMode"),
|
|
364
|
+
params: zod_1.z.tuple([zod_1.z.enum(["manual", "auto"])]),
|
|
487
365
|
result: zod_1.z.literal("ok")
|
|
488
366
|
});
|
|
489
|
-
exports.
|
|
490
|
-
const bundlerSetReputationsResponseSchema = zod_1.z.object({
|
|
367
|
+
exports.debugSetReputationSchema = zod_1.z.object({
|
|
491
368
|
method: zod_1.z.literal("debug_bundler_setReputation"),
|
|
369
|
+
params: zod_1.z.tuple([
|
|
370
|
+
zod_1.z.array(zod_1.z.object({
|
|
371
|
+
address: exports.addressSchema,
|
|
372
|
+
opsSeen: exports.hexNumberSchema,
|
|
373
|
+
opsIncluded: exports.hexNumberSchema
|
|
374
|
+
})),
|
|
375
|
+
exports.addressSchema
|
|
376
|
+
]),
|
|
492
377
|
result: zod_1.z.literal("ok")
|
|
493
378
|
});
|
|
494
|
-
exports.
|
|
495
|
-
const bundlerDumpReputationsResponseSchema = zod_1.z.object({
|
|
379
|
+
exports.debugDumpReputationSchema = zod_1.z.object({
|
|
496
380
|
method: zod_1.z.literal("debug_bundler_dumpReputation"),
|
|
497
|
-
|
|
381
|
+
params: zod_1.z.tuple([exports.addressSchema]),
|
|
498
382
|
result: zod_1.z.array(zod_1.z.object({
|
|
499
|
-
address: addressSchema,
|
|
383
|
+
address: exports.addressSchema,
|
|
500
384
|
opsSeen: exports.hexNumberSchema,
|
|
501
385
|
opsIncluded: exports.hexNumberSchema,
|
|
502
386
|
status: exports.hexNumberSchema.optional()
|
|
503
387
|
}))
|
|
504
388
|
});
|
|
505
|
-
exports.
|
|
506
|
-
const bundlerClearReputationResponseSchema = zod_1.z.object({
|
|
389
|
+
exports.debugClearReputationSchema = zod_1.z.object({
|
|
507
390
|
method: zod_1.z.literal("debug_bundler_clearReputation"),
|
|
391
|
+
params: zod_1.z.tuple([]),
|
|
508
392
|
result: zod_1.z.literal("ok")
|
|
509
393
|
});
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
394
|
+
exports.debugGetStakeStatusSchema = zod_1.z.object({
|
|
395
|
+
method: zod_1.z.literal("debug_bundler_getStakeStatus"),
|
|
396
|
+
params: zod_1.z.tuple([exports.addressSchema, exports.addressSchema]),
|
|
397
|
+
result: zod_1.z.object({
|
|
398
|
+
stakeInfo: zod_1.z.object({
|
|
399
|
+
addr: zod_1.z.string(),
|
|
400
|
+
stake: zod_1.z
|
|
401
|
+
.string()
|
|
402
|
+
.or(zod_1.z.number())
|
|
403
|
+
.or(zod_1.z.bigint())
|
|
404
|
+
.transform((val) => Number(val).toString()),
|
|
405
|
+
unstakeDelaySec: zod_1.z
|
|
406
|
+
.string()
|
|
407
|
+
.or(zod_1.z.number())
|
|
408
|
+
.or(zod_1.z.bigint())
|
|
409
|
+
.transform((val) => Number(val).toString())
|
|
410
|
+
}),
|
|
411
|
+
isStaked: zod_1.z.boolean()
|
|
412
|
+
})
|
|
521
413
|
});
|
|
522
|
-
|
|
414
|
+
exports.pimlicoGetUserOperationStatusSchema = zod_1.z.object({
|
|
523
415
|
method: zod_1.z.literal("pimlico_getUserOperationStatus"),
|
|
416
|
+
params: zod_1.z.tuple([exports.hexData32Schema]),
|
|
524
417
|
result: userOperationStatus
|
|
525
418
|
});
|
|
526
|
-
exports.
|
|
527
|
-
const gasPriceSchema = zod_1.z.object({
|
|
528
|
-
slow: zod_1.z.object({
|
|
529
|
-
maxFeePerGas: zod_1.z.bigint(),
|
|
530
|
-
maxPriorityFeePerGas: zod_1.z.bigint()
|
|
531
|
-
}),
|
|
532
|
-
standard: zod_1.z.object({
|
|
533
|
-
maxFeePerGas: zod_1.z.bigint(),
|
|
534
|
-
maxPriorityFeePerGas: zod_1.z.bigint()
|
|
535
|
-
}),
|
|
536
|
-
fast: zod_1.z.object({
|
|
537
|
-
maxFeePerGas: zod_1.z.bigint(),
|
|
538
|
-
maxPriorityFeePerGas: zod_1.z.bigint()
|
|
539
|
-
})
|
|
540
|
-
});
|
|
541
|
-
const pimlicoGetUserOperationGasPriceResponseSchema = zod_1.z.object({
|
|
419
|
+
exports.pimlicoGetUserOperationGasPriceSchema = zod_1.z.object({
|
|
542
420
|
method: zod_1.z.literal("pimlico_getUserOperationGasPrice"),
|
|
421
|
+
params: zod_1.z.tuple([]),
|
|
543
422
|
result: gasPriceSchema
|
|
544
423
|
});
|
|
545
|
-
exports.
|
|
546
|
-
const pimlicoSendUserOperationNowResponseSchema = zod_1.z.object({
|
|
424
|
+
exports.pimlicoSendUserOperationNowSchema = zod_1.z.object({
|
|
547
425
|
method: zod_1.z.literal("pimlico_sendUserOperationNow"),
|
|
426
|
+
params: zod_1.z.tuple([userOperationSchema, exports.addressSchema]),
|
|
548
427
|
result: userOperationReceiptSchema
|
|
549
428
|
});
|
|
550
|
-
|
|
551
|
-
method: zod_1.z.literal("pimlico_experimental_sendUserOperation7702"),
|
|
552
|
-
result: hexData32Schema
|
|
553
|
-
});
|
|
554
|
-
const pimlicoExperimentalEstimateUserOperation7702ResponseSchema = zod_1.z.object({
|
|
429
|
+
exports.pimlicoExperimentalEstimateUserOperationGas7702Schema = zod_1.z.object({
|
|
555
430
|
method: zod_1.z.literal("pimlico_experimental_estimateUserOperationGas7702"),
|
|
431
|
+
params: zod_1.z.union([
|
|
432
|
+
zod_1.z.tuple([partialUserOperationSchema, exports.addressSchema]),
|
|
433
|
+
zod_1.z.tuple([
|
|
434
|
+
partialUserOperationSchema,
|
|
435
|
+
exports.addressSchema,
|
|
436
|
+
exports.stateOverridesSchema
|
|
437
|
+
])
|
|
438
|
+
]),
|
|
556
439
|
result: zod_1.z.union([
|
|
557
440
|
zod_1.z.object({
|
|
558
441
|
callGasLimit: exports.hexNumberSchema,
|
|
@@ -569,29 +452,59 @@ const pimlicoExperimentalEstimateUserOperation7702ResponseSchema = zod_1.z.objec
|
|
|
569
452
|
})
|
|
570
453
|
])
|
|
571
454
|
});
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
455
|
+
exports.pimlicoExperimentalSendUserOperation7702Schema = zod_1.z.object({
|
|
456
|
+
method: zod_1.z.literal("pimlico_experimental_sendUserOperation7702"),
|
|
457
|
+
params: zod_1.z.tuple([userOperationSchema, exports.addressSchema]),
|
|
458
|
+
result: exports.hexData32Schema
|
|
459
|
+
});
|
|
460
|
+
exports.altoVersions = zod_1.z.enum(["v1", "v2"]);
|
|
461
|
+
// Create request and response discriminated unions from the combined schemas
|
|
462
|
+
exports.bundlerRequestSchema = zod_1.z.discriminatedUnion("method", [
|
|
463
|
+
exports.chainIdSchema.omit({ result: true }),
|
|
464
|
+
exports.supportedEntryPointsSchema.omit({ result: true }),
|
|
465
|
+
exports.estimateUserOperationGasSchema.omit({ result: true }),
|
|
466
|
+
exports.sendUserOperationSchema.omit({ result: true }),
|
|
467
|
+
exports.getUserOperationByHashSchema.omit({ result: true }),
|
|
468
|
+
exports.getUserOperationReceiptSchema.omit({ result: true }),
|
|
469
|
+
exports.debugClearStateSchema.omit({ result: true }),
|
|
470
|
+
exports.debugClearMempoolSchema.omit({ result: true }),
|
|
471
|
+
exports.debugDumpMempoolSchema.omit({ result: true }),
|
|
472
|
+
exports.debugSendBundleNowSchema.omit({ result: true }),
|
|
473
|
+
exports.debugSetBundlingModeSchema.omit({ result: true }),
|
|
474
|
+
exports.debugSetReputationSchema.omit({ result: true }),
|
|
475
|
+
exports.debugDumpReputationSchema.omit({ result: true }),
|
|
476
|
+
exports.debugClearReputationSchema.omit({ result: true }),
|
|
477
|
+
exports.debugGetStakeStatusSchema.omit({ result: true }),
|
|
478
|
+
exports.pimlicoGetUserOperationStatusSchema.omit({ result: true }),
|
|
479
|
+
exports.pimlicoGetUserOperationGasPriceSchema.omit({ result: true }),
|
|
480
|
+
exports.pimlicoSendUserOperationNowSchema.omit({ result: true }),
|
|
481
|
+
exports.pimlicoExperimentalSendUserOperation7702Schema.omit({ result: true }),
|
|
482
|
+
exports.pimlicoExperimentalEstimateUserOperationGas7702Schema.omit({
|
|
483
|
+
result: true
|
|
484
|
+
})
|
|
485
|
+
]);
|
|
486
|
+
exports.bundlerRpcSchema = zod_1.z.union([
|
|
487
|
+
exports.chainIdSchema,
|
|
488
|
+
exports.supportedEntryPointsSchema,
|
|
489
|
+
exports.estimateUserOperationGasSchema,
|
|
490
|
+
exports.sendUserOperationSchema,
|
|
491
|
+
exports.getUserOperationByHashSchema,
|
|
492
|
+
exports.getUserOperationReceiptSchema,
|
|
493
|
+
exports.debugClearStateSchema,
|
|
494
|
+
exports.debugClearMempoolSchema,
|
|
495
|
+
exports.debugDumpMempoolSchema,
|
|
496
|
+
exports.debugSendBundleNowSchema,
|
|
497
|
+
exports.debugSetBundlingModeSchema,
|
|
498
|
+
exports.debugSetReputationSchema,
|
|
499
|
+
exports.debugDumpReputationSchema,
|
|
500
|
+
exports.debugClearReputationSchema,
|
|
501
|
+
exports.debugGetStakeStatusSchema,
|
|
502
|
+
exports.pimlicoGetUserOperationStatusSchema,
|
|
503
|
+
exports.pimlicoGetUserOperationGasPriceSchema,
|
|
504
|
+
exports.pimlicoSendUserOperationNowSchema,
|
|
505
|
+
exports.pimlicoExperimentalSendUserOperation7702Schema,
|
|
506
|
+
exports.pimlicoExperimentalEstimateUserOperationGas7702Schema
|
|
593
507
|
]);
|
|
594
|
-
exports.bundlerResponseSchema = bundlerResponseSchema;
|
|
595
508
|
const OpEventType = zod_1.z.union([
|
|
596
509
|
zod_1.z.object({
|
|
597
510
|
eventType: zod_1.z.literal("received")
|
|
@@ -618,25 +531,25 @@ const OpEventType = zod_1.z.union([
|
|
|
618
531
|
}),
|
|
619
532
|
zod_1.z.object({
|
|
620
533
|
eventType: zod_1.z.literal("submitted"),
|
|
621
|
-
transactionHash: hexData32Schema
|
|
534
|
+
transactionHash: exports.hexData32Schema
|
|
622
535
|
}),
|
|
623
536
|
zod_1.z.object({
|
|
624
537
|
eventType: zod_1.z.literal("included_onchain"),
|
|
625
|
-
transactionHash: hexData32Schema,
|
|
538
|
+
transactionHash: exports.hexData32Schema,
|
|
626
539
|
data: zod_1.z.object({
|
|
627
540
|
blockNumber: zod_1.z.number()
|
|
628
541
|
})
|
|
629
542
|
}),
|
|
630
543
|
zod_1.z.object({
|
|
631
544
|
eventType: zod_1.z.literal("frontran_onchain"),
|
|
632
|
-
transactionHash: hexData32Schema,
|
|
545
|
+
transactionHash: exports.hexData32Schema,
|
|
633
546
|
data: zod_1.z.object({
|
|
634
547
|
blockNumber: zod_1.z.number()
|
|
635
548
|
})
|
|
636
549
|
}),
|
|
637
550
|
zod_1.z.object({
|
|
638
551
|
eventType: zod_1.z.literal("failed_onchain"),
|
|
639
|
-
transactionHash: hexData32Schema,
|
|
552
|
+
transactionHash: exports.hexData32Schema,
|
|
640
553
|
data: zod_1.z.object({
|
|
641
554
|
blockNumber: zod_1.z.number(),
|
|
642
555
|
reason: zod_1.z.string().optional(),
|
|
@@ -645,7 +558,7 @@ const OpEventType = zod_1.z.union([
|
|
|
645
558
|
}),
|
|
646
559
|
zod_1.z.object({
|
|
647
560
|
eventType: zod_1.z.literal("execution_reverted_onchain"),
|
|
648
|
-
transactionHash: hexData32Schema,
|
|
561
|
+
transactionHash: exports.hexData32Schema,
|
|
649
562
|
data: zod_1.z.object({
|
|
650
563
|
blockNumber: zod_1.z.number(),
|
|
651
564
|
reason: zod_1.z.string().optional()
|