@pimlico/alto 0.0.0-main.20250627T074103 → 0.0.0-main.20250627T140102
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/executor/executorManager.js +1 -1
- package/esm/executor/executorManager.js.map +1 -1
- package/esm/executor/filterOpsAndEstimateGas.js +3 -3
- package/esm/executor/filterOpsAndEstimateGas.js.map +1 -1
- package/esm/executor/getBundleStatus.js +2 -2
- package/esm/executor/getBundleStatus.js.map +1 -1
- package/esm/executor/userOpMonitor.d.ts +1 -1
- package/esm/executor/userOpMonitor.js +17 -17
- package/esm/executor/userOpMonitor.js.map +1 -1
- package/esm/executor/utils.js +2 -2
- package/esm/executor/utils.js.map +1 -1
- package/esm/handlers/eventManager.d.ts +9 -9
- package/esm/handlers/eventManager.js +22 -22
- package/esm/handlers/eventManager.js.map +1 -1
- package/esm/mempool/mempool.js +17 -17
- package/esm/mempool/mempool.js.map +1 -1
- package/esm/mempool/monitoring.d.ts +3 -3
- package/esm/mempool/monitoring.js +11 -11
- package/esm/mempool/monitoring.js.map +1 -1
- package/esm/mempool/reputationManager.d.ts +26 -26
- package/esm/mempool/reputationManager.js +65 -65
- package/esm/mempool/reputationManager.js.map +1 -1
- package/esm/rpc/estimation/gasEstimationHandler.d.ts +6 -6
- package/esm/rpc/estimation/gasEstimationHandler.js +10 -10
- package/esm/rpc/estimation/gasEstimationHandler.js.map +1 -1
- package/esm/rpc/estimation/gasEstimations06.d.ts +2 -2
- package/esm/rpc/estimation/gasEstimations06.js +4 -4
- package/esm/rpc/estimation/gasEstimations06.js.map +1 -1
- package/esm/rpc/estimation/gasEstimations07.d.ts +9 -9
- package/esm/rpc/estimation/gasEstimations07.js +33 -33
- package/esm/rpc/estimation/gasEstimations07.js.map +1 -1
- package/esm/rpc/estimation/utils.d.ts +3 -3
- package/esm/rpc/estimation/utils.js +2 -2
- package/esm/rpc/estimation/utils.js.map +1 -1
- package/esm/rpc/methods/boost_sendUserOperation.js +14 -15
- package/esm/rpc/methods/boost_sendUserOperation.js.map +1 -1
- package/esm/rpc/methods/eth_estimateUserOperationGas.js +27 -29
- package/esm/rpc/methods/eth_estimateUserOperationGas.js.map +1 -1
- package/esm/rpc/methods/eth_getUserOperationByHash.js +6 -6
- package/esm/rpc/methods/eth_getUserOperationByHash.js.map +1 -1
- package/esm/rpc/methods/eth_getUserOperationReceipt.js +3 -3
- package/esm/rpc/methods/eth_getUserOperationReceipt.js.map +1 -1
- package/esm/rpc/methods/eth_sendUserOperation.d.ts +2 -2
- package/esm/rpc/methods/eth_sendUserOperation.js +33 -34
- package/esm/rpc/methods/eth_sendUserOperation.js.map +1 -1
- package/esm/rpc/methods/pimlico_getUserOperationStatus.js +2 -2
- package/esm/rpc/methods/pimlico_getUserOperationStatus.js.map +1 -1
- package/esm/rpc/methods/pimlico_sendUserOperationNow.js +11 -11
- package/esm/rpc/methods/pimlico_sendUserOperationNow.js.map +1 -1
- package/esm/rpc/rpcHandler.d.ts +4 -4
- package/esm/rpc/rpcHandler.js +34 -36
- package/esm/rpc/rpcHandler.js.map +1 -1
- package/esm/rpc/validation/SafeValidator.d.ts +11 -11
- package/esm/rpc/validation/SafeValidator.js +35 -32
- package/esm/rpc/validation/SafeValidator.js.map +1 -1
- package/esm/rpc/validation/TracerResultParserV06.d.ts +2 -2
- package/esm/rpc/validation/TracerResultParserV06.js +4 -4
- package/esm/rpc/validation/TracerResultParserV06.js.map +1 -1
- package/esm/rpc/validation/TracerResultParserV07.d.ts +2 -2
- package/esm/rpc/validation/TracerResultParserV07.js +8 -8
- package/esm/rpc/validation/TracerResultParserV07.js.map +1 -1
- package/esm/rpc/validation/UnsafeValidator.d.ts +17 -17
- package/esm/rpc/validation/UnsafeValidator.js +37 -31
- package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
- package/esm/store/createMemoryOutstandingStore.js +4 -4
- package/esm/store/createMemoryOutstandingStore.js.map +1 -1
- package/esm/store/createMempoolStore.js +2 -2
- package/esm/store/createMempoolStore.js.map +1 -1
- package/esm/store/createRedisOutstandingStore.js +4 -4
- package/esm/store/createRedisOutstandingStore.js.map +1 -1
- package/esm/types/interfaces.d.ts +12 -12
- package/esm/utils/helpers.d.ts +2 -2
- package/esm/utils/helpers.js +2 -2
- package/esm/utils/helpers.js.map +1 -1
- package/esm/utils/metrics.d.ts +9 -9
- package/esm/utils/metrics.js +18 -18
- package/esm/utils/metrics.js.map +1 -1
- package/esm/utils/preVerificationGasCalulator.d.ts +3 -3
- package/esm/utils/preVerificationGasCalulator.js +13 -13
- package/esm/utils/preVerificationGasCalulator.js.map +1 -1
- package/esm/utils/userop.d.ts +15 -15
- package/esm/utils/userop.js +77 -77
- package/esm/utils/userop.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,14 +4,13 @@ import { calcExecutionPvgComponent, calcL2PvgComponent } from "../../utils/preVe
|
|
|
4
4
|
import { createMethodHandler } from "../createMethodHandler.js";
|
|
5
5
|
import { RpcError, ValidationErrors, estimateUserOperationGasSchema } from "../../types/index.js";
|
|
6
6
|
import { parseEther, toHex } from "viem";
|
|
7
|
-
function calcVerificationGasAndCallGasLimit(
|
|
7
|
+
function calcVerificationGasAndCallGasLimit(userOp, executionResult, gasLimits) {
|
|
8
8
|
const verificationGasLimit = gasLimits?.verificationGasLimit ??
|
|
9
|
-
scaleBigIntByPercent(executionResult.preOpGas -
|
|
9
|
+
scaleBigIntByPercent(executionResult.preOpGas - userOp.preVerificationGas, 150n);
|
|
10
10
|
const calculatedCallGasLimit = gasLimits?.callGasLimit ??
|
|
11
|
-
executionResult.paid /
|
|
12
|
-
executionResult.preOpGas;
|
|
11
|
+
executionResult.paid / userOp.maxFeePerGas - executionResult.preOpGas;
|
|
13
12
|
let callGasLimit = maxBigInt(calculatedCallGasLimit, 9000n);
|
|
14
|
-
if (isVersion06(
|
|
13
|
+
if (isVersion06(userOp)) {
|
|
15
14
|
callGasLimit += 21000n + 50000n;
|
|
16
15
|
}
|
|
17
16
|
return {
|
|
@@ -20,7 +19,7 @@ function calcVerificationGasAndCallGasLimit(userOperation, executionResult, gasL
|
|
|
20
19
|
paymasterVerificationGasLimit: gasLimits?.paymasterVerificationGasLimit ?? 0n
|
|
21
20
|
};
|
|
22
21
|
}
|
|
23
|
-
const getGasEstimates = async ({ rpcHandler,
|
|
22
|
+
const getGasEstimates = async ({ rpcHandler, userOp, entryPoint, stateOverrides }) => {
|
|
24
23
|
// Prepare userOperation for simulation.
|
|
25
24
|
const { simulationVerificationGasLimit, simulationCallGasLimit, simulationPaymasterVerificationGasLimit, simulationPaymasterPostOpGasLimit, paymasterGasLimitMultiplier, v6CallGasLimitMultiplier, v6VerificationGasLimitMultiplier, v7VerificationGasLimitMultiplier, v7PaymasterVerificationGasLimitMultiplier, v7CallGasLimitMultiplier, v7PaymasterPostOpGasLimitMultiplier } = rpcHandler.config;
|
|
26
25
|
// Create a deep mutable copy of stateOverrides to avoid modifying frozen objects
|
|
@@ -32,12 +31,12 @@ const getGasEstimates = async ({ rpcHandler, userOperation, entryPoint, stateOve
|
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
33
|
// Get queued userOps.
|
|
35
|
-
const
|
|
36
|
-
userOp
|
|
34
|
+
const queuedUserOps = await rpcHandler.mempool.getQueuedOustandingUserOps({
|
|
35
|
+
userOp,
|
|
37
36
|
entryPoint
|
|
38
37
|
});
|
|
39
38
|
const simulationUserOp = {
|
|
40
|
-
...
|
|
39
|
+
...userOp,
|
|
41
40
|
maxFeePerGas: 1n,
|
|
42
41
|
maxPriorityFeePerGas: 1n,
|
|
43
42
|
preVerificationGas: 0n,
|
|
@@ -45,10 +44,9 @@ const getGasEstimates = async ({ rpcHandler, userOperation, entryPoint, stateOve
|
|
|
45
44
|
callGasLimit: simulationCallGasLimit
|
|
46
45
|
};
|
|
47
46
|
// Boosted userOperation must be simulated with maxFeePerGas/maxPriorityFeePerGas = 0.
|
|
48
|
-
const isBoosted =
|
|
49
|
-
userOperation.maxPriorityFeePerGas === 0n;
|
|
47
|
+
const isBoosted = userOp.maxFeePerGas === 0n && userOp.maxPriorityFeePerGas === 0n;
|
|
50
48
|
if (isBoosted) {
|
|
51
|
-
const sender =
|
|
49
|
+
const sender = userOp.sender;
|
|
52
50
|
if (mutableStateOverrides === undefined) {
|
|
53
51
|
mutableStateOverrides = {};
|
|
54
52
|
}
|
|
@@ -67,8 +65,8 @@ const getGasEstimates = async ({ rpcHandler, userOperation, entryPoint, stateOve
|
|
|
67
65
|
simulationPaymasterPostOpGasLimit;
|
|
68
66
|
}
|
|
69
67
|
const executionResult = await rpcHandler.validator.getExecutionResult({
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
userOp: simulationUserOp,
|
|
69
|
+
queuedUserOps,
|
|
72
70
|
entryPoint,
|
|
73
71
|
stateOverrides: deepHexlify(mutableStateOverrides)
|
|
74
72
|
});
|
|
@@ -97,10 +95,10 @@ const getGasEstimates = async ({ rpcHandler, userOperation, entryPoint, stateOve
|
|
|
97
95
|
"paymasterPostOpGasLimit" in successResult.data.executionResult) {
|
|
98
96
|
paymasterPostOpGasLimit =
|
|
99
97
|
successResult.data.executionResult.paymasterPostOpGasLimit || 1n;
|
|
100
|
-
const
|
|
101
|
-
? (
|
|
98
|
+
const userOpPaymasterPostOpGasLimit = "paymasterPostOpGasLimit" in userOp
|
|
99
|
+
? (userOp.paymasterPostOpGasLimit ?? 1n)
|
|
102
100
|
: 1n;
|
|
103
|
-
paymasterPostOpGasLimit = maxBigInt(
|
|
101
|
+
paymasterPostOpGasLimit = maxBigInt(userOpPaymasterPostOpGasLimit, scaleBigIntByPercent(paymasterPostOpGasLimit, paymasterGasLimitMultiplier));
|
|
104
102
|
}
|
|
105
103
|
if (simulationUserOp.callData === "0x") {
|
|
106
104
|
callGasLimit = 0n;
|
|
@@ -123,31 +121,31 @@ const getGasEstimates = async ({ rpcHandler, userOperation, entryPoint, stateOve
|
|
|
123
121
|
paymasterVerificationGasLimit,
|
|
124
122
|
paymasterPostOpGasLimit
|
|
125
123
|
},
|
|
126
|
-
|
|
124
|
+
queuedUserOps
|
|
127
125
|
};
|
|
128
126
|
};
|
|
129
127
|
export const ethEstimateUserOperationGasHandler = createMethodHandler({
|
|
130
128
|
method: "eth_estimateUserOperationGas",
|
|
131
129
|
schema: estimateUserOperationGasSchema,
|
|
132
130
|
handler: async ({ rpcHandler, apiVersion, params }) => {
|
|
133
|
-
const [
|
|
131
|
+
const [userOp, entryPoint, stateOverrides] = params;
|
|
134
132
|
rpcHandler.ensureEntryPointIsSupported(entryPoint);
|
|
135
133
|
// Extract all config values at the beginning
|
|
136
134
|
const { supportsEip7623, v7PreVerificationGasLimitMultiplier, v6PreVerificationGasLimitMultiplier } = rpcHandler.config;
|
|
137
135
|
// Execute multiple async operations in parallel
|
|
138
136
|
let [[validEip7702Auth, validEip7702AuthError], gasEstimateResult, l2GasComponent] = await Promise.all([
|
|
139
137
|
rpcHandler.validateEip7702Auth({
|
|
140
|
-
|
|
138
|
+
userOp
|
|
141
139
|
}),
|
|
142
140
|
getGasEstimates({
|
|
143
141
|
rpcHandler,
|
|
144
|
-
|
|
142
|
+
userOp,
|
|
145
143
|
entryPoint,
|
|
146
144
|
stateOverrides
|
|
147
145
|
}),
|
|
148
146
|
calcL2PvgComponent({
|
|
149
147
|
config: rpcHandler.config,
|
|
150
|
-
|
|
148
|
+
userOp,
|
|
151
149
|
entryPoint,
|
|
152
150
|
gasPriceManager: rpcHandler.gasPriceManager,
|
|
153
151
|
validate: false
|
|
@@ -163,7 +161,7 @@ export const ethEstimateUserOperationGasHandler = createMethodHandler({
|
|
|
163
161
|
}
|
|
164
162
|
// Now calculate execution gas component with the estimated gas values
|
|
165
163
|
const userOpWithEstimatedGas = {
|
|
166
|
-
...
|
|
164
|
+
...userOp,
|
|
167
165
|
...gasEstimateResult.estimates
|
|
168
166
|
};
|
|
169
167
|
const executionGasComponent = calcExecutionPvgComponent({
|
|
@@ -174,26 +172,26 @@ export const ethEstimateUserOperationGasHandler = createMethodHandler({
|
|
|
174
172
|
// Calculate total preVerificationGas by summing both components
|
|
175
173
|
let preVerificationGas = executionGasComponent + l2GasComponent;
|
|
176
174
|
// Add multipliers to pvg
|
|
177
|
-
if (isVersion07(
|
|
175
|
+
if (isVersion07(userOp)) {
|
|
178
176
|
preVerificationGas = scaleBigIntByPercent(preVerificationGas, v7PreVerificationGasLimitMultiplier);
|
|
179
177
|
}
|
|
180
|
-
if (isVersion06(
|
|
178
|
+
if (isVersion06(userOp)) {
|
|
181
179
|
preVerificationGas = scaleBigIntByPercent(preVerificationGas, v6PreVerificationGasLimitMultiplier);
|
|
182
180
|
}
|
|
183
181
|
// Check if userOperation passes without estimation balance overrides (will throw error if it fails validation)
|
|
184
182
|
await rpcHandler.validator.validateHandleOp({
|
|
185
|
-
|
|
186
|
-
...
|
|
183
|
+
userOp: {
|
|
184
|
+
...userOp,
|
|
187
185
|
...gasEstimateResult.estimates, // use actual callGasLimit, verificationGasLimit, paymasterPostOpGasLimit, paymasterVerificationGasLimit
|
|
188
186
|
preVerificationGas
|
|
189
187
|
},
|
|
190
|
-
|
|
188
|
+
queuedUserOps: gasEstimateResult.queuedUserOps,
|
|
191
189
|
entryPoint,
|
|
192
190
|
stateOverrides: deepHexlify(stateOverrides)
|
|
193
191
|
});
|
|
194
192
|
// Extrace values for returning
|
|
195
193
|
const { verificationGasLimit, callGasLimit, paymasterVerificationGasLimit, paymasterPostOpGasLimit } = gasEstimateResult.estimates;
|
|
196
|
-
if (isVersion07(
|
|
194
|
+
if (isVersion07(userOp)) {
|
|
197
195
|
return {
|
|
198
196
|
preVerificationGas,
|
|
199
197
|
verificationGasLimit,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eth_estimateUserOperationGas.js","sourceRoot":"","sources":["../../../rpc/methods/eth_estimateUserOperationGas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,WAAW,EA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uBAAuB,EAC1B,GAAG,iBAAiB,CAAC,SAAS,CAAA;QAE/B,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;YACtB,OAAO;gBACH,kBAAkB;gBAClB,oBAAoB;gBACpB,YAAY;gBACZ,6BAA6B;gBAC7B,uBAAuB;aAC1B,CAAA;QACL,CAAC;QAED,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;YACtB,OAAO;gBACH,kBAAkB;gBAClB,oBAAoB;gBACpB,YAAY;aACf,CAAA;QACL,CAAC;QAED,OAAO;YACH,kBAAkB;YAClB,eAAe,EAAE,oBAAoB;YACrC,oBAAoB;YACpB,YAAY;SACf,CAAA;IACL,CAAC;CACJ,CAAC,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getAbiItem, TransactionNotFoundError, decodeFunctionData, toFunctionSelector, slice, getAddress } from "viem";
|
|
2
|
-
import {
|
|
2
|
+
import { toUnpackedUserOp } from "../../utils/userop.js";
|
|
3
3
|
import { createMethodHandler } from "../createMethodHandler.js";
|
|
4
4
|
import { EntryPointV06Abi, EntryPointV07Abi, getUserOperationByHashSchema } from "../../types/index.js";
|
|
5
|
-
const
|
|
5
|
+
const userOpEventAbiItem = getAbiItem({
|
|
6
6
|
abi: EntryPointV06Abi,
|
|
7
7
|
name: "UserOperationEvent"
|
|
8
8
|
});
|
|
@@ -10,7 +10,7 @@ export const ethGetUserOperationByHashHandler = createMethodHandler({
|
|
|
10
10
|
method: "eth_getUserOperationByHash",
|
|
11
11
|
schema: getUserOperationByHashSchema,
|
|
12
12
|
handler: async ({ rpcHandler, params }) => {
|
|
13
|
-
const [
|
|
13
|
+
const [userOpHash] = params;
|
|
14
14
|
let fromBlock;
|
|
15
15
|
let toBlock;
|
|
16
16
|
if (rpcHandler.config.maxBlockRange !== undefined) {
|
|
@@ -23,11 +23,11 @@ export const ethGetUserOperationByHashHandler = createMethodHandler({
|
|
|
23
23
|
}
|
|
24
24
|
const filterResult = await rpcHandler.config.publicClient.getLogs({
|
|
25
25
|
address: rpcHandler.config.entrypoints,
|
|
26
|
-
event:
|
|
26
|
+
event: userOpEventAbiItem,
|
|
27
27
|
fromBlock,
|
|
28
28
|
toBlock,
|
|
29
29
|
args: {
|
|
30
|
-
userOpHash
|
|
30
|
+
userOpHash
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
if (filterResult.length === 0) {
|
|
@@ -77,7 +77,7 @@ export const ethGetUserOperationByHashHandler = createMethodHandler({
|
|
|
77
77
|
});
|
|
78
78
|
const handleOpsV07Selector = toFunctionSelector(handleOpsV07AbiItem);
|
|
79
79
|
if (slice(tx.input, 0, 4) === handleOpsV07Selector) {
|
|
80
|
-
op =
|
|
80
|
+
op = toUnpackedUserOp(foundOp);
|
|
81
81
|
}
|
|
82
82
|
else {
|
|
83
83
|
op = foundOp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eth_getUserOperationByHash.js","sourceRoot":"","sources":["../../../rpc/methods/eth_getUserOperationByHash.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,UAAU,EAEV,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,EACL,UAAU,EACb,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"eth_getUserOperationByHash.js","sourceRoot":"","sources":["../../../rpc/methods/eth_getUserOperationByHash.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,UAAU,EAEV,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,EACL,UAAU,EACb,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAMhB,4BAA4B,EAC/B,MAAM,aAAa,CAAA;AAEpB,MAAM,kBAAkB,GAAG,UAAU,CAAC;IAClC,GAAG,E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E,WAAW;aACpB,CAAC,CAAA;YACF,MAAM,oBAAoB,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;YAEpE,IAAI,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,oBAAoB,EAAE,CAAC;gBACjD,EAAE,GAAG,gBAAgB,CAAC,OAA8B,CAAC,CAAA;YACzD,CAAC;iBAAM,CAAC;gBACJ,EAAE,GAAG,OAA2B,CAAA;YACpC,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,IAAI,CAAA;QACf,CAAC;QAED,OAAO;YACH,aAAa,EAAE,MAAM,CAAC,WAAW,CAC7B,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CACnC;YAClB,UAAU,EAAE,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC;YAC7B,eAAe,EAAE,MAAM;YACvB,SAAS,EAAE,EAAE,CAAC,SAAS,IAAI,IAAI;YAC/B,WAAW,EAAE,MAAM,CAAC,EAAE,CAAC,WAAW,IAAI,EAAE,CAAC;SAC5C,CAAA;IACL,CAAC;CACJ,CAAC,CAAA"}
|
|
@@ -4,12 +4,12 @@ export const ethGetUserOperationReceiptHandler = createMethodHandler({
|
|
|
4
4
|
method: "eth_getUserOperationReceipt",
|
|
5
5
|
schema: getUserOperationReceiptSchema,
|
|
6
6
|
handler: async ({ rpcHandler, params }) => {
|
|
7
|
-
const [
|
|
7
|
+
const [userOpHash] = params;
|
|
8
8
|
try {
|
|
9
|
-
return await rpcHandler.userOpMonitor.getUserOpReceipt(
|
|
9
|
+
return await rpcHandler.userOpMonitor.getUserOpReceipt(userOpHash);
|
|
10
10
|
}
|
|
11
11
|
catch (err) {
|
|
12
|
-
rpcHandler.logger.error({ err,
|
|
12
|
+
rpcHandler.logger.error({ err, userOpHash }, "Unexpected error while getting user operation receipt");
|
|
13
13
|
throw new RpcError("Failed to get user operation receipt");
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eth_getUserOperationReceipt.js","sourceRoot":"","sources":["../../../rpc/methods/eth_getUserOperationReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAErE,MAAM,CAAC,MAAM,iCAAiC,GAAG,mBAAmB,CAAC;IACjE,MAAM,EAAE,6BAA6B;IACrC,MAAM,EAAE,6BAA6B;IACrC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE;QACtC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"eth_getUserOperationReceipt.js","sourceRoot":"","sources":["../../../rpc/methods/eth_getUserOperationReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAErE,MAAM,CAAC,MAAM,iCAAiC,GAAG,mBAAmB,CAAC;IACjE,MAAM,EAAE,6BAA6B;IACrC,MAAM,EAAE,6BAA6B;IACrC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE;QACtC,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAA;QAC3B,IAAI,CAAC;YACD,OAAO,MAAM,UAAU,CAAC,aAAa,CAAC,gBAAgB,CAClD,UAAU,CACb,CAAA;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,UAAU,CAAC,MAAM,CAAC,KAAK,CACnB,EAAE,GAAG,EAAE,UAAU,EAAE,EACnB,uDAAuD,CAC1D,CAAA;YACD,MAAM,IAAI,QAAQ,CAAC,sCAAsC,CAAC,CAAA;QAC9D,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type UserOperation, type Address, type ApiVersion } from "../../types/index.js";
|
|
2
2
|
import { RpcHandler } from "../rpcHandler.js";
|
|
3
3
|
import { Hex } from "viem";
|
|
4
|
-
export declare function addToMempoolIfValid({ rpcHandler,
|
|
4
|
+
export declare function addToMempoolIfValid({ rpcHandler, userOp, entryPoint, apiVersion, boost }: {
|
|
5
5
|
rpcHandler: RpcHandler;
|
|
6
|
-
|
|
6
|
+
userOp: UserOperation;
|
|
7
7
|
entryPoint: Address;
|
|
8
8
|
apiVersion: ApiVersion;
|
|
9
9
|
boost?: boolean;
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { getNonceKeyAndSequence,
|
|
1
|
+
import { getNonceKeyAndSequence, getUserOpHash } from "../../utils/userop.js";
|
|
2
2
|
import { createMethodHandler } from "../createMethodHandler.js";
|
|
3
3
|
import { sendUserOperationSchema, RpcError, ValidationErrors } from "../../types/index.js";
|
|
4
4
|
import { calcExecutionPvgComponent, calcL2PvgComponent, getAAError } from "../../utils/index.js";
|
|
5
|
-
const validatePvg = async (apiVersion, rpcHandler,
|
|
5
|
+
const validatePvg = async (apiVersion, rpcHandler, userOp, entryPoint, boost = false) => {
|
|
6
6
|
// PVG validation is skipped for v1
|
|
7
7
|
if (apiVersion == "v1" || boost) {
|
|
8
8
|
return [true, ""];
|
|
9
9
|
}
|
|
10
10
|
const executionGasComponent = calcExecutionPvgComponent({
|
|
11
|
-
userOp
|
|
11
|
+
userOp,
|
|
12
12
|
supportsEip7623: rpcHandler.config.supportsEip7623,
|
|
13
13
|
config: rpcHandler.config
|
|
14
14
|
});
|
|
15
15
|
const l2GasComponent = await calcL2PvgComponent({
|
|
16
16
|
config: rpcHandler.config,
|
|
17
|
-
|
|
17
|
+
userOp,
|
|
18
18
|
entryPoint,
|
|
19
19
|
gasPriceManager: rpcHandler.gasPriceManager,
|
|
20
20
|
validate: true
|
|
21
21
|
});
|
|
22
22
|
const requiredPvg = executionGasComponent + l2GasComponent;
|
|
23
|
-
if (requiredPvg >
|
|
23
|
+
if (requiredPvg > userOp.preVerificationGas) {
|
|
24
24
|
return [
|
|
25
25
|
false,
|
|
26
|
-
`preVerificationGas is not enough, required: ${requiredPvg}, got: ${
|
|
26
|
+
`preVerificationGas is not enough, required: ${requiredPvg}, got: ${userOp.preVerificationGas}`
|
|
27
27
|
];
|
|
28
28
|
}
|
|
29
29
|
return [true, ""];
|
|
30
30
|
};
|
|
31
|
-
const getUserOpValidationResult = async (rpcHandler,
|
|
32
|
-
const
|
|
33
|
-
userOp
|
|
31
|
+
const getUserOpValidationResult = async (rpcHandler, userOp, entryPoint) => {
|
|
32
|
+
const queuedUserOps = await rpcHandler.mempool.getQueuedOustandingUserOps({
|
|
33
|
+
userOp,
|
|
34
34
|
entryPoint
|
|
35
35
|
});
|
|
36
|
-
const validationResult = await rpcHandler.validator.
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
const validationResult = await rpcHandler.validator.validateUserOp({
|
|
37
|
+
userOp,
|
|
38
|
+
queuedUserOps,
|
|
39
39
|
entryPoint
|
|
40
40
|
});
|
|
41
41
|
return {
|
|
42
|
-
|
|
42
|
+
queuedUserOps,
|
|
43
43
|
validationResult
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
|
-
export async function addToMempoolIfValid({ rpcHandler,
|
|
46
|
+
export async function addToMempoolIfValid({ rpcHandler, userOp, entryPoint, apiVersion, boost = false }) {
|
|
47
47
|
rpcHandler.ensureEntryPointIsSupported(entryPoint);
|
|
48
48
|
// Execute multiple async operations in parallel
|
|
49
|
-
const [userOpHash, {
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
const [userOpHash, { queuedUserOps, validationResult }, currentNonceSeq, [pvgSuccess, pvgErrorReason], [preMempoolSuccess, preMempoolError], [validEip7702Auth, validEip7702AuthError]] = await Promise.all([
|
|
50
|
+
getUserOpHash({
|
|
51
|
+
userOp,
|
|
52
52
|
entryPointAddress: entryPoint,
|
|
53
53
|
chainId: rpcHandler.config.chainId,
|
|
54
54
|
publicClient: rpcHandler.config.publicClient
|
|
55
55
|
}),
|
|
56
|
-
getUserOpValidationResult(rpcHandler,
|
|
57
|
-
rpcHandler.getNonceSeq(
|
|
58
|
-
validatePvg(apiVersion, rpcHandler,
|
|
59
|
-
rpcHandler.preMempoolChecks(
|
|
56
|
+
getUserOpValidationResult(rpcHandler, userOp, entryPoint),
|
|
57
|
+
rpcHandler.getNonceSeq(userOp, entryPoint),
|
|
58
|
+
validatePvg(apiVersion, rpcHandler, userOp, entryPoint, boost),
|
|
59
|
+
rpcHandler.preMempoolChecks(userOp, apiVersion, boost),
|
|
60
60
|
rpcHandler.validateEip7702Auth({
|
|
61
|
-
|
|
61
|
+
userOp,
|
|
62
62
|
validateSender: true
|
|
63
63
|
})
|
|
64
64
|
]);
|
|
@@ -78,7 +78,7 @@ export async function addToMempoolIfValid({ rpcHandler, userOperation, entryPoin
|
|
|
78
78
|
throw new RpcError(pvgErrorReason, ValidationErrors.SimulateValidation);
|
|
79
79
|
}
|
|
80
80
|
// Nonce validation
|
|
81
|
-
const [, userOpNonceSeq] = getNonceKeyAndSequence(
|
|
81
|
+
const [, userOpNonceSeq] = getNonceKeyAndSequence(userOp.nonce);
|
|
82
82
|
if (userOpNonceSeq < currentNonceSeq) {
|
|
83
83
|
const reason = "UserOperation failed validation with reason: AA25 invalid account nonce";
|
|
84
84
|
rpcHandler.eventManager.emitFailedValidation(userOpHash, reason, "AA25");
|
|
@@ -89,15 +89,14 @@ export async function addToMempoolIfValid({ rpcHandler, userOperation, entryPoin
|
|
|
89
89
|
rpcHandler.eventManager.emitFailedValidation(userOpHash, reason, "AA25");
|
|
90
90
|
throw new RpcError(reason, ValidationErrors.InvalidFields);
|
|
91
91
|
}
|
|
92
|
-
if (userOpNonceSeq >
|
|
93
|
-
|
|
94
|
-
rpcHandler.mempool.add(userOperation, entryPoint);
|
|
92
|
+
if (userOpNonceSeq > currentNonceSeq + BigInt(queuedUserOps.length)) {
|
|
93
|
+
rpcHandler.mempool.add(userOp, entryPoint);
|
|
95
94
|
rpcHandler.eventManager.emitQueued(userOpHash);
|
|
96
95
|
return { result: "queued", userOpHash };
|
|
97
96
|
}
|
|
98
97
|
// userOp validation
|
|
99
98
|
if (rpcHandler.config.dangerousSkipUserOperationValidation) {
|
|
100
|
-
const [isMempoolAddSuccess, mempoolAddError] = await rpcHandler.mempool.add(
|
|
99
|
+
const [isMempoolAddSuccess, mempoolAddError] = await rpcHandler.mempool.add(userOp, entryPoint);
|
|
101
100
|
if (!isMempoolAddSuccess) {
|
|
102
101
|
rpcHandler.eventManager.emitFailedValidation(userOpHash, mempoolAddError, getAAError(mempoolAddError));
|
|
103
102
|
throw new RpcError(mempoolAddError, ValidationErrors.InvalidFields);
|
|
@@ -105,10 +104,10 @@ export async function addToMempoolIfValid({ rpcHandler, userOperation, entryPoin
|
|
|
105
104
|
return { result: "added", userOpHash };
|
|
106
105
|
}
|
|
107
106
|
// ERC-7562 scope rule validation
|
|
108
|
-
rpcHandler.reputationManager.checkReputation(
|
|
109
|
-
await rpcHandler.mempool.checkEntityMultipleRoleViolation(entryPoint,
|
|
107
|
+
rpcHandler.reputationManager.checkReputation(userOp, entryPoint, validationResult);
|
|
108
|
+
await rpcHandler.mempool.checkEntityMultipleRoleViolation(entryPoint, userOp);
|
|
110
109
|
// Finally, add to mempool
|
|
111
|
-
const [isMempoolAddSuccess, mempoolAddError] = await rpcHandler.mempool.add(
|
|
110
|
+
const [isMempoolAddSuccess, mempoolAddError] = await rpcHandler.mempool.add(userOp, entryPoint, validationResult.referencedContracts);
|
|
112
111
|
if (!isMempoolAddSuccess) {
|
|
113
112
|
rpcHandler.eventManager.emitFailedValidation(userOpHash, mempoolAddError, getAAError(mempoolAddError));
|
|
114
113
|
throw new RpcError(mempoolAddError, ValidationErrors.InvalidFields);
|
|
@@ -119,12 +118,12 @@ export const ethSendUserOperationHandler = createMethodHandler({
|
|
|
119
118
|
method: "eth_sendUserOperation",
|
|
120
119
|
schema: sendUserOperationSchema,
|
|
121
120
|
handler: async ({ rpcHandler, params, apiVersion }) => {
|
|
122
|
-
const [
|
|
121
|
+
const [userOp, entryPoint] = params;
|
|
123
122
|
let status = "rejected";
|
|
124
123
|
try {
|
|
125
124
|
const { result, userOpHash } = await addToMempoolIfValid({
|
|
126
125
|
rpcHandler,
|
|
127
|
-
|
|
126
|
+
userOp,
|
|
128
127
|
entryPoint,
|
|
129
128
|
apiVersion
|
|
130
129
|
});
|
|
@@ -137,10 +136,10 @@ export const ethSendUserOperationHandler = createMethodHandler({
|
|
|
137
136
|
throw error;
|
|
138
137
|
}
|
|
139
138
|
finally {
|
|
140
|
-
rpcHandler.metrics.
|
|
139
|
+
rpcHandler.metrics.userOpsReceived
|
|
141
140
|
.labels({
|
|
142
141
|
status,
|
|
143
|
-
type: !!
|
|
142
|
+
type: !!userOp.eip7702Auth ? "7702" : "regular"
|
|
144
143
|
})
|
|
145
144
|
.inc();
|
|
146
145
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eth_sendUserOperation.js","sourceRoot":"","sources":["../../../rpc/methods/eth_sendUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"eth_sendUserOperation.js","sourceRoot":"","sources":["../../../rpc/methods/eth_sendUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EACH,uBAAuB,EACvB,QAAQ,EACR,gBAAgB,EAKnB,MAAM,aAAa,CAAA;AACpB,OAAO,EACH,yBAAyB,EACzB,kBAAkB,EAClB,UAAU,EACb,MAAM,aAAa,CAAA;AAKpB,MAAM,WAAW,GAAG,KAAK,EACrB,UAA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,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE;QAClD,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,MAAM,CAAA;QAEnC,IAAI,MAAM,GAAoC,UAAU,CAAA;QACxD,IAAI,CAAC;YACD,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,mBAAmB,CAAC;gBACrD,UAAU;gBACV,MAAM;gBACN,UAAU;gBACV,UAAU;aACb,CAAC,CAAA;YAEF,MAAM,GAAG,MAAM,CAAA;YAEf,UAAU,CAAC,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,CAAA;YAEhD,OAAO,UAAU,CAAA;QACrB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,GAAG,UAAU,CAAA;YACnB,MAAM,KAAK,CAAA;QACf,CAAC;gBAAS,CAAC;YACP,UAAU,CAAC,OAAO,CAAC,eAAe;iBAC7B,MAAM,CAAC;gBACJ,MAAM;gBACN,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;aAClD,CAAC;iBACD,GAAG,EAAE,CAAA;QACd,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"}
|
|
@@ -4,8 +4,8 @@ export const pimlicoGetUserOperationStatusHandler = createMethodHandler({
|
|
|
4
4
|
method: "pimlico_getUserOperationStatus",
|
|
5
5
|
schema: pimlicoGetUserOperationStatusSchema,
|
|
6
6
|
handler: ({ rpcHandler, params }) => {
|
|
7
|
-
const [
|
|
8
|
-
return rpcHandler.monitor.
|
|
7
|
+
const [userOpHash] = params;
|
|
8
|
+
return rpcHandler.monitor.getUserOpStatus(userOpHash);
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=pimlico_getUserOperationStatus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico_getUserOperationStatus.js","sourceRoot":"","sources":["../../../rpc/methods/pimlico_getUserOperationStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,mCAAmC,EAAE,MAAM,aAAa,CAAA;AAEjE,MAAM,CAAC,MAAM,oCAAoC,GAAG,mBAAmB,CAAC;IACpE,MAAM,EAAE,gCAAgC;IACxC,MAAM,EAAE,mCAAmC;IAC3C,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE;QAChC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"pimlico_getUserOperationStatus.js","sourceRoot":"","sources":["../../../rpc/methods/pimlico_getUserOperationStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,mCAAmC,EAAE,MAAM,aAAa,CAAA;AAEjE,MAAM,CAAC,MAAM,oCAAoC,GAAG,mBAAmB,CAAC;IACpE,MAAM,EAAE,gCAAgC;IACxC,MAAM,EAAE,mCAAmC;IAC3C,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE;QAChC,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAA;QAC3B,OAAO,UAAU,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAA;IACzD,CAAC;CACJ,CAAC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getUserOpHash, isVersion07, isVersion08, parseUserOpReceipt } from "../../utils/index.js";
|
|
2
2
|
import { createMethodHandler } from "../createMethodHandler.js";
|
|
3
3
|
import { RpcError, ValidationErrors, pimlicoSendUserOperationNowSchema } from "../../types/index.js";
|
|
4
4
|
export const pimlicoSendUserOperationNowHandler = createMethodHandler({
|
|
@@ -8,23 +8,23 @@ export const pimlicoSendUserOperationNowHandler = createMethodHandler({
|
|
|
8
8
|
if (!rpcHandler.config.enableInstantBundlingEndpoint) {
|
|
9
9
|
throw new RpcError("pimlico_sendUserOperationNow endpoint is not enabled", ValidationErrors.InvalidFields);
|
|
10
10
|
}
|
|
11
|
-
const [
|
|
11
|
+
const [userOp, entryPoint] = params;
|
|
12
12
|
rpcHandler.ensureEntryPointIsSupported(entryPoint);
|
|
13
|
-
const opHash = await
|
|
14
|
-
|
|
13
|
+
const opHash = await getUserOpHash({
|
|
14
|
+
userOp,
|
|
15
15
|
entryPointAddress: entryPoint,
|
|
16
16
|
chainId: rpcHandler.config.chainId,
|
|
17
17
|
publicClient: rpcHandler.config.publicClient
|
|
18
18
|
});
|
|
19
|
-
const [preMempoolValid, preMempoolError] = await rpcHandler.preMempoolChecks(
|
|
19
|
+
const [preMempoolValid, preMempoolError] = await rpcHandler.preMempoolChecks(userOp, apiVersion);
|
|
20
20
|
if (!preMempoolValid) {
|
|
21
21
|
throw new RpcError(preMempoolError);
|
|
22
22
|
}
|
|
23
23
|
// Prepare bundle
|
|
24
24
|
const userOpInfo = {
|
|
25
|
-
userOp
|
|
26
|
-
userOpHash: await
|
|
27
|
-
|
|
25
|
+
userOp,
|
|
26
|
+
userOpHash: await getUserOpHash({
|
|
27
|
+
userOp,
|
|
28
28
|
entryPointAddress: entryPoint,
|
|
29
29
|
chainId: rpcHandler.config.chainId,
|
|
30
30
|
publicClient: rpcHandler.config.publicClient
|
|
@@ -34,10 +34,10 @@ export const pimlicoSendUserOperationNowHandler = createMethodHandler({
|
|
|
34
34
|
};
|
|
35
35
|
// Derive version
|
|
36
36
|
let version;
|
|
37
|
-
if (isVersion08(
|
|
37
|
+
if (isVersion08(userOp, entryPoint)) {
|
|
38
38
|
version = "0.8";
|
|
39
39
|
}
|
|
40
|
-
else if (isVersion07(
|
|
40
|
+
else if (isVersion07(userOp)) {
|
|
41
41
|
version = "0.7";
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
@@ -59,7 +59,7 @@ export const pimlicoSendUserOperationNowHandler = createMethodHandler({
|
|
|
59
59
|
hash: result,
|
|
60
60
|
pollingInterval: 100
|
|
61
61
|
});
|
|
62
|
-
return
|
|
62
|
+
return parseUserOpReceipt(opHash, receipt);
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
//# sourceMappingURL=pimlico_sendUserOperationNow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico_sendUserOperationNow.js","sourceRoot":"","sources":["../../../rpc/methods/pimlico_sendUserOperationNow.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,
|
|
1
|
+
{"version":3,"file":"pimlico_sendUserOperationNow.js","sourceRoot":"","sources":["../../../rpc/methods/pimlico_sendUserOperationNow.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EACb,WAAW,EACX,WAAW,EACX,kBAAkB,EACrB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EACH,QAAQ,EAGR,gBAAgB,EAChB,iCAAiC,EACpC,MAAM,aAAa,CAAA;AAGpB,MAAM,CAAC,MAAM,kCAAkC,GAAG,mBAAmB,CAAC;IAClE,MAAM,EAAE,8BAA8B;IACtC,MAAM,EAAE,iCAAiC;IACzC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE;QAClD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,6BAA6B,EAAE,CAAC;YACnD,MAAM,IAAI,QAAQ,CACd,sDAAsD,EACtD,gBAAgB,CAAC,aAAa,CACjC,CAAA;QACL,CAAC;QAED,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,MAAM,CAAA;QACnC,UAAU,CAAC,2BAA2B,CAAC,UAAU,CAAC,CAAA;QAElD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC;YAC/B,MAAM;YACN,iBAAiB,EAAE,UAAU;YAC7B,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO;YACl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AI,QAAQ,CACd,0CAA0C,EAC1C,gBAAgB,CAAC,aAAa,CACjC,CAAA;QACL,CAAC;QAED,oBAAoB;QACpB,MAAM,OAAO,GACT,MAAM,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,yBAAyB,CAAC;YAC3D,IAAI,EAAE,MAAM;YACZ,eAAe,EAAE,GAAG;SACvB,CAAC,CAAA;QAEN,OAAO,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9C,CAAC;CACJ,CAAC,CAAA"}
|
package/esm/rpc/rpcHandler.d.ts
CHANGED
|
@@ -39,14 +39,14 @@ export declare class RpcHandler {
|
|
|
39
39
|
handleMethod(request: BundlerRequest, apiVersion: ApiVersion): Promise<any>;
|
|
40
40
|
ensureEntryPointIsSupported(entryPoint: Address): void;
|
|
41
41
|
ensureDebugEndpointsAreEnabled(methodName: string): void;
|
|
42
|
-
preMempoolChecks(
|
|
43
|
-
validateEip7702Auth({
|
|
44
|
-
|
|
42
|
+
preMempoolChecks(userOp: UserOperation, apiVersion: ApiVersion, boost?: boolean): Promise<[boolean, string]>;
|
|
43
|
+
validateEip7702Auth({ userOp, validateSender }: {
|
|
44
|
+
userOp: UserOperation;
|
|
45
45
|
validateSender?: boolean;
|
|
46
46
|
}): Promise<[
|
|
47
47
|
boolean,
|
|
48
48
|
string
|
|
49
49
|
]>;
|
|
50
|
-
getNonceSeq(
|
|
50
|
+
getNonceSeq(userOp: UserOperation, entryPoint: Address): Promise<bigint>;
|
|
51
51
|
}
|
|
52
52
|
//# sourceMappingURL=rpcHandler.d.ts.map
|