@pimlico/alto 0.0.0-main.20250214T163421 → 0.0.0-main.20250225T152738
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/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 +33 -372
- 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/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/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 +30 -369
- 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/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/esm/types/schemas.js
CHANGED
|
@@ -4,7 +4,7 @@ const hexDataPattern = /^0x[0-9A-Fa-f]*$/;
|
|
|
4
4
|
const addressPattern = /^0x[0-9,a-f,A-F]{40}$/;
|
|
5
5
|
export const hexData32Pattern = /^0x([0-9a-fA-F][0-9a-fA-F]){32}$/;
|
|
6
6
|
export const commaSeperatedAddressPattern = /^(0x[0-9a-fA-F]{40})(,\s*(0x[0-9a-fA-F]{40}))*$/;
|
|
7
|
-
const addressSchema = z
|
|
7
|
+
export const addressSchema = z
|
|
8
8
|
.string()
|
|
9
9
|
.regex(addressPattern, { message: "not a valid hex address" })
|
|
10
10
|
.transform((val) => getAddress(val));
|
|
@@ -17,14 +17,21 @@ export const hexNumberSchema = z
|
|
|
17
17
|
.refine((val) => val <= maxUint256, {
|
|
18
18
|
message: "not a valid uint256"
|
|
19
19
|
});
|
|
20
|
-
const hexDataSchema = z
|
|
20
|
+
export const hexDataSchema = z
|
|
21
21
|
.string()
|
|
22
22
|
.regex(hexDataPattern, { message: "not valid hex data" })
|
|
23
23
|
.transform((val) => val);
|
|
24
|
-
const hexData32Schema = z
|
|
24
|
+
export const hexData32Schema = z
|
|
25
25
|
.string()
|
|
26
26
|
.regex(hexData32Pattern, { message: "not valid 32-byte hex data" })
|
|
27
27
|
.transform((val) => val);
|
|
28
|
+
export const stateOverridesSchema = z.record(addressSchema, z.object({
|
|
29
|
+
balance: hexNumberSchema.optional(),
|
|
30
|
+
nonce: hexNumberSchema.optional(),
|
|
31
|
+
code: hexDataSchema.optional(),
|
|
32
|
+
state: z.record(hexData32Schema, hexData32Schema).optional(),
|
|
33
|
+
stateDiff: z.record(hexData32Schema, hexData32Schema).optional()
|
|
34
|
+
}));
|
|
28
35
|
const signedAuthorizationSchema = z.object({
|
|
29
36
|
contractAddress: addressSchema,
|
|
30
37
|
chainId: hexNumberSchema.transform((val) => Number(val)),
|
|
@@ -172,7 +179,7 @@ const userOperationSchema = z.union([
|
|
|
172
179
|
userOperationV06Schema,
|
|
173
180
|
userOperationV07Schema
|
|
174
181
|
]);
|
|
175
|
-
const jsonRpcSchema = z
|
|
182
|
+
export const jsonRpcSchema = z
|
|
176
183
|
.object({
|
|
177
184
|
jsonrpc: z.literal("2.0"),
|
|
178
185
|
id: z.number(),
|
|
@@ -190,111 +197,88 @@ const jsonRpcResultSchema = z
|
|
|
190
197
|
result: z.unknown()
|
|
191
198
|
})
|
|
192
199
|
.strict();
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
nonce: hexNumberSchema.optional(),
|
|
204
|
-
code: hexDataSchema.optional(),
|
|
205
|
-
state: z.record(hexData32Schema, hexData32Schema).optional(),
|
|
206
|
-
stateDiff: z.record(hexData32Schema, hexData32Schema).optional()
|
|
207
|
-
}));
|
|
208
|
-
const estimateUserOperationGasRequestSchema = z.object({
|
|
209
|
-
method: z.literal("eth_estimateUserOperationGas"),
|
|
210
|
-
params: z.union([
|
|
211
|
-
z.tuple([partialUserOperationSchema, addressSchema]),
|
|
212
|
-
z.tuple([
|
|
213
|
-
partialUserOperationSchema,
|
|
214
|
-
addressSchema,
|
|
215
|
-
stateOverridesSchema
|
|
216
|
-
])
|
|
217
|
-
])
|
|
218
|
-
});
|
|
219
|
-
const sendUserOperationRequestSchema = z.object({
|
|
220
|
-
method: z.literal("eth_sendUserOperation"),
|
|
221
|
-
params: z.tuple([userOperationSchema, addressSchema])
|
|
222
|
-
});
|
|
223
|
-
const getUserOperationByHashRequestSchema = z.object({
|
|
224
|
-
method: z.literal("eth_getUserOperationByHash"),
|
|
225
|
-
params: z.tuple([
|
|
226
|
-
z
|
|
227
|
-
.string()
|
|
228
|
-
.regex(hexData32Pattern, { message: "Missing/invalid userOpHash" })
|
|
229
|
-
.transform((val) => val)
|
|
230
|
-
])
|
|
231
|
-
});
|
|
232
|
-
const getUserOperationReceiptRequestSchema = z.object({
|
|
233
|
-
method: z.literal("eth_getUserOperationReceipt"),
|
|
234
|
-
params: z.tuple([
|
|
235
|
-
z
|
|
236
|
-
.string()
|
|
237
|
-
.regex(hexData32Pattern, { message: "Missing/invalid userOpHash" })
|
|
238
|
-
.transform((val) => val)
|
|
239
|
-
])
|
|
240
|
-
});
|
|
241
|
-
const bundlerClearStateRequestSchema = z.object({
|
|
242
|
-
method: z.literal("debug_bundler_clearState"),
|
|
243
|
-
params: z.tuple([])
|
|
244
|
-
});
|
|
245
|
-
const bundlerClearMempoolRequestSchema = z.object({
|
|
246
|
-
method: z.literal("debug_bundler_clearMempool"),
|
|
247
|
-
params: z.tuple([])
|
|
248
|
-
});
|
|
249
|
-
const bundlerDumpMempoolRequestSchema = z.object({
|
|
250
|
-
method: z.literal("debug_bundler_dumpMempool"),
|
|
251
|
-
params: z.tuple([addressSchema])
|
|
252
|
-
});
|
|
253
|
-
const bundlerSendBundleNowRequestSchema = z.object({
|
|
254
|
-
method: z.literal("debug_bundler_sendBundleNow"),
|
|
255
|
-
params: z.tuple([])
|
|
256
|
-
});
|
|
257
|
-
const bundlerSetBundlingModeRequestSchema = z.object({
|
|
258
|
-
method: z.literal("debug_bundler_setBundlingMode"),
|
|
259
|
-
params: z.tuple([z.enum(["manual", "auto"])])
|
|
260
|
-
});
|
|
261
|
-
const bundlerSetReputationsRequestSchema = z.object({
|
|
262
|
-
method: z.literal("debug_bundler_setReputation"),
|
|
263
|
-
params: z.tuple([
|
|
264
|
-
z.array(z.object({
|
|
265
|
-
address: addressSchema,
|
|
266
|
-
opsSeen: hexNumberSchema,
|
|
267
|
-
opsIncluded: hexNumberSchema
|
|
268
|
-
})),
|
|
269
|
-
addressSchema
|
|
270
|
-
])
|
|
271
|
-
});
|
|
272
|
-
const bundlerDumpReputationsRequestSchema = z.object({
|
|
273
|
-
method: z.literal("debug_bundler_dumpReputation"),
|
|
274
|
-
params: z.tuple([addressSchema])
|
|
200
|
+
export const logSchema = z.object({
|
|
201
|
+
//removed: z.boolean().optional(),
|
|
202
|
+
logIndex: hexNumberSchema,
|
|
203
|
+
transactionIndex: hexNumberSchema,
|
|
204
|
+
transactionHash: hexData32Schema,
|
|
205
|
+
blockHash: hexData32Schema,
|
|
206
|
+
blockNumber: hexNumberSchema,
|
|
207
|
+
address: addressSchema,
|
|
208
|
+
data: hexDataSchema,
|
|
209
|
+
topics: z.array(hexData32Schema)
|
|
275
210
|
});
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
|
|
211
|
+
export const receiptSchema = z.object({
|
|
212
|
+
transactionHash: hexData32Schema,
|
|
213
|
+
transactionIndex: hexNumberSchema,
|
|
214
|
+
blockHash: hexData32Schema,
|
|
215
|
+
blockNumber: hexNumberSchema,
|
|
216
|
+
from: addressSchema,
|
|
217
|
+
to: addressSchema.or(z.null()),
|
|
218
|
+
cumulativeGasUsed: hexNumberSchema,
|
|
219
|
+
gasUsed: hexNumberSchema,
|
|
220
|
+
contractAddress: addressSchema.or(z.null()),
|
|
221
|
+
logs: z.array(logSchema),
|
|
222
|
+
logsBloom: z.string().regex(/^0x[0-9a-f]{512}$/),
|
|
223
|
+
//root: hexData32Schema,
|
|
224
|
+
status: hexNumberSchema.or(z.null()),
|
|
225
|
+
effectiveGasPrice: hexNumberSchema.nullish()
|
|
226
|
+
//type: hexNumberSchema
|
|
279
227
|
});
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
|
|
228
|
+
const userOperationReceiptSchema = z
|
|
229
|
+
.object({
|
|
230
|
+
userOpHash: hexData32Schema,
|
|
231
|
+
entryPoint: addressSchema,
|
|
232
|
+
sender: addressSchema,
|
|
233
|
+
nonce: hexNumberSchema,
|
|
234
|
+
paymaster: addressSchema.optional(),
|
|
235
|
+
actualGasCost: hexNumberSchema,
|
|
236
|
+
actualGasUsed: hexNumberSchema,
|
|
237
|
+
success: z.boolean(),
|
|
238
|
+
reason: hexDataSchema.optional(), // revert reason
|
|
239
|
+
logs: z.array(logSchema),
|
|
240
|
+
receipt: receiptSchema
|
|
241
|
+
})
|
|
242
|
+
.or(z.null());
|
|
243
|
+
const userOperationStatus = z.object({
|
|
244
|
+
status: z.enum([
|
|
245
|
+
"not_found",
|
|
246
|
+
"not_submitted",
|
|
247
|
+
"submitted",
|
|
248
|
+
"rejected",
|
|
249
|
+
"reverted",
|
|
250
|
+
"included",
|
|
251
|
+
"failed"
|
|
252
|
+
]),
|
|
253
|
+
transactionHash: hexData32Schema.or(z.null())
|
|
283
254
|
});
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
|
|
255
|
+
const gasPriceSchema = z.object({
|
|
256
|
+
slow: z.object({
|
|
257
|
+
maxFeePerGas: z.bigint(),
|
|
258
|
+
maxPriorityFeePerGas: z.bigint()
|
|
259
|
+
}),
|
|
260
|
+
standard: z.object({
|
|
261
|
+
maxFeePerGas: z.bigint(),
|
|
262
|
+
maxPriorityFeePerGas: z.bigint()
|
|
263
|
+
}),
|
|
264
|
+
fast: z.object({
|
|
265
|
+
maxFeePerGas: z.bigint(),
|
|
266
|
+
maxPriorityFeePerGas: z.bigint()
|
|
267
|
+
})
|
|
287
268
|
});
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
269
|
+
// Combined schemas (request + response)
|
|
270
|
+
export const chainIdSchema = z.object({
|
|
271
|
+
method: z.literal("eth_chainId"),
|
|
272
|
+
params: z.tuple([]),
|
|
273
|
+
result: hexNumberSchema
|
|
291
274
|
});
|
|
292
|
-
const
|
|
293
|
-
method: z.literal("
|
|
294
|
-
params: z.tuple([
|
|
275
|
+
export const supportedEntryPointsSchema = z.object({
|
|
276
|
+
method: z.literal("eth_supportedEntryPoints"),
|
|
277
|
+
params: z.tuple([]),
|
|
278
|
+
result: z.array(addressSchema)
|
|
295
279
|
});
|
|
296
|
-
const
|
|
297
|
-
method: z.literal("
|
|
280
|
+
export const estimateUserOperationGasSchema = z.object({
|
|
281
|
+
method: z.literal("eth_estimateUserOperationGas"),
|
|
298
282
|
params: z.union([
|
|
299
283
|
z.tuple([partialUserOperationSchema, addressSchema]),
|
|
300
284
|
z.tuple([
|
|
@@ -302,45 +286,7 @@ const pimlicoExperimentalEstimateUserOperationGas7702RequestSchema = z.object({
|
|
|
302
286
|
addressSchema,
|
|
303
287
|
stateOverridesSchema
|
|
304
288
|
])
|
|
305
|
-
])
|
|
306
|
-
});
|
|
307
|
-
const pimlicoExperimentalSendUserOperation7702RequestSchema = z.object({
|
|
308
|
-
method: z.literal("pimlico_experimental_sendUserOperation7702"),
|
|
309
|
-
params: z.tuple([userOperationSchema, addressSchema])
|
|
310
|
-
});
|
|
311
|
-
export const altoVersions = z.enum(["v1", "v2"]);
|
|
312
|
-
const bundlerRequestSchema = z.discriminatedUnion("method", [
|
|
313
|
-
chainIdRequestSchema,
|
|
314
|
-
supportedEntryPointsRequestSchema,
|
|
315
|
-
estimateUserOperationGasRequestSchema,
|
|
316
|
-
sendUserOperationRequestSchema,
|
|
317
|
-
getUserOperationByHashRequestSchema,
|
|
318
|
-
getUserOperationReceiptRequestSchema,
|
|
319
|
-
bundlerClearStateRequestSchema,
|
|
320
|
-
bundlerClearMempoolRequestSchema,
|
|
321
|
-
bundlerDumpMempoolRequestSchema,
|
|
322
|
-
bundlerSendBundleNowRequestSchema,
|
|
323
|
-
bundlerSetBundlingModeRequestSchema,
|
|
324
|
-
bundlerSetReputationsRequestSchema,
|
|
325
|
-
bundlerDumpReputationsRequestSchema,
|
|
326
|
-
bundlerClearReputationRequestSchema,
|
|
327
|
-
pimlicoGetStakeStatusRequestSchema,
|
|
328
|
-
pimlicoGetUserOperationStatusRequestSchema,
|
|
329
|
-
pimlicoGetUserOperationGasPriceRequestSchema,
|
|
330
|
-
pimlicoSendUserOperationNowRequestSchema,
|
|
331
|
-
pimlicoExperimentalSendUserOperation7702RequestSchema,
|
|
332
|
-
pimlicoExperimentalEstimateUserOperationGas7702RequestSchema
|
|
333
|
-
]);
|
|
334
|
-
const chainIdResponseSchema = z.object({
|
|
335
|
-
method: z.literal("eth_chainId"),
|
|
336
|
-
result: hexNumberSchema
|
|
337
|
-
});
|
|
338
|
-
const supportedEntryPointsResponseSchema = z.object({
|
|
339
|
-
method: z.literal("eth_supportedEntryPoints"),
|
|
340
|
-
result: z.array(addressSchema)
|
|
341
|
-
});
|
|
342
|
-
const estimateUserOperationGasResponseSchema = z.object({
|
|
343
|
-
method: z.literal("eth_estimateUserOperationGas"),
|
|
289
|
+
]),
|
|
344
290
|
result: z.union([
|
|
345
291
|
z.object({
|
|
346
292
|
callGasLimit: hexNumberSchema,
|
|
@@ -357,12 +303,19 @@ const estimateUserOperationGasResponseSchema = z.object({
|
|
|
357
303
|
})
|
|
358
304
|
])
|
|
359
305
|
});
|
|
360
|
-
const
|
|
306
|
+
export const sendUserOperationSchema = z.object({
|
|
361
307
|
method: z.literal("eth_sendUserOperation"),
|
|
308
|
+
params: z.tuple([userOperationSchema, addressSchema]),
|
|
362
309
|
result: hexData32Schema
|
|
363
310
|
});
|
|
364
|
-
const
|
|
311
|
+
export const getUserOperationByHashSchema = z.object({
|
|
365
312
|
method: z.literal("eth_getUserOperationByHash"),
|
|
313
|
+
params: z.tuple([
|
|
314
|
+
z
|
|
315
|
+
.string()
|
|
316
|
+
.regex(hexData32Pattern, { message: "Missing/invalid userOpHash" })
|
|
317
|
+
.transform((val) => val)
|
|
318
|
+
]),
|
|
366
319
|
result: z
|
|
367
320
|
.object({
|
|
368
321
|
userOperation: userOperationSchema,
|
|
@@ -373,99 +326,56 @@ const getUserOperationByHashResponseSchema = z.object({
|
|
|
373
326
|
})
|
|
374
327
|
.or(z.null())
|
|
375
328
|
});
|
|
376
|
-
const
|
|
377
|
-
//removed: z.boolean().optional(),
|
|
378
|
-
logIndex: hexNumberSchema,
|
|
379
|
-
transactionIndex: hexNumberSchema,
|
|
380
|
-
transactionHash: hexData32Schema,
|
|
381
|
-
blockHash: hexData32Schema,
|
|
382
|
-
blockNumber: hexNumberSchema,
|
|
383
|
-
address: addressSchema,
|
|
384
|
-
data: hexDataSchema,
|
|
385
|
-
topics: z.array(hexData32Schema)
|
|
386
|
-
});
|
|
387
|
-
const receiptSchema = z.object({
|
|
388
|
-
transactionHash: hexData32Schema,
|
|
389
|
-
transactionIndex: hexNumberSchema,
|
|
390
|
-
blockHash: hexData32Schema,
|
|
391
|
-
blockNumber: hexNumberSchema,
|
|
392
|
-
from: addressSchema,
|
|
393
|
-
to: addressSchema.or(z.null()),
|
|
394
|
-
cumulativeGasUsed: hexNumberSchema,
|
|
395
|
-
gasUsed: hexNumberSchema,
|
|
396
|
-
contractAddress: addressSchema.or(z.null()),
|
|
397
|
-
logs: z.array(logSchema),
|
|
398
|
-
logsBloom: z.string().regex(/^0x[0-9a-f]{512}$/),
|
|
399
|
-
//root: hexData32Schema,
|
|
400
|
-
status: hexNumberSchema.or(z.null()),
|
|
401
|
-
effectiveGasPrice: hexNumberSchema.nullish()
|
|
402
|
-
//type: hexNumberSchema
|
|
403
|
-
});
|
|
404
|
-
const userOperationReceiptSchema = z
|
|
405
|
-
.object({
|
|
406
|
-
userOpHash: hexData32Schema,
|
|
407
|
-
entryPoint: addressSchema,
|
|
408
|
-
sender: addressSchema,
|
|
409
|
-
nonce: hexNumberSchema,
|
|
410
|
-
paymaster: addressSchema.optional(),
|
|
411
|
-
actualGasCost: hexNumberSchema,
|
|
412
|
-
actualGasUsed: hexNumberSchema,
|
|
413
|
-
success: z.boolean(),
|
|
414
|
-
reason: hexDataSchema.optional(), // revert reason
|
|
415
|
-
logs: z.array(logSchema),
|
|
416
|
-
receipt: receiptSchema
|
|
417
|
-
})
|
|
418
|
-
.or(z.null());
|
|
419
|
-
const getUserOperationReceiptResponseSchema = z.object({
|
|
329
|
+
export const getUserOperationReceiptSchema = z.object({
|
|
420
330
|
method: z.literal("eth_getUserOperationReceipt"),
|
|
331
|
+
params: z.tuple([
|
|
332
|
+
z
|
|
333
|
+
.string()
|
|
334
|
+
.regex(hexData32Pattern, { message: "Missing/invalid userOpHash" })
|
|
335
|
+
.transform((val) => val)
|
|
336
|
+
]),
|
|
421
337
|
result: userOperationReceiptSchema
|
|
422
338
|
});
|
|
423
|
-
const
|
|
339
|
+
export const debugClearStateSchema = z.object({
|
|
424
340
|
method: z.literal("debug_bundler_clearState"),
|
|
341
|
+
params: z.tuple([]),
|
|
425
342
|
result: z.literal("ok")
|
|
426
343
|
});
|
|
427
|
-
const
|
|
344
|
+
export const debugClearMempoolSchema = z.object({
|
|
428
345
|
method: z.literal("debug_bundler_clearMempool"),
|
|
346
|
+
params: z.tuple([]),
|
|
429
347
|
result: z.literal("ok")
|
|
430
348
|
});
|
|
431
|
-
const
|
|
349
|
+
export const debugDumpMempoolSchema = z.object({
|
|
432
350
|
method: z.literal("debug_bundler_dumpMempool"),
|
|
351
|
+
params: z.tuple([addressSchema]),
|
|
433
352
|
result: z.array(userOperationSchema)
|
|
434
353
|
});
|
|
435
|
-
const
|
|
436
|
-
method: z.literal("debug_bundler_getStakeStatus"),
|
|
437
|
-
result: z.object({
|
|
438
|
-
stakeInfo: z.object({
|
|
439
|
-
addr: z.string(),
|
|
440
|
-
stake: z
|
|
441
|
-
.string()
|
|
442
|
-
.or(z.number())
|
|
443
|
-
.or(z.bigint())
|
|
444
|
-
.transform((val) => Number(val).toString()),
|
|
445
|
-
unstakeDelaySec: z
|
|
446
|
-
.string()
|
|
447
|
-
.or(z.number())
|
|
448
|
-
.or(z.bigint())
|
|
449
|
-
.transform((val) => Number(val).toString())
|
|
450
|
-
}),
|
|
451
|
-
isStaked: z.boolean()
|
|
452
|
-
})
|
|
453
|
-
});
|
|
454
|
-
const bundlerSendBundleNowResponseSchema = z.object({
|
|
354
|
+
export const debugSendBundleNowSchema = z.object({
|
|
455
355
|
method: z.literal("debug_bundler_sendBundleNow"),
|
|
356
|
+
params: z.tuple([]),
|
|
456
357
|
result: z.literal("ok")
|
|
457
358
|
});
|
|
458
|
-
const
|
|
359
|
+
export const debugSetBundlingModeSchema = z.object({
|
|
459
360
|
method: z.literal("debug_bundler_setBundlingMode"),
|
|
361
|
+
params: z.tuple([z.enum(["manual", "auto"])]),
|
|
460
362
|
result: z.literal("ok")
|
|
461
363
|
});
|
|
462
|
-
const
|
|
364
|
+
export const debugSetReputationSchema = z.object({
|
|
463
365
|
method: z.literal("debug_bundler_setReputation"),
|
|
366
|
+
params: z.tuple([
|
|
367
|
+
z.array(z.object({
|
|
368
|
+
address: addressSchema,
|
|
369
|
+
opsSeen: hexNumberSchema,
|
|
370
|
+
opsIncluded: hexNumberSchema
|
|
371
|
+
})),
|
|
372
|
+
addressSchema
|
|
373
|
+
]),
|
|
464
374
|
result: z.literal("ok")
|
|
465
375
|
});
|
|
466
|
-
const
|
|
376
|
+
export const debugDumpReputationSchema = z.object({
|
|
467
377
|
method: z.literal("debug_bundler_dumpReputation"),
|
|
468
|
-
|
|
378
|
+
params: z.tuple([addressSchema]),
|
|
469
379
|
result: z.array(z.object({
|
|
470
380
|
address: addressSchema,
|
|
471
381
|
opsSeen: hexNumberSchema,
|
|
@@ -473,54 +383,56 @@ const bundlerDumpReputationsResponseSchema = z.object({
|
|
|
473
383
|
status: hexNumberSchema.optional()
|
|
474
384
|
}))
|
|
475
385
|
});
|
|
476
|
-
const
|
|
386
|
+
export const debugClearReputationSchema = z.object({
|
|
477
387
|
method: z.literal("debug_bundler_clearReputation"),
|
|
388
|
+
params: z.tuple([]),
|
|
478
389
|
result: z.literal("ok")
|
|
479
390
|
});
|
|
480
|
-
const
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
391
|
+
export const debugGetStakeStatusSchema = z.object({
|
|
392
|
+
method: z.literal("debug_bundler_getStakeStatus"),
|
|
393
|
+
params: z.tuple([addressSchema, addressSchema]),
|
|
394
|
+
result: z.object({
|
|
395
|
+
stakeInfo: z.object({
|
|
396
|
+
addr: z.string(),
|
|
397
|
+
stake: z
|
|
398
|
+
.string()
|
|
399
|
+
.or(z.number())
|
|
400
|
+
.or(z.bigint())
|
|
401
|
+
.transform((val) => Number(val).toString()),
|
|
402
|
+
unstakeDelaySec: z
|
|
403
|
+
.string()
|
|
404
|
+
.or(z.number())
|
|
405
|
+
.or(z.bigint())
|
|
406
|
+
.transform((val) => Number(val).toString())
|
|
407
|
+
}),
|
|
408
|
+
isStaked: z.boolean()
|
|
409
|
+
})
|
|
491
410
|
});
|
|
492
|
-
const
|
|
411
|
+
export const pimlicoGetUserOperationStatusSchema = z.object({
|
|
493
412
|
method: z.literal("pimlico_getUserOperationStatus"),
|
|
413
|
+
params: z.tuple([hexData32Schema]),
|
|
494
414
|
result: userOperationStatus
|
|
495
415
|
});
|
|
496
|
-
const
|
|
497
|
-
slow: z.object({
|
|
498
|
-
maxFeePerGas: z.bigint(),
|
|
499
|
-
maxPriorityFeePerGas: z.bigint()
|
|
500
|
-
}),
|
|
501
|
-
standard: z.object({
|
|
502
|
-
maxFeePerGas: z.bigint(),
|
|
503
|
-
maxPriorityFeePerGas: z.bigint()
|
|
504
|
-
}),
|
|
505
|
-
fast: z.object({
|
|
506
|
-
maxFeePerGas: z.bigint(),
|
|
507
|
-
maxPriorityFeePerGas: z.bigint()
|
|
508
|
-
})
|
|
509
|
-
});
|
|
510
|
-
const pimlicoGetUserOperationGasPriceResponseSchema = z.object({
|
|
416
|
+
export const pimlicoGetUserOperationGasPriceSchema = z.object({
|
|
511
417
|
method: z.literal("pimlico_getUserOperationGasPrice"),
|
|
418
|
+
params: z.tuple([]),
|
|
512
419
|
result: gasPriceSchema
|
|
513
420
|
});
|
|
514
|
-
const
|
|
421
|
+
export const pimlicoSendUserOperationNowSchema = z.object({
|
|
515
422
|
method: z.literal("pimlico_sendUserOperationNow"),
|
|
423
|
+
params: z.tuple([userOperationSchema, addressSchema]),
|
|
516
424
|
result: userOperationReceiptSchema
|
|
517
425
|
});
|
|
518
|
-
const
|
|
519
|
-
method: z.literal("pimlico_experimental_sendUserOperation7702"),
|
|
520
|
-
result: hexData32Schema
|
|
521
|
-
});
|
|
522
|
-
const pimlicoExperimentalEstimateUserOperation7702ResponseSchema = z.object({
|
|
426
|
+
export const pimlicoExperimentalEstimateUserOperationGas7702Schema = z.object({
|
|
523
427
|
method: z.literal("pimlico_experimental_estimateUserOperationGas7702"),
|
|
428
|
+
params: z.union([
|
|
429
|
+
z.tuple([partialUserOperationSchema, addressSchema]),
|
|
430
|
+
z.tuple([
|
|
431
|
+
partialUserOperationSchema,
|
|
432
|
+
addressSchema,
|
|
433
|
+
stateOverridesSchema
|
|
434
|
+
])
|
|
435
|
+
]),
|
|
524
436
|
result: z.union([
|
|
525
437
|
z.object({
|
|
526
438
|
callGasLimit: hexNumberSchema,
|
|
@@ -537,27 +449,58 @@ const pimlicoExperimentalEstimateUserOperation7702ResponseSchema = z.object({
|
|
|
537
449
|
})
|
|
538
450
|
])
|
|
539
451
|
});
|
|
540
|
-
const
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
452
|
+
export const pimlicoExperimentalSendUserOperation7702Schema = z.object({
|
|
453
|
+
method: z.literal("pimlico_experimental_sendUserOperation7702"),
|
|
454
|
+
params: z.tuple([userOperationSchema, addressSchema]),
|
|
455
|
+
result: hexData32Schema
|
|
456
|
+
});
|
|
457
|
+
export const altoVersions = z.enum(["v1", "v2"]);
|
|
458
|
+
// Create request and response discriminated unions from the combined schemas
|
|
459
|
+
export const bundlerRequestSchema = z.discriminatedUnion("method", [
|
|
460
|
+
chainIdSchema.omit({ result: true }),
|
|
461
|
+
supportedEntryPointsSchema.omit({ result: true }),
|
|
462
|
+
estimateUserOperationGasSchema.omit({ result: true }),
|
|
463
|
+
sendUserOperationSchema.omit({ result: true }),
|
|
464
|
+
getUserOperationByHashSchema.omit({ result: true }),
|
|
465
|
+
getUserOperationReceiptSchema.omit({ result: true }),
|
|
466
|
+
debugClearStateSchema.omit({ result: true }),
|
|
467
|
+
debugClearMempoolSchema.omit({ result: true }),
|
|
468
|
+
debugDumpMempoolSchema.omit({ result: true }),
|
|
469
|
+
debugSendBundleNowSchema.omit({ result: true }),
|
|
470
|
+
debugSetBundlingModeSchema.omit({ result: true }),
|
|
471
|
+
debugSetReputationSchema.omit({ result: true }),
|
|
472
|
+
debugDumpReputationSchema.omit({ result: true }),
|
|
473
|
+
debugClearReputationSchema.omit({ result: true }),
|
|
474
|
+
debugGetStakeStatusSchema.omit({ result: true }),
|
|
475
|
+
pimlicoGetUserOperationStatusSchema.omit({ result: true }),
|
|
476
|
+
pimlicoGetUserOperationGasPriceSchema.omit({ result: true }),
|
|
477
|
+
pimlicoSendUserOperationNowSchema.omit({ result: true }),
|
|
478
|
+
pimlicoExperimentalSendUserOperation7702Schema.omit({ result: true }),
|
|
479
|
+
pimlicoExperimentalEstimateUserOperationGas7702Schema.omit({
|
|
480
|
+
result: true
|
|
481
|
+
})
|
|
482
|
+
]);
|
|
483
|
+
export const bundlerRpcSchema = z.union([
|
|
484
|
+
chainIdSchema,
|
|
485
|
+
supportedEntryPointsSchema,
|
|
486
|
+
estimateUserOperationGasSchema,
|
|
487
|
+
sendUserOperationSchema,
|
|
488
|
+
getUserOperationByHashSchema,
|
|
489
|
+
getUserOperationReceiptSchema,
|
|
490
|
+
debugClearStateSchema,
|
|
491
|
+
debugClearMempoolSchema,
|
|
492
|
+
debugDumpMempoolSchema,
|
|
493
|
+
debugSendBundleNowSchema,
|
|
494
|
+
debugSetBundlingModeSchema,
|
|
495
|
+
debugSetReputationSchema,
|
|
496
|
+
debugDumpReputationSchema,
|
|
497
|
+
debugClearReputationSchema,
|
|
498
|
+
debugGetStakeStatusSchema,
|
|
499
|
+
pimlicoGetUserOperationStatusSchema,
|
|
500
|
+
pimlicoGetUserOperationGasPriceSchema,
|
|
501
|
+
pimlicoSendUserOperationNowSchema,
|
|
502
|
+
pimlicoExperimentalSendUserOperation7702Schema,
|
|
503
|
+
pimlicoExperimentalEstimateUserOperationGas7702Schema
|
|
561
504
|
]);
|
|
562
505
|
const OpEventType = z.union([
|
|
563
506
|
z.object({
|
|
@@ -619,7 +562,4 @@ const OpEventType = z.union([
|
|
|
619
562
|
})
|
|
620
563
|
})
|
|
621
564
|
]);
|
|
622
|
-
export { bundlerClearStateRequestSchema, bundlerClearMempoolRequestSchema, bundlerDumpMempoolRequestSchema, bundlerSendBundleNowRequestSchema, bundlerSetBundlingModeRequestSchema, bundlerSetReputationsRequestSchema, bundlerDumpReputationsRequestSchema, pimlicoGetStakeStatusRequestSchema, pimlicoGetUserOperationStatusRequestSchema, pimlicoGetUserOperationGasPriceRequestSchema, bundlerRequestSchema, jsonRpcSchema, jsonRpcResultSchema, userOperationSchema };
|
|
623
|
-
export { bundlerClearStateResponseSchema, bundlerClearMempoolResponseSchema, bundlerDumpMempoolResponseSchema, bundlerGetStakeStatusResponseSchema, bundlerSendBundleNowResponseSchema, bundlerSetBundlingModeResponseSchema, bundlerSetReputationsResponseSchema, bundlerDumpReputationsResponseSchema, pimlicoGetUserOperationStatusResponseSchema, pimlicoGetUserOperationGasPriceResponseSchema, bundlerResponseSchema };
|
|
624
|
-
export { addressSchema, hexData32Schema, hexDataSchema, logSchema, receiptSchema };
|
|
625
565
|
//# sourceMappingURL=schemas.js.map
|