@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.
Files changed (227) hide show
  1. package/esm/cli/alto.js +0 -4
  2. package/esm/cli/alto.js.map +1 -1
  3. package/esm/cli/config/bundler.d.ts +2296 -22
  4. package/esm/cli/config/bundler.js +31 -4
  5. package/esm/cli/config/bundler.js.map +1 -1
  6. package/esm/cli/config/options.js +53 -4
  7. package/esm/cli/config/options.js.map +1 -1
  8. package/esm/cli/customTransport.js +5 -1
  9. package/esm/cli/customTransport.js.map +1 -1
  10. package/esm/cli/handler.js +14 -3
  11. package/esm/cli/handler.js.map +1 -1
  12. package/esm/cli/instrumentation.js +2 -2
  13. package/esm/cli/instrumentation.js.map +1 -1
  14. package/esm/cli/setupServer.d.ts +2 -1
  15. package/esm/cli/setupServer.js +51 -27
  16. package/esm/cli/setupServer.js.map +1 -1
  17. package/esm/executor/executor.d.ts +7 -14
  18. package/esm/executor/executor.js +139 -128
  19. package/esm/executor/executor.js.map +1 -1
  20. package/esm/executor/executorManager.d.ts +58 -4
  21. package/esm/executor/executorManager.js +207 -53
  22. package/esm/executor/executorManager.js.map +1 -1
  23. package/esm/executor/senderManager.d.ts +2 -1
  24. package/esm/executor/senderManager.js +3 -0
  25. package/esm/executor/senderManager.js.map +1 -1
  26. package/esm/executor/utilityWalletMonitor.d.ts +15 -0
  27. package/esm/executor/utilityWalletMonitor.js +38 -0
  28. package/esm/executor/utilityWalletMonitor.js.map +1 -0
  29. package/esm/executor/utils.d.ts +1 -2
  30. package/esm/executor/utils.js +49 -38
  31. package/esm/executor/utils.js.map +1 -1
  32. package/esm/handlers/compressionHandler.js.map +1 -0
  33. package/esm/handlers/eventManager.d.ts +21 -0
  34. package/esm/handlers/eventManager.js +166 -0
  35. package/esm/handlers/eventManager.js.map +1 -0
  36. package/{lib/utils → esm/handlers}/gasPriceManager.d.ts +19 -5
  37. package/esm/{utils → handlers}/gasPriceManager.js +58 -13
  38. package/esm/handlers/gasPriceManager.js.map +1 -0
  39. package/esm/handlers/index.d.ts +4 -0
  40. package/esm/handlers/index.js +4 -0
  41. package/esm/handlers/index.js.map +1 -0
  42. package/esm/mempool/index.d.ts +0 -1
  43. package/esm/mempool/index.js +0 -1
  44. package/esm/mempool/index.js.map +1 -1
  45. package/esm/mempool/mempool.d.ts +4 -2
  46. package/esm/mempool/mempool.js +65 -19
  47. package/esm/mempool/mempool.js.map +1 -1
  48. package/esm/rpc/EntryPointSimulationsV07.d.ts +2 -2
  49. package/esm/rpc/EntryPointSimulationsV07.js +10 -7
  50. package/esm/rpc/EntryPointSimulationsV07.js.map +1 -1
  51. package/esm/rpc/gasEstimation.d.ts +3 -3
  52. package/esm/rpc/gasEstimation.js +22 -17
  53. package/esm/rpc/gasEstimation.js.map +1 -1
  54. package/esm/rpc/nonceQueuer.d.ts +4 -1
  55. package/esm/rpc/nonceQueuer.js +9 -3
  56. package/esm/rpc/nonceQueuer.js.map +1 -1
  57. package/esm/rpc/rpcHandler.d.ts +53 -3
  58. package/esm/rpc/rpcHandler.js +132 -231
  59. package/esm/rpc/rpcHandler.js.map +1 -1
  60. package/esm/rpc/server.d.ts +2 -1
  61. package/esm/rpc/server.js +6 -1
  62. package/esm/rpc/server.js.map +1 -1
  63. package/esm/rpc/validation/SafeValidator.d.ts +3 -2
  64. package/esm/rpc/validation/SafeValidator.js +2 -2
  65. package/esm/rpc/validation/SafeValidator.js.map +1 -1
  66. package/esm/rpc/validation/UnsafeValidator.d.ts +5 -2
  67. package/esm/rpc/validation/UnsafeValidator.js +10 -6
  68. package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
  69. package/esm/rpc/validation/tracer.js +1 -0
  70. package/esm/rpc/validation/tracer.js.map +1 -1
  71. package/esm/types/schemas.d.ts +1029 -333
  72. package/esm/types/schemas.js +94 -20
  73. package/esm/types/schemas.js.map +1 -1
  74. package/esm/types/utils.d.ts +1 -1
  75. package/esm/types/validation.js +7 -2
  76. package/esm/types/validation.js.map +1 -1
  77. package/esm/utils/bigInt.d.ts +1 -0
  78. package/esm/utils/bigInt.js +4 -0
  79. package/esm/utils/bigInt.js.map +1 -1
  80. package/esm/utils/helpers.d.ts +1 -0
  81. package/esm/utils/helpers.js +6 -0
  82. package/esm/utils/helpers.js.map +1 -1
  83. package/esm/utils/index.d.ts +0 -3
  84. package/esm/utils/index.js +0 -3
  85. package/esm/utils/index.js.map +1 -1
  86. package/esm/utils/metrics.d.ts +4 -0
  87. package/esm/utils/metrics.js +29 -1
  88. package/esm/utils/metrics.js.map +1 -1
  89. package/esm/utils/rpc-reply.d.ts +1 -1
  90. package/esm/utils/rpc-reply.js +2 -1
  91. package/esm/utils/rpc-reply.js.map +1 -1
  92. package/esm/utils/userop.d.ts +66 -6
  93. package/esm/utils/userop.js +183 -96
  94. package/esm/utils/userop.js.map +1 -1
  95. package/esm/utils/validation.d.ts +1 -1
  96. package/esm/utils/validation.js +9 -13
  97. package/esm/utils/validation.js.map +1 -1
  98. package/lib/cli/alto.js +0 -4
  99. package/lib/cli/alto.js.map +1 -1
  100. package/lib/cli/config/bundler.d.ts +2296 -22
  101. package/lib/cli/config/bundler.js +30 -3
  102. package/lib/cli/config/bundler.js.map +1 -1
  103. package/lib/cli/config/options.js +53 -4
  104. package/lib/cli/config/options.js.map +1 -1
  105. package/lib/cli/customTransport.js +5 -1
  106. package/lib/cli/customTransport.js.map +1 -1
  107. package/lib/cli/handler.js +13 -2
  108. package/lib/cli/handler.js.map +1 -1
  109. package/lib/cli/instrumentation.js +2 -2
  110. package/lib/cli/instrumentation.js.map +1 -1
  111. package/lib/cli/setupServer.d.ts +2 -1
  112. package/lib/cli/setupServer.js +52 -28
  113. package/lib/cli/setupServer.js.map +1 -1
  114. package/lib/executor/executor.d.ts +7 -14
  115. package/lib/executor/executor.js +138 -128
  116. package/lib/executor/executor.js.map +1 -1
  117. package/lib/executor/executorManager.d.ts +58 -4
  118. package/lib/executor/executorManager.js +205 -51
  119. package/lib/executor/executorManager.js.map +1 -1
  120. package/lib/executor/senderManager.d.ts +2 -1
  121. package/lib/executor/senderManager.js +3 -0
  122. package/lib/executor/senderManager.js.map +1 -1
  123. package/lib/executor/utilityWalletMonitor.d.ts +15 -0
  124. package/lib/executor/utilityWalletMonitor.js +42 -0
  125. package/lib/executor/utilityWalletMonitor.js.map +1 -0
  126. package/lib/executor/utils.d.ts +1 -2
  127. package/lib/executor/utils.js +48 -37
  128. package/lib/executor/utils.js.map +1 -1
  129. package/lib/handlers/compressionHandler.js.map +1 -0
  130. package/lib/handlers/eventManager.d.ts +21 -0
  131. package/lib/handlers/eventManager.js +196 -0
  132. package/lib/handlers/eventManager.js.map +1 -0
  133. package/{esm/utils → lib/handlers}/gasPriceManager.d.ts +19 -5
  134. package/lib/{utils → handlers}/gasPriceManager.js +58 -13
  135. package/lib/handlers/gasPriceManager.js.map +1 -0
  136. package/lib/handlers/index.d.ts +4 -0
  137. package/lib/handlers/index.js +20 -0
  138. package/lib/handlers/index.js.map +1 -0
  139. package/lib/mempool/index.d.ts +0 -1
  140. package/lib/mempool/index.js +0 -1
  141. package/lib/mempool/index.js.map +1 -1
  142. package/lib/mempool/mempool.d.ts +4 -2
  143. package/lib/mempool/mempool.js +65 -19
  144. package/lib/mempool/mempool.js.map +1 -1
  145. package/lib/rpc/EntryPointSimulationsV07.d.ts +2 -2
  146. package/lib/rpc/EntryPointSimulationsV07.js +10 -7
  147. package/lib/rpc/EntryPointSimulationsV07.js.map +1 -1
  148. package/lib/rpc/gasEstimation.d.ts +3 -3
  149. package/lib/rpc/gasEstimation.js +22 -17
  150. package/lib/rpc/gasEstimation.js.map +1 -1
  151. package/lib/rpc/nonceQueuer.d.ts +4 -1
  152. package/lib/rpc/nonceQueuer.js +9 -3
  153. package/lib/rpc/nonceQueuer.js.map +1 -1
  154. package/lib/rpc/rpcHandler.d.ts +53 -3
  155. package/lib/rpc/rpcHandler.js +129 -251
  156. package/lib/rpc/rpcHandler.js.map +1 -1
  157. package/lib/rpc/server.d.ts +2 -1
  158. package/lib/rpc/server.js +6 -1
  159. package/lib/rpc/server.js.map +1 -1
  160. package/lib/rpc/validation/SafeValidator.d.ts +3 -2
  161. package/lib/rpc/validation/SafeValidator.js +2 -2
  162. package/lib/rpc/validation/SafeValidator.js.map +1 -1
  163. package/lib/rpc/validation/UnsafeValidator.d.ts +5 -2
  164. package/lib/rpc/validation/UnsafeValidator.js +33 -6
  165. package/lib/rpc/validation/UnsafeValidator.js.map +1 -1
  166. package/lib/rpc/validation/tracer.js +1 -0
  167. package/lib/rpc/validation/tracer.js.map +1 -1
  168. package/lib/types/schemas.d.ts +1029 -333
  169. package/lib/types/schemas.js +93 -19
  170. package/lib/types/schemas.js.map +1 -1
  171. package/lib/types/utils.d.ts +1 -1
  172. package/lib/types/validation.js +7 -2
  173. package/lib/types/validation.js.map +1 -1
  174. package/lib/utils/bigInt.d.ts +1 -0
  175. package/lib/utils/bigInt.js +6 -1
  176. package/lib/utils/bigInt.js.map +1 -1
  177. package/lib/utils/helpers.d.ts +1 -0
  178. package/lib/utils/helpers.js +8 -1
  179. package/lib/utils/helpers.js.map +1 -1
  180. package/lib/utils/index.d.ts +0 -3
  181. package/lib/utils/index.js +0 -3
  182. package/lib/utils/index.js.map +1 -1
  183. package/lib/utils/metrics.d.ts +4 -0
  184. package/lib/utils/metrics.js +29 -1
  185. package/lib/utils/metrics.js.map +1 -1
  186. package/lib/utils/rpc-reply.d.ts +1 -1
  187. package/lib/utils/rpc-reply.js +2 -1
  188. package/lib/utils/rpc-reply.js.map +1 -1
  189. package/lib/utils/userop.d.ts +66 -6
  190. package/lib/utils/userop.js +208 -96
  191. package/lib/utils/userop.js.map +1 -1
  192. package/lib/utils/validation.d.ts +1 -1
  193. package/lib/utils/validation.js +9 -36
  194. package/lib/utils/validation.js.map +1 -1
  195. package/package.json +15 -14
  196. package/esm/executor/test/utils.d.ts +0 -13
  197. package/esm/executor/test/utils.js +0 -75
  198. package/esm/executor/test/utils.js.map +0 -1
  199. package/esm/mempool/nullMempool.d.ts +0 -15
  200. package/esm/mempool/nullMempool.js +0 -36
  201. package/esm/mempool/nullMempool.js.map +0 -1
  202. package/esm/types/test/validationTestErrors.d.ts +0 -3
  203. package/esm/types/test/validationTestErrors.js +0 -229
  204. package/esm/types/test/validationTestErrors.js.map +0 -1
  205. package/esm/utils/compressionHandler.js.map +0 -1
  206. package/esm/utils/gasPriceManager.js.map +0 -1
  207. package/esm/utils/test.d.ts +0 -17
  208. package/esm/utils/test.js +0 -130
  209. package/esm/utils/test.js.map +0 -1
  210. package/lib/executor/test/utils.d.ts +0 -13
  211. package/lib/executor/test/utils.js +0 -81
  212. package/lib/executor/test/utils.js.map +0 -1
  213. package/lib/mempool/nullMempool.d.ts +0 -15
  214. package/lib/mempool/nullMempool.js +0 -40
  215. package/lib/mempool/nullMempool.js.map +0 -1
  216. package/lib/types/test/validationTestErrors.d.ts +0 -3
  217. package/lib/types/test/validationTestErrors.js +0 -232
  218. package/lib/types/test/validationTestErrors.js.map +0 -1
  219. package/lib/utils/compressionHandler.js.map +0 -1
  220. package/lib/utils/gasPriceManager.js.map +0 -1
  221. package/lib/utils/test.d.ts +0 -17
  222. package/lib/utils/test.js +0 -161
  223. package/lib/utils/test.js.map +0 -1
  224. /package/esm/{utils → handlers}/compressionHandler.d.ts +0 -0
  225. /package/esm/{utils → handlers}/compressionHandler.js +0 -0
  226. /package/lib/{utils → handlers}/compressionHandler.d.ts +0 -0
  227. /package/lib/{utils → handlers}/compressionHandler.js +0 -0
