@pimlico/alto 0.0.0-main.20250422T210948 → 0.0.0-main.20250428T104157

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 (49) hide show
  1. package/esm/executor/executorManager.js +5 -5
  2. package/esm/executor/executorManager.js.map +1 -1
  3. package/esm/handlers/eventManager.d.ts +11 -10
  4. package/esm/handlers/eventManager.js +58 -40
  5. package/esm/handlers/eventManager.js.map +1 -1
  6. package/esm/mempool/mempool.js +1 -2
  7. package/esm/mempool/mempool.js.map +1 -1
  8. package/esm/rpc/methods/eth_sendUserOperation.js +1 -1
  9. package/esm/rpc/methods/eth_sendUserOperation.js.map +1 -1
  10. package/esm/rpc/rpcHandler.js +0 -3
  11. package/esm/rpc/rpcHandler.js.map +1 -1
  12. package/esm/rpc/validation/SafeValidator.d.ts +1 -2
  13. package/esm/rpc/validation/SafeValidator.js +2 -25
  14. package/esm/rpc/validation/SafeValidator.js.map +1 -1
  15. package/esm/rpc/validation/UnsafeValidator.d.ts +1 -2
  16. package/esm/rpc/validation/UnsafeValidator.js +2 -25
  17. package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
  18. package/esm/types/interfaces.d.ts +0 -1
  19. package/esm/utils/asyncTimeout.d.ts +5 -0
  20. package/esm/utils/asyncTimeout.js +23 -0
  21. package/esm/utils/asyncTimeout.js.map +1 -0
  22. package/esm/utils/index.d.ts +1 -0
  23. package/esm/utils/index.js +1 -0
  24. package/esm/utils/index.js.map +1 -1
  25. package/lib/executor/executorManager.js +5 -5
  26. package/lib/executor/executorManager.js.map +1 -1
  27. package/lib/handlers/eventManager.d.ts +11 -10
  28. package/lib/handlers/eventManager.js +58 -40
  29. package/lib/handlers/eventManager.js.map +1 -1
  30. package/lib/mempool/mempool.js +1 -2
  31. package/lib/mempool/mempool.js.map +1 -1
  32. package/lib/rpc/methods/eth_sendUserOperation.js +1 -1
  33. package/lib/rpc/methods/eth_sendUserOperation.js.map +1 -1
  34. package/lib/rpc/rpcHandler.js +0 -3
  35. package/lib/rpc/rpcHandler.js.map +1 -1
  36. package/lib/rpc/validation/SafeValidator.d.ts +1 -2
  37. package/lib/rpc/validation/SafeValidator.js +1 -24
  38. package/lib/rpc/validation/SafeValidator.js.map +1 -1
  39. package/lib/rpc/validation/UnsafeValidator.d.ts +1 -2
  40. package/lib/rpc/validation/UnsafeValidator.js +1 -24
  41. package/lib/rpc/validation/UnsafeValidator.js.map +1 -1
  42. package/lib/types/interfaces.d.ts +0 -1
  43. package/lib/utils/asyncTimeout.d.ts +5 -0
  44. package/lib/utils/asyncTimeout.js +51 -0
  45. package/lib/utils/asyncTimeout.js.map +1 -0
  46. package/lib/utils/index.d.ts +1 -0
  47. package/lib/utils/index.js +1 -0
  48. package/lib/utils/index.js.map +1 -1
  49. package/package.json +1 -1
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.asyncCallWithTimeout = exports.AsyncTimeoutError = void 0;
27
+ const opentelemetry = __importStar(require("@opentelemetry/api"));
28
+ class AsyncTimeoutError extends Error {
29
+ constructor() {
30
+ super("Operation timed out");
31
+ this.name = "AsyncTimeoutError";
32
+ }
33
+ }
34
+ exports.AsyncTimeoutError = AsyncTimeoutError;
35
+ const asyncCallWithTimeout = async (asyncPromise, timeLimit) => {
36
+ let timeoutHandle;
37
+ const timeoutPromise = new Promise((_resolve, reject) => {
38
+ timeoutHandle = setTimeout(() => reject(new AsyncTimeoutError()), timeLimit);
39
+ });
40
+ return Promise.race([asyncPromise, timeoutPromise])
41
+ .then((result) => {
42
+ clearTimeout(timeoutHandle);
43
+ return result;
44
+ })
45
+ .catch((error) => {
46
+ opentelemetry.trace.getActiveSpan()?.recordException(error);
47
+ throw error;
48
+ });
49
+ };
50
+ exports.asyncCallWithTimeout = asyncCallWithTimeout;
51
+ //# sourceMappingURL=asyncTimeout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncTimeout.js","sourceRoot":"","sources":["../../utils/asyncTimeout.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kEAAmD;AAEnD,MAAa,iBAAkB,SAAQ,KAAK;IACxC;QACI,KAAK,CAAC,qBAAqB,CAAC,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAA;IACnC,CAAC;CACJ;AALD,8CAKC;AAEM,MAAM,oBAAoB,GAAG,KAAK,EACrC,YAAwB,EACxB,SAAiB,EACP,EAAE;IACZ,IAAI,aAA4C,CAAA;IAEhD,MAAM,cAAc,GAAG,IAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE;QACpD,aAAa,GAAG,UAAU,CACtB,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,iBAAiB,EAAE,CAAC,EACrC,SAAS,CACZ,CAAA;IACL,CAAC,CAAC,CAAA;IAEF,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;SAC9C,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;QACb,YAAY,CAAC,aAAa,CAAC,CAAA;QAC3B,OAAO,MAAW,CAAA;IACtB,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACb,aAAa,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,CAAA;QAC3D,MAAM,KAAK,CAAA;IACf,CAAC,CAAC,CAAA;AACV,CAAC,CAAA;AAtBY,QAAA,oBAAoB,wBAsBhC"}
@@ -4,5 +4,6 @@ export * from "./bigInt.js";
4
4
  export * from "./validation.js";
5
5
  export * from "./userop.js";
6
6
  export * from "./helpers.js";
7
+ export * from "./asyncTimeout.js";
7
8
  export { Logger } from "pino";
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -20,4 +20,5 @@ __exportStar(require("./bigInt.js"), exports);
20
20
  __exportStar(require("./validation.js"), exports);
21
21
  __exportStar(require("./userop.js"), exports);
22
22
  __exportStar(require("./helpers.js"), exports);
23
+ __exportStar(require("./asyncTimeout.js"), exports);
23
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,4CAAyB;AACzB,2CAAwB;AACxB,+CAA4B;AAC5B,2CAAwB;AACxB,4CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,4CAAyB;AACzB,2CAAwB;AACxB,+CAA4B;AAC5B,2CAAwB;AACxB,4CAAyB;AACzB,iDAA8B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pimlico/alto",
3
- "version": "0.0.0-main.20250422T210948",
3
+ "version": "0.0.0-main.20250428T104157",
4
4
  "description": "A performant and modular ERC-4337 Bundler written in Typescript",
5
5
  "repository": "https://github.com/pimlicolabs/alto.git",
6
6
  "author": "Pimlico",