@pimlico/alto 0.0.4 → 0.0.6
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/alto.js +0 -4
- package/esm/cli/alto.js.map +1 -1
- package/esm/cli/config/bundler.d.ts +2296 -22
- package/esm/cli/config/bundler.js +31 -4
- package/esm/cli/config/bundler.js.map +1 -1
- package/esm/cli/config/options.js +53 -4
- package/esm/cli/config/options.js.map +1 -1
- package/esm/cli/customTransport.js +5 -1
- package/esm/cli/customTransport.js.map +1 -1
- package/esm/cli/handler.js +14 -3
- package/esm/cli/handler.js.map +1 -1
- package/esm/cli/instrumentation.js +2 -2
- package/esm/cli/instrumentation.js.map +1 -1
- package/esm/cli/setupServer.d.ts +2 -1
- package/esm/cli/setupServer.js +51 -27
- package/esm/cli/setupServer.js.map +1 -1
- package/esm/executor/executor.d.ts +7 -14
- package/esm/executor/executor.js +139 -128
- package/esm/executor/executor.js.map +1 -1
- package/esm/executor/executorManager.d.ts +58 -4
- package/esm/executor/executorManager.js +207 -53
- package/esm/executor/executorManager.js.map +1 -1
- package/esm/executor/senderManager.d.ts +2 -1
- package/esm/executor/senderManager.js +3 -0
- package/esm/executor/senderManager.js.map +1 -1
- package/esm/executor/utilityWalletMonitor.d.ts +15 -0
- package/esm/executor/utilityWalletMonitor.js +38 -0
- package/esm/executor/utilityWalletMonitor.js.map +1 -0
- package/esm/executor/utils.d.ts +1 -2
- package/esm/executor/utils.js +49 -38
- package/esm/executor/utils.js.map +1 -1
- package/esm/handlers/compressionHandler.js.map +1 -0
- package/esm/handlers/eventManager.d.ts +21 -0
- package/esm/handlers/eventManager.js +166 -0
- package/esm/handlers/eventManager.js.map +1 -0
- package/{lib/utils → esm/handlers}/gasPriceManager.d.ts +19 -5
- package/esm/{utils → handlers}/gasPriceManager.js +58 -13
- package/esm/handlers/gasPriceManager.js.map +1 -0
- package/esm/handlers/index.d.ts +4 -0
- package/esm/handlers/index.js +4 -0
- package/esm/handlers/index.js.map +1 -0
- package/esm/mempool/index.d.ts +0 -1
- package/esm/mempool/index.js +0 -1
- package/esm/mempool/index.js.map +1 -1
- package/esm/mempool/mempool.d.ts +4 -2
- package/esm/mempool/mempool.js +65 -19
- package/esm/mempool/mempool.js.map +1 -1
- package/esm/rpc/EntryPointSimulationsV07.d.ts +2 -2
- package/esm/rpc/EntryPointSimulationsV07.js +10 -7
- package/esm/rpc/EntryPointSimulationsV07.js.map +1 -1
- package/esm/rpc/gasEstimation.d.ts +3 -3
- package/esm/rpc/gasEstimation.js +22 -17
- package/esm/rpc/gasEstimation.js.map +1 -1
- package/esm/rpc/nonceQueuer.d.ts +4 -1
- package/esm/rpc/nonceQueuer.js +9 -3
- package/esm/rpc/nonceQueuer.js.map +1 -1
- package/esm/rpc/rpcHandler.d.ts +53 -3
- package/esm/rpc/rpcHandler.js +132 -231
- package/esm/rpc/rpcHandler.js.map +1 -1
- package/esm/rpc/server.d.ts +2 -1
- package/esm/rpc/server.js +6 -1
- package/esm/rpc/server.js.map +1 -1
- package/esm/rpc/validation/SafeValidator.d.ts +3 -2
- package/esm/rpc/validation/SafeValidator.js +2 -2
- package/esm/rpc/validation/SafeValidator.js.map +1 -1
- package/esm/rpc/validation/UnsafeValidator.d.ts +5 -2
- package/esm/rpc/validation/UnsafeValidator.js +10 -6
- package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
- package/esm/rpc/validation/tracer.js +1 -0
- package/esm/rpc/validation/tracer.js.map +1 -1
- package/esm/types/schemas.d.ts +1029 -333
- package/esm/types/schemas.js +94 -20
- package/esm/types/schemas.js.map +1 -1
- package/esm/types/utils.d.ts +1 -1
- package/esm/types/validation.js +7 -2
- package/esm/types/validation.js.map +1 -1
- package/esm/utils/bigInt.d.ts +1 -0
- package/esm/utils/bigInt.js +4 -0
- package/esm/utils/bigInt.js.map +1 -1
- package/esm/utils/helpers.d.ts +1 -0
- package/esm/utils/helpers.js +6 -0
- package/esm/utils/helpers.js.map +1 -1
- package/esm/utils/index.d.ts +0 -3
- package/esm/utils/index.js +0 -3
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/metrics.d.ts +4 -0
- package/esm/utils/metrics.js +29 -1
- package/esm/utils/metrics.js.map +1 -1
- package/esm/utils/rpc-reply.d.ts +1 -1
- package/esm/utils/rpc-reply.js +2 -1
- package/esm/utils/rpc-reply.js.map +1 -1
- package/esm/utils/userop.d.ts +66 -6
- package/esm/utils/userop.js +183 -96
- package/esm/utils/userop.js.map +1 -1
- package/esm/utils/validation.d.ts +1 -1
- package/esm/utils/validation.js +9 -13
- package/esm/utils/validation.js.map +1 -1
- package/lib/cli/alto.js +0 -4
- package/lib/cli/alto.js.map +1 -1
- package/lib/cli/config/bundler.d.ts +2296 -22
- package/lib/cli/config/bundler.js +30 -3
- package/lib/cli/config/bundler.js.map +1 -1
- package/lib/cli/config/options.js +53 -4
- package/lib/cli/config/options.js.map +1 -1
- package/lib/cli/customTransport.js +5 -1
- package/lib/cli/customTransport.js.map +1 -1
- package/lib/cli/handler.js +13 -2
- package/lib/cli/handler.js.map +1 -1
- package/lib/cli/instrumentation.js +2 -2
- package/lib/cli/instrumentation.js.map +1 -1
- package/lib/cli/setupServer.d.ts +2 -1
- package/lib/cli/setupServer.js +52 -28
- package/lib/cli/setupServer.js.map +1 -1
- package/lib/executor/executor.d.ts +7 -14
- package/lib/executor/executor.js +138 -128
- package/lib/executor/executor.js.map +1 -1
- package/lib/executor/executorManager.d.ts +58 -4
- package/lib/executor/executorManager.js +205 -51
- package/lib/executor/executorManager.js.map +1 -1
- package/lib/executor/senderManager.d.ts +2 -1
- package/lib/executor/senderManager.js +3 -0
- package/lib/executor/senderManager.js.map +1 -1
- package/lib/executor/utilityWalletMonitor.d.ts +15 -0
- package/lib/executor/utilityWalletMonitor.js +42 -0
- package/lib/executor/utilityWalletMonitor.js.map +1 -0
- package/lib/executor/utils.d.ts +1 -2
- package/lib/executor/utils.js +48 -37
- package/lib/executor/utils.js.map +1 -1
- package/lib/handlers/compressionHandler.js.map +1 -0
- package/lib/handlers/eventManager.d.ts +21 -0
- package/lib/handlers/eventManager.js +196 -0
- package/lib/handlers/eventManager.js.map +1 -0
- package/{esm/utils → lib/handlers}/gasPriceManager.d.ts +19 -5
- package/lib/{utils → handlers}/gasPriceManager.js +58 -13
- package/lib/handlers/gasPriceManager.js.map +1 -0
- package/lib/handlers/index.d.ts +4 -0
- package/lib/handlers/index.js +20 -0
- package/lib/handlers/index.js.map +1 -0
- package/lib/mempool/index.d.ts +0 -1
- package/lib/mempool/index.js +0 -1
- package/lib/mempool/index.js.map +1 -1
- package/lib/mempool/mempool.d.ts +4 -2
- package/lib/mempool/mempool.js +65 -19
- package/lib/mempool/mempool.js.map +1 -1
- package/lib/rpc/EntryPointSimulationsV07.d.ts +2 -2
- package/lib/rpc/EntryPointSimulationsV07.js +10 -7
- package/lib/rpc/EntryPointSimulationsV07.js.map +1 -1
- package/lib/rpc/gasEstimation.d.ts +3 -3
- package/lib/rpc/gasEstimation.js +22 -17
- package/lib/rpc/gasEstimation.js.map +1 -1
- package/lib/rpc/nonceQueuer.d.ts +4 -1
- package/lib/rpc/nonceQueuer.js +9 -3
- package/lib/rpc/nonceQueuer.js.map +1 -1
- package/lib/rpc/rpcHandler.d.ts +53 -3
- package/lib/rpc/rpcHandler.js +129 -251
- package/lib/rpc/rpcHandler.js.map +1 -1
- package/lib/rpc/server.d.ts +2 -1
- package/lib/rpc/server.js +6 -1
- package/lib/rpc/server.js.map +1 -1
- package/lib/rpc/validation/SafeValidator.d.ts +3 -2
- package/lib/rpc/validation/SafeValidator.js +2 -2
- package/lib/rpc/validation/SafeValidator.js.map +1 -1
- package/lib/rpc/validation/UnsafeValidator.d.ts +5 -2
- package/lib/rpc/validation/UnsafeValidator.js +33 -6
- package/lib/rpc/validation/UnsafeValidator.js.map +1 -1
- package/lib/rpc/validation/tracer.js +1 -0
- package/lib/rpc/validation/tracer.js.map +1 -1
- package/lib/types/schemas.d.ts +1029 -333
- package/lib/types/schemas.js +93 -19
- package/lib/types/schemas.js.map +1 -1
- package/lib/types/utils.d.ts +1 -1
- package/lib/types/validation.js +7 -2
- package/lib/types/validation.js.map +1 -1
- package/lib/utils/bigInt.d.ts +1 -0
- package/lib/utils/bigInt.js +6 -1
- package/lib/utils/bigInt.js.map +1 -1
- package/lib/utils/helpers.d.ts +1 -0
- package/lib/utils/helpers.js +8 -1
- package/lib/utils/helpers.js.map +1 -1
- package/lib/utils/index.d.ts +0 -3
- package/lib/utils/index.js +0 -3
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/metrics.d.ts +4 -0
- package/lib/utils/metrics.js +29 -1
- package/lib/utils/metrics.js.map +1 -1
- package/lib/utils/rpc-reply.d.ts +1 -1
- package/lib/utils/rpc-reply.js +2 -1
- package/lib/utils/rpc-reply.js.map +1 -1
- package/lib/utils/userop.d.ts +66 -6
- package/lib/utils/userop.js +208 -96
- package/lib/utils/userop.js.map +1 -1
- package/lib/utils/validation.d.ts +1 -1
- package/lib/utils/validation.js +9 -36
- package/lib/utils/validation.js.map +1 -1
- package/package.json +15 -14
- package/esm/executor/test/utils.d.ts +0 -13
- package/esm/executor/test/utils.js +0 -75
- package/esm/executor/test/utils.js.map +0 -1
- package/esm/mempool/nullMempool.d.ts +0 -15
- package/esm/mempool/nullMempool.js +0 -36
- package/esm/mempool/nullMempool.js.map +0 -1
- package/esm/types/test/validationTestErrors.d.ts +0 -3
- package/esm/types/test/validationTestErrors.js +0 -229
- package/esm/types/test/validationTestErrors.js.map +0 -1
- package/esm/utils/compressionHandler.js.map +0 -1
- package/esm/utils/gasPriceManager.js.map +0 -1
- package/esm/utils/test.d.ts +0 -17
- package/esm/utils/test.js +0 -130
- package/esm/utils/test.js.map +0 -1
- package/lib/executor/test/utils.d.ts +0 -13
- package/lib/executor/test/utils.js +0 -81
- package/lib/executor/test/utils.js.map +0 -1
- package/lib/mempool/nullMempool.d.ts +0 -15
- package/lib/mempool/nullMempool.js +0 -40
- package/lib/mempool/nullMempool.js.map +0 -1
- package/lib/types/test/validationTestErrors.d.ts +0 -3
- package/lib/types/test/validationTestErrors.js +0 -232
- package/lib/types/test/validationTestErrors.js.map +0 -1
- package/lib/utils/compressionHandler.js.map +0 -1
- package/lib/utils/gasPriceManager.js.map +0 -1
- package/lib/utils/test.d.ts +0 -17
- package/lib/utils/test.js +0 -161
- package/lib/utils/test.js.map +0 -1
- /package/esm/{utils → handlers}/compressionHandler.d.ts +0 -0
- /package/esm/{utils → handlers}/compressionHandler.js +0 -0
- /package/lib/{utils → handlers}/compressionHandler.d.ts +0 -0
- /package/lib/{utils → handlers}/compressionHandler.js +0 -0
package/esm/rpc/nonceQueuer.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type MempoolUserOperation } from "../types/index.js";
|
|
|
2
2
|
import type { Logger } from "../utils/index.js";
|
|
3
3
|
import { type Address, type Chain, type Hash, type PublicClient, type Transport } from "viem";
|
|
4
4
|
import type { MemoryMempool } from "../mempool/index.js";
|
|
5
|
+
import type { EventManager } from "../handlers/index.js";
|
|
5
6
|
type QueuedUserOperation = {
|
|
6
7
|
entryPoint: Address;
|
|
7
8
|
userOperationHash: Hash;
|
|
@@ -15,7 +16,9 @@ export declare class NonceQueuer {
|
|
|
15
16
|
mempool: MemoryMempool;
|
|
16
17
|
publicClient: PublicClient<Transport, Chain>;
|
|
17
18
|
logger: Logger;
|
|
18
|
-
|
|
19
|
+
blockTagSupport: boolean;
|
|
20
|
+
eventManager: EventManager;
|
|
21
|
+
constructor(mempool: MemoryMempool, publicClient: PublicClient<Transport, Chain>, logger: Logger, blockTagSupport: boolean, eventManager: EventManager);
|
|
19
22
|
process(): Promise<void>;
|
|
20
23
|
add(mempoolUserOperation: MempoolUserOperation, entryPoint: Address): void;
|
|
21
24
|
resubmitUserOperation(mempoolUserOperation: MempoolUserOperation, entryPoint: Address): void;
|
package/esm/rpc/nonceQueuer.js
CHANGED
|
@@ -6,10 +6,14 @@ export class NonceQueuer {
|
|
|
6
6
|
mempool;
|
|
7
7
|
publicClient;
|
|
8
8
|
logger;
|
|
9
|
-
|
|
9
|
+
blockTagSupport;
|
|
10
|
+
eventManager;
|
|
11
|
+
constructor(mempool, publicClient, logger, blockTagSupport, eventManager) {
|
|
10
12
|
this.mempool = mempool;
|
|
11
13
|
this.publicClient = publicClient;
|
|
12
14
|
this.logger = logger;
|
|
15
|
+
this.blockTagSupport = blockTagSupport;
|
|
16
|
+
this.eventManager = eventManager;
|
|
13
17
|
setInterval(() => {
|
|
14
18
|
this.process();
|
|
15
19
|
}, 2000);
|
|
@@ -39,14 +43,16 @@ export class NonceQueuer {
|
|
|
39
43
|
add(mempoolUserOperation, entryPoint) {
|
|
40
44
|
const userOperation = deriveUserOperation(mempoolUserOperation);
|
|
41
45
|
const [nonceKey, nonceValue] = getNonceKeyAndValue(userOperation.nonce);
|
|
46
|
+
const hash = getUserOperationHash(deriveUserOperation(mempoolUserOperation), entryPoint, this.publicClient.chain.id);
|
|
42
47
|
this.queuedUserOperations.push({
|
|
43
48
|
entryPoint,
|
|
44
|
-
userOperationHash:
|
|
49
|
+
userOperationHash: hash,
|
|
45
50
|
mempoolUserOperation: mempoolUserOperation,
|
|
46
51
|
nonceKey: nonceKey,
|
|
47
52
|
nonceValue: nonceValue,
|
|
48
53
|
addedAt: Date.now()
|
|
49
54
|
});
|
|
55
|
+
this.eventManager.emitQueued(hash);
|
|
50
56
|
}
|
|
51
57
|
resubmitUserOperation(mempoolUserOperation, entryPoint) {
|
|
52
58
|
const userOperation = mempoolUserOperation;
|
|
@@ -74,7 +80,7 @@ export class NonceQueuer {
|
|
|
74
80
|
args: [userOperation.sender, qop.nonceKey]
|
|
75
81
|
};
|
|
76
82
|
}),
|
|
77
|
-
blockTag: "latest"
|
|
83
|
+
blockTag: this.blockTagSupport ? "latest" : undefined
|
|
78
84
|
});
|
|
79
85
|
}
|
|
80
86
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nonceQueuer.js","sourceRoot":"","sources":["../../rpc/nonceQueuer.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAEhB,mBAAmB,EACnB,gBAAgB,EACnB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACH,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACd,MAAM,aAAa,CAAA;AACpB,OAAO,EAOH,WAAW,EACd,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"nonceQueuer.js","sourceRoot":"","sources":["../../rpc/nonceQueuer.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAEhB,mBAAmB,EACnB,gBAAgB,EACnB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACH,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACd,MAAM,aAAa,CAAA;AACpB,OAAO,EAOH,WAAW,EACd,MAAM,MAAM,CAAA;AAab,MAAM,OAAO,WAAW;IACpB,oBAAoB,GAA0B,EAAE,CAAA;IAEhD,OAAO,CAAe;IACtB,YAAY,CAAgC;IAC5C,MAAM,CAAQ;IACd,eAAe,CAAS;IACxB,YAAY,CAAc;IAE1B,YACI,OAAsB,EACtB,YAA4C,EAC5C,MAAc,EACd,eAAwB,EACxB,YAA0B;QAE1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;QACtC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;QAEhC,WAAW,CAAC,GAAG,EAAE;YACb,IAAI,CAAC,OAAO,EAAE,CAAA;QAClB,CAAC,EAAE,IAAI,CAAC,CAAA;IACZ,CAAC;IAED,KAAK,CAAC,OAAO;QACT,yEAAyE;QACzE,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE;YACjE,OAAO,GAAG,CA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AA;IAChC,CAAC;CACJ"}
|
package/esm/rpc/rpcHandler.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type { Executor, ExecutorManager } from "../executor/index.js";
|
|
|
2
2
|
import type { InterfaceReputationManager, MemoryMempool, Monitor } from "../mempool/index.js";
|
|
3
3
|
import type { ApiVersion, StateOverrides, GasPriceMultipliers, ChainType } from "../types/index.js";
|
|
4
4
|
import { type Address, type BundlerClearMempoolResponseResult, type BundlerClearStateResponseResult, type BundlerDumpMempoolResponseResult, type BundlerDumpReputationsResponseResult, type BundlerGetStakeStatusResponseResult, type BundlerRequest, type BundlerResponse, type BundlerSendBundleNowResponseResult, type BundlerSetBundlingModeResponseResult, type BundlerSetReputationsRequestParams, type BundlingMode, type ChainIdResponseResult, type EstimateUserOperationGasResponseResult, type GetUserOperationByHashResponseResult, type GetUserOperationReceiptResponseResult, type HexData32, type InterfaceValidator, type MempoolUserOperation, type PimlicoGetUserOperationGasPriceResponseResult, type PimlicoGetUserOperationStatusResponseResult, type SendUserOperationResponseResult, type SupportedEntryPointsResponseResult, type UserOperation } from "../types/index.js";
|
|
5
|
-
import type {
|
|
6
|
-
import {
|
|
5
|
+
import type { Logger, Metrics } from "../utils/index.js";
|
|
6
|
+
import type { GasPriceManager, CompressionHandler, EventManager } from "../handlers/index.js";
|
|
7
7
|
import { type Chain, type Hex, type PublicClient, type Transport } from "viem";
|
|
8
8
|
import type { NonceQueuer } from "./nonceQueuer.js";
|
|
9
9
|
export interface IRpcEndpoint {
|
|
@@ -38,8 +38,13 @@ export declare class RpcHandler implements IRpcEndpoint {
|
|
|
38
38
|
gasPriceManager: GasPriceManager;
|
|
39
39
|
gasPriceMultipliers: GasPriceMultipliers;
|
|
40
40
|
paymasterGasLimitMultiplier: bigint;
|
|
41
|
-
|
|
41
|
+
eventManager: EventManager;
|
|
42
|
+
enableInstantBundlingEndpoint: boolean;
|
|
43
|
+
constructor(entryPoints: Address[], publicClient: PublicClient<Transport, Chain>, validator: InterfaceValidator, mempool: MemoryMempool, executor: Executor, monitor: Monitor, nonceQueuer: NonceQueuer, executorManager: ExecutorManager, reputationManager: InterfaceReputationManager, usingTenderly: boolean, rpcMaxBlockRange: number | undefined, logger: Logger, metrics: Metrics, enableDebugEndpoints: boolean, compressionHandler: CompressionHandler | null, legacyTransactions: boolean, gasPriceManager: GasPriceManager, gasPriceMultipliers: GasPriceMultipliers, chainType: ChainType, paymasterGasLimitMultiplier: bigint, eventManager: EventManager, enableInstantBundlingEndpoint: boolean, dangerousSkipUserOperationValidation?: boolean);
|
|
42
44
|
handleMethod(request: BundlerRequest, apiVersion: ApiVersion): Promise<BundlerResponse>;
|
|
45
|
+
ensureEntryPointIsSupported(entryPoint: Address): void;
|
|
46
|
+
ensureDebugEndpointsAreEnabled(methodName: string): void;
|
|
47
|
+
preMempoolChecks(opHash: Hex, userOperation: UserOperation, apiVersion: ApiVersion, entryPoint: Address): Promise<void>;
|
|
43
48
|
eth_chainId(): ChainIdResponseResult;
|
|
44
49
|
eth_supportedEntryPoints(): SupportedEntryPointsResponseResult;
|
|
45
50
|
eth_estimateUserOperationGas(apiVersion: ApiVersion, userOperation: UserOperation, entryPoint: Address, stateOverrides?: StateOverrides): Promise<EstimateUserOperationGasResponseResult>;
|
|
@@ -57,6 +62,51 @@ export declare class RpcHandler implements IRpcEndpoint {
|
|
|
57
62
|
pimlico_getUserOperationStatus(userOperationHash: HexData32): PimlicoGetUserOperationStatusResponseResult;
|
|
58
63
|
pimlico_getUserOperationGasPrice(): Promise<PimlicoGetUserOperationGasPriceResponseResult>;
|
|
59
64
|
addToMempoolIfValid(op: MempoolUserOperation, entryPoint: Address, apiVersion: ApiVersion): Promise<"added" | "queued">;
|
|
65
|
+
pimlico_sendUserOperationNow(apiVersion: ApiVersion, userOperation: UserOperation, entryPoint: Address): Promise<{
|
|
66
|
+
sender: `0x${string}`;
|
|
67
|
+
nonce: bigint;
|
|
68
|
+
userOpHash: `0x${string}`;
|
|
69
|
+
success: boolean;
|
|
70
|
+
actualGasCost: bigint;
|
|
71
|
+
actualGasUsed: bigint;
|
|
72
|
+
entryPoint: `0x${string}`;
|
|
73
|
+
logs: {
|
|
74
|
+
address: `0x${string}`;
|
|
75
|
+
data: `0x${string}`;
|
|
76
|
+
blockNumber: bigint;
|
|
77
|
+
blockHash: `0x${string}`;
|
|
78
|
+
transactionHash: `0x${string}`;
|
|
79
|
+
logIndex: bigint;
|
|
80
|
+
transactionIndex: bigint;
|
|
81
|
+
topics: `0x${string}`[];
|
|
82
|
+
}[];
|
|
83
|
+
receipt: {
|
|
84
|
+
to: `0x${string}` | null;
|
|
85
|
+
gasUsed: bigint;
|
|
86
|
+
status: bigint | null;
|
|
87
|
+
blockNumber: bigint;
|
|
88
|
+
blockHash: `0x${string}`;
|
|
89
|
+
transactionHash: `0x${string}`;
|
|
90
|
+
transactionIndex: bigint;
|
|
91
|
+
from: `0x${string}`;
|
|
92
|
+
cumulativeGasUsed: bigint;
|
|
93
|
+
contractAddress: `0x${string}` | null;
|
|
94
|
+
logs: {
|
|
95
|
+
address: `0x${string}`;
|
|
96
|
+
data: `0x${string}`;
|
|
97
|
+
blockNumber: bigint;
|
|
98
|
+
blockHash: `0x${string}`;
|
|
99
|
+
transactionHash: `0x${string}`;
|
|
100
|
+
logIndex: bigint;
|
|
101
|
+
transactionIndex: bigint;
|
|
102
|
+
topics: `0x${string}`[];
|
|
103
|
+
}[];
|
|
104
|
+
logsBloom: string;
|
|
105
|
+
effectiveGasPrice?: bigint | null | undefined;
|
|
106
|
+
};
|
|
107
|
+
paymaster?: `0x${string}` | undefined;
|
|
108
|
+
reason?: `0x${string}` | undefined;
|
|
109
|
+
}>;
|
|
60
110
|
pimlico_sendCompressedUserOperation(apiVersion: ApiVersion, compressedCalldata: Hex, inflatorAddress: Address, entryPoint: Address): Promise<`0x${string}`>;
|
|
61
111
|
private validateAndInflateCompressedUserOperation;
|
|
62
112
|
getNonceValue(userOperation: UserOperation, entryPoint: Address): Promise<bigint>;
|