@@ -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
- constructor(mempool: MemoryMempool, publicClient: PublicClient<Transport, Chain>, logger: Logger);
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;
@@ -6,10 +6,14 @@ export class NonceQueuer {
6
6
  mempool;
7
7
  publicClient;
8
8
  logger;
9
- constructor(mempool, publicClient, logger) {
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: getUserOperationHash(deriveUserOperation(mempoolUserOperation), entryPoint, this.publicClient.chain.id),
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;AAYb,MAAM,OAAO,WAAW;IACpB,oBAAoB,GAA0B,EAAE,CAAA;IAEhD,OAAO,CAAe;IACtB,YAAY,CAAgC;IAC5C,MAAM,CAAQ;IAEd,YACI,OAAsB,EACtB,YAA4C,EAC5C,MAAc;QAEd,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QAEpB,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,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,CAAA;QACpD,CAAC,CAAC,CAAA;QAEF,IAAI,IAAI,CAAC,oBAAoB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzC,OAAM;QACV,CAAC;QAED,MAAM,YAAY,GAAG,MAAM,I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AAA;QAEvD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,oBAAoB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACnD,MAAM,GAAG,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAA;YACnC,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;YAEzB,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBAC9B,IAAI,CAAC,MAAM,CAAC,KAAK,CACb,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,EACvB,sBAAsB,CACzB,CAAA;gBACD,SAAQ;YACZ,CAAC;YAED,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAA;YAEvC,IAAI,iBAAiB,KAAK,GAAG,CAAC,UAAU,EAAE,CAAC;gBACvC,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACnC,CAAC;QACL,CAAC;QAED,OAAO,qBAAqB,CAAA;IAChC,CAAC;CACJ"}
@@ -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 { GasPriceManager, Logger, Metrics } from "../utils/index.js";
6
- import { type CompressionHandler } from "../utils/index.js";
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
- 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, dangerousSkipUserOperationValidation?: boolean);
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>;