@metamask-previews/user-operation-controller 41.2.9-preview-4f4c98e → 41.2.9-preview-5b293ee50

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 (155) hide show
  1. package/CHANGELOG.md +0 -4
  2. package/dist/BlockTrackerPollingController.cjs +68 -0
  3. package/dist/BlockTrackerPollingController.cjs.map +1 -0
  4. package/dist/{BlockTrackerPollingController.d.ts → BlockTrackerPollingController.d.cts} +11 -11
  5. package/dist/BlockTrackerPollingController.d.cts.map +1 -0
  6. package/dist/BlockTrackerPollingController.d.mts +41 -0
  7. package/dist/BlockTrackerPollingController.d.mts.map +1 -0
  8. package/dist/{BlockTrackerPollingController.js → BlockTrackerPollingController.mjs} +16 -17
  9. package/dist/BlockTrackerPollingController.mjs.map +1 -0
  10. package/dist/UserOperationController-method-action-types.cjs +7 -0
  11. package/dist/UserOperationController-method-action-types.cjs.map +1 -0
  12. package/dist/{UserOperationController-method-action-types.d.ts → UserOperationController-method-action-types.d.cts} +2 -2
  13. package/dist/UserOperationController-method-action-types.d.cts.map +1 -0
  14. package/dist/UserOperationController-method-action-types.d.mts +57 -0
  15. package/dist/UserOperationController-method-action-types.d.mts.map +1 -0
  16. package/dist/{UserOperationController-method-action-types.js → UserOperationController-method-action-types.mjs} +1 -1
  17. package/dist/UserOperationController-method-action-types.mjs.map +1 -0
  18. package/dist/UserOperationController.cjs +495 -0
  19. package/dist/UserOperationController.cjs.map +1 -0
  20. package/dist/{UserOperationController.d.ts → UserOperationController.d.cts} +15 -13
  21. package/dist/UserOperationController.d.cts.map +1 -0
  22. package/dist/UserOperationController.d.mts +136 -0
  23. package/dist/UserOperationController.d.mts.map +1 -0
  24. package/dist/{UserOperationController.js → UserOperationController.mjs} +20 -19
  25. package/dist/UserOperationController.mjs.map +1 -0
  26. package/dist/constants.cjs +7 -0
  27. package/dist/constants.cjs.map +1 -0
  28. package/dist/{constants.d.ts → constants.d.cts} +1 -1
  29. package/dist/constants.d.cts.map +1 -0
  30. package/dist/constants.d.mts +4 -0
  31. package/dist/constants.d.mts.map +1 -0
  32. package/dist/{constants.js → constants.mjs} +1 -1
  33. package/dist/constants.mjs.map +1 -0
  34. package/dist/helpers/Bundler.cjs +91 -0
  35. package/dist/helpers/Bundler.cjs.map +1 -0
  36. package/dist/helpers/{Bundler.d.ts → Bundler.d.cts} +2 -2
  37. package/dist/helpers/Bundler.d.cts.map +1 -0
  38. package/dist/helpers/Bundler.d.mts +46 -0
  39. package/dist/helpers/Bundler.d.mts.map +1 -0
  40. package/dist/helpers/{Bundler.js → Bundler.mjs} +2 -2
  41. package/dist/helpers/Bundler.mjs.map +1 -0
  42. package/dist/helpers/PendingUserOperationTracker.cjs +127 -0
  43. package/dist/helpers/PendingUserOperationTracker.cjs.map +1 -0
  44. package/dist/helpers/{PendingUserOperationTracker.d.ts → PendingUserOperationTracker.d.cts} +12 -10
  45. package/dist/helpers/PendingUserOperationTracker.d.cts.map +1 -0
  46. package/dist/helpers/PendingUserOperationTracker.d.mts +51 -0
  47. package/dist/helpers/PendingUserOperationTracker.d.mts.map +1 -0
  48. package/dist/helpers/{PendingUserOperationTracker.js → PendingUserOperationTracker.mjs} +16 -9
  49. package/dist/helpers/PendingUserOperationTracker.mjs.map +1 -0
  50. package/dist/helpers/SnapSmartContractAccount.cjs +64 -0
  51. package/dist/helpers/SnapSmartContractAccount.cjs.map +1 -0
  52. package/dist/helpers/{SnapSmartContractAccount.d.ts → SnapSmartContractAccount.d.cts} +3 -3
  53. package/dist/helpers/SnapSmartContractAccount.d.cts.map +1 -0
  54. package/dist/helpers/SnapSmartContractAccount.d.mts +10 -0
  55. package/dist/helpers/SnapSmartContractAccount.d.mts.map +1 -0
  56. package/dist/helpers/{SnapSmartContractAccount.js → SnapSmartContractAccount.mjs} +3 -3
  57. package/dist/helpers/SnapSmartContractAccount.mjs.map +1 -0
  58. package/dist/index.cjs +19 -0
  59. package/dist/index.cjs.map +1 -0
  60. package/dist/index.d.cts +4 -0
  61. package/dist/index.d.cts.map +1 -0
  62. package/dist/index.d.mts +4 -0
  63. package/dist/index.d.mts.map +1 -0
  64. package/dist/index.mjs +3 -0
  65. package/dist/index.mjs.map +1 -0
  66. package/dist/logger.cjs +8 -0
  67. package/dist/logger.cjs.map +1 -0
  68. package/dist/logger.d.cts +5 -0
  69. package/dist/logger.d.cts.map +1 -0
  70. package/dist/logger.d.mts +5 -0
  71. package/dist/logger.d.mts.map +1 -0
  72. package/dist/{logger.js → logger.mjs} +2 -2
  73. package/dist/logger.mjs.map +1 -0
  74. package/dist/types.cjs +16 -0
  75. package/dist/types.cjs.map +1 -0
  76. package/dist/{types.d.ts → types.d.cts} +3 -3
  77. package/dist/types.d.cts.map +1 -0
  78. package/dist/types.d.mts +294 -0
  79. package/dist/types.d.mts.map +1 -0
  80. package/dist/{types.js → types.mjs} +1 -1
  81. package/dist/types.mjs.map +1 -0
  82. package/dist/utils/chain-id.cjs +17 -0
  83. package/dist/utils/chain-id.cjs.map +1 -0
  84. package/dist/utils/{chain-id.d.ts → chain-id.d.cts} +1 -1
  85. package/dist/utils/chain-id.d.cts.map +1 -0
  86. package/dist/utils/chain-id.d.mts +8 -0
  87. package/dist/utils/chain-id.d.mts.map +1 -0
  88. package/dist/utils/{chain-id.js → chain-id.mjs} +1 -1
  89. package/dist/utils/chain-id.mjs.map +1 -0
  90. package/dist/utils/gas-fees.cjs +194 -0
  91. package/dist/utils/gas-fees.cjs.map +1 -0
  92. package/dist/utils/{gas-fees.d.ts → gas-fees.d.cts} +6 -6
  93. package/dist/utils/gas-fees.d.cts.map +1 -0
  94. package/dist/utils/gas-fees.d.mts +24 -0
  95. package/dist/utils/gas-fees.d.mts.map +1 -0
  96. package/dist/utils/{gas-fees.js → gas-fees.mjs} +15 -8
  97. package/dist/utils/gas-fees.mjs.map +1 -0
  98. package/dist/utils/gas.cjs +72 -0
  99. package/dist/utils/gas.cjs.map +1 -0
  100. package/dist/utils/{gas.d.ts → gas.d.cts} +2 -2
  101. package/dist/utils/gas.d.cts.map +1 -0
  102. package/dist/utils/gas.d.mts +10 -0
  103. package/dist/utils/gas.d.mts.map +1 -0
  104. package/dist/utils/{gas.js → gas.mjs} +14 -7
  105. package/dist/utils/gas.mjs.map +1 -0
  106. package/dist/utils/transaction.cjs +117 -0
  107. package/dist/utils/transaction.cjs.map +1 -0
  108. package/dist/utils/{transaction.d.ts → transaction.d.cts} +3 -3
  109. package/dist/utils/transaction.d.cts.map +1 -0
  110. package/dist/utils/transaction.d.mts +10 -0
  111. package/dist/utils/transaction.d.mts.map +1 -0
  112. package/dist/utils/{transaction.js → transaction.mjs} +13 -6
  113. package/dist/utils/transaction.mjs.map +1 -0
  114. package/dist/utils/validation.cjs +162 -0
  115. package/dist/utils/validation.cjs.map +1 -0
  116. package/dist/utils/{validation.d.ts → validation.d.cts} +3 -3
  117. package/dist/utils/validation.d.cts.map +1 -0
  118. package/dist/utils/validation.d.mts +33 -0
  119. package/dist/utils/validation.d.mts.map +1 -0
  120. package/dist/utils/{validation.js → validation.mjs} +5 -5
  121. package/dist/utils/validation.mjs.map +1 -0
  122. package/package.json +17 -13
  123. package/dist/BlockTrackerPollingController.d.ts.map +0 -1
  124. package/dist/BlockTrackerPollingController.js.map +0 -1
  125. package/dist/UserOperationController-method-action-types.d.ts.map +0 -1
  126. package/dist/UserOperationController-method-action-types.js.map +0 -1
  127. package/dist/UserOperationController.d.ts.map +0 -1
  128. package/dist/UserOperationController.js.map +0 -1
  129. package/dist/constants.d.ts.map +0 -1
  130. package/dist/constants.js.map +0 -1
  131. package/dist/helpers/Bundler.d.ts.map +0 -1
  132. package/dist/helpers/Bundler.js.map +0 -1
  133. package/dist/helpers/PendingUserOperationTracker.d.ts.map +0 -1
  134. package/dist/helpers/PendingUserOperationTracker.js.map +0 -1
  135. package/dist/helpers/SnapSmartContractAccount.d.ts.map +0 -1
  136. package/dist/helpers/SnapSmartContractAccount.js.map +0 -1
  137. package/dist/index.d.ts +0 -4
  138. package/dist/index.d.ts.map +0 -1
  139. package/dist/index.js +0 -3
  140. package/dist/index.js.map +0 -1
  141. package/dist/logger.d.ts +0 -4
  142. package/dist/logger.d.ts.map +0 -1
  143. package/dist/logger.js.map +0 -1
  144. package/dist/types.d.ts.map +0 -1
  145. package/dist/types.js.map +0 -1
  146. package/dist/utils/chain-id.d.ts.map +0 -1
  147. package/dist/utils/chain-id.js.map +0 -1
  148. package/dist/utils/gas-fees.d.ts.map +0 -1
  149. package/dist/utils/gas-fees.js.map +0 -1
  150. package/dist/utils/gas.d.ts.map +0 -1
  151. package/dist/utils/gas.js.map +0 -1
  152. package/dist/utils/transaction.d.ts.map +0 -1
  153. package/dist/utils/transaction.js.map +0 -1
  154. package/dist/utils/validation.d.ts.map +0 -1
  155. package/dist/utils/validation.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -7,10 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ### Changed
11
-
12
- - **BREAKING:** Bump minimum Node.js version to 22 ([#9168](https://github.com/MetaMask/core/pull/9168))
13
-
14
10
  ## [41.2.9]
15
11
 
16
12
  ### Changed
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.BlockTrackerPollingController = exports.BlockTrackerPollingControllerOnly = void 0;
9
+ const base_controller_1 = require("@metamask/base-controller");
10
+ const polling_controller_1 = require("@metamask/polling-controller");
11
+ /**
12
+ * BlockTrackerPollingControllerMixin
13
+ * A polling controller that polls using a block tracker.
14
+ *
15
+ * @param Base - The base class to mix onto.
16
+ * @returns The composed class.
17
+ */
18
+ // This is a function that's used as class, and the return type is inferred from
19
+ // the class defined inside the function scope, so this can't be easily typed.
20
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/naming-convention
21
+ function BlockTrackerPollingControllerMixin(Base) {
22
+ var _BlockTrackerPollingController_activeListeners;
23
+ class BlockTrackerPollingController extends (0, polling_controller_1.AbstractPollingControllerBaseMixin)(Base) {
24
+ constructor() {
25
+ super(...arguments);
26
+ _BlockTrackerPollingController_activeListeners.set(this, {});
27
+ }
28
+ _startPolling(input) {
29
+ const key = (0, polling_controller_1.getKey)(input);
30
+ if (__classPrivateFieldGet(this, _BlockTrackerPollingController_activeListeners, "f")[key]) {
31
+ return;
32
+ }
33
+ const networkClient = this._getNetworkClientById(input.networkClientId);
34
+ if (networkClient) {
35
+ const updateOnNewBlock = this._executePoll.bind(this, input);
36
+ // TODO: Either fix this lint violation or explain why it's necessary to ignore.
37
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
38
+ networkClient.blockTracker.addListener('latest', updateOnNewBlock);
39
+ __classPrivateFieldGet(this, _BlockTrackerPollingController_activeListeners, "f")[key] = updateOnNewBlock;
40
+ }
41
+ else {
42
+ throw new Error(`Unable to retrieve blockTracker for networkClientId ${input.networkClientId}`);
43
+ }
44
+ }
45
+ _stopPollingByPollingTokenSetId(key) {
46
+ const { networkClientId } = JSON.parse(key);
47
+ const networkClient = this._getNetworkClientById(networkClientId);
48
+ if (networkClient && __classPrivateFieldGet(this, _BlockTrackerPollingController_activeListeners, "f")[key]) {
49
+ const listener = __classPrivateFieldGet(this, _BlockTrackerPollingController_activeListeners, "f")[key];
50
+ if (listener) {
51
+ // TODO: Either fix this lint violation or explain why it's necessary to ignore.
52
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
53
+ networkClient.blockTracker.removeListener('latest', listener);
54
+ delete __classPrivateFieldGet(this, _BlockTrackerPollingController_activeListeners, "f")[key];
55
+ }
56
+ }
57
+ }
58
+ }
59
+ _BlockTrackerPollingController_activeListeners = new WeakMap();
60
+ return BlockTrackerPollingController;
61
+ }
62
+ class Empty {
63
+ }
64
+ const BlockTrackerPollingControllerOnly = () => BlockTrackerPollingControllerMixin(Empty);
65
+ exports.BlockTrackerPollingControllerOnly = BlockTrackerPollingControllerOnly;
66
+ const BlockTrackerPollingController = () => BlockTrackerPollingControllerMixin(base_controller_1.BaseController);
67
+ exports.BlockTrackerPollingController = BlockTrackerPollingController;
68
+ //# sourceMappingURL=BlockTrackerPollingController.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockTrackerPollingController.cjs","sourceRoot":"","sources":["../src/BlockTrackerPollingController.ts"],"names":[],"mappings":";;;;;;;;AAAA,+DAA2D;AAK3D,qEAKsC;AAWtC;;;;;;GAMG;AACH,gFAAgF;AAChF,8EAA8E;AAC9E,kHAAkH;AAClH,SAAS,kCAAkC,CAGzC,IAAW;;IACX,MAAe,6BAA8B,SAAQ,IAAA,uDAAkC,EAGrF,IAAI,CAAC;QAHP;;YAIE,yDAAqE,EAAE,EAAC;QA2C1E,CAAC;QArCC,aAAa,CAAC,KAAmB;YAC/B,MAAM,GAAG,GAAG,IAAA,2BAAM,EAAC,KAAK,CAAC,CAAC;YAE1B,IAAI,uBAAA,IAAI,sDAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC/B,OAAO;YACT,CAAC;YAED,MAAM,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YACxE,IAAI,aAAa,EAAE,CAAC;gBAClB,MAAM,gBAAgB,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBAC7D,gFAAgF;gBAChF,kEAAkE;gBAClE,aAAa,CAAC,YAAY,CAAC,WAAW,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;gBACnE,uBAAA,IAAI,sDAAiB,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CACb,uDAAuD,KAAK,CAAC,eAAe,EAAE,CAC/E,CAAC;YACJ,CAAC;QACH,CAAC;QAED,+BAA+B,CAAC,GAAsB;YACpD,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5C,MAAM,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAC9C,eAAkC,CACnC,CAAC;YAEF,IAAI,aAAa,IAAI,uBAAA,IAAI,sDAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;gBAChD,MAAM,QAAQ,GAAG,uBAAA,IAAI,sDAAiB,CAAC,GAAG,CAAC,CAAC;gBAC5C,IAAI,QAAQ,EAAE,CAAC;oBACb,gFAAgF;oBAChF,kEAAkE;oBAClE,aAAa,CAAC,YAAY,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;oBAC9D,OAAO,uBAAA,IAAI,sDAAiB,CAAC,GAAG,CAAC,CAAC;gBACpC,CAAC;YACH,CAAC;QACH,CAAC;KACF;;IAED,OAAO,6BAA6B,CAAC;AACvC,CAAC;AAED,MAAM,KAAK;CAAG;AAEP,MAAM,iCAAiC,GAAG,GAK7C,EAAE,CAAC,kCAAkC,CAA6B,KAAK,CAAC,CAAC;AALhE,QAAA,iCAAiC,qCAK+B;AAEtE,MAAM,6BAA6B,GAAG,GAKzC,EAAE,CACJ,kCAAkC,CAChC,gCAAc,CACf,CAAC;AARS,QAAA,6BAA6B,iCAQtC","sourcesContent":["import { BaseController } from '@metamask/base-controller';\nimport type {\n NetworkClientId,\n NetworkClient,\n} from '@metamask/network-controller';\nimport {\n AbstractPollingControllerBaseMixin,\n getKey,\n Constructor,\n PollingTokenSetId,\n} from '@metamask/polling-controller';\nimport type { Json } from '@metamask/utils';\n\n/**\n * The minimum input required to start polling for a {@link BlockTrackerPollingController}.\n * Implementing classes may provide additional properties.\n */\nexport type BlockTrackerPollingInput = {\n networkClientId: NetworkClientId;\n};\n\n/**\n * BlockTrackerPollingControllerMixin\n * A polling controller that polls using a block tracker.\n *\n * @param Base - The base class to mix onto.\n * @returns The composed class.\n */\n// This is a function that's used as class, and the return type is inferred from\n// the class defined inside the function scope, so this can't be easily typed.\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/naming-convention\nfunction BlockTrackerPollingControllerMixin<\n TBase extends Constructor,\n PollingInput extends BlockTrackerPollingInput,\n>(Base: TBase) {\n abstract class BlockTrackerPollingController extends AbstractPollingControllerBaseMixin<\n TBase,\n PollingInput\n >(Base) {\n #activeListeners: Record<string, (options: Json) => Promise<void>> = {};\n\n abstract _getNetworkClientById(\n networkClientId: NetworkClientId,\n ): NetworkClient | undefined;\n\n _startPolling(input: PollingInput): void {\n const key = getKey(input);\n\n if (this.#activeListeners[key]) {\n return;\n }\n\n const networkClient = this._getNetworkClientById(input.networkClientId);\n if (networkClient) {\n const updateOnNewBlock = this._executePoll.bind(this, input);\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n networkClient.blockTracker.addListener('latest', updateOnNewBlock);\n this.#activeListeners[key] = updateOnNewBlock;\n } else {\n throw new Error(\n `Unable to retrieve blockTracker for networkClientId ${input.networkClientId}`,\n );\n }\n }\n\n _stopPollingByPollingTokenSetId(key: PollingTokenSetId): void {\n const { networkClientId } = JSON.parse(key);\n const networkClient = this._getNetworkClientById(\n networkClientId as NetworkClientId,\n );\n\n if (networkClient && this.#activeListeners[key]) {\n const listener = this.#activeListeners[key];\n if (listener) {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n networkClient.blockTracker.removeListener('latest', listener);\n delete this.#activeListeners[key];\n }\n }\n }\n }\n\n return BlockTrackerPollingController;\n}\n\nclass Empty {}\n\nexport const BlockTrackerPollingControllerOnly = <\n PollingInput extends BlockTrackerPollingInput,\n // The return type is inferred from the class defined inside the function\n // scope, so this can't be easily typed.\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n>() => BlockTrackerPollingControllerMixin<typeof Empty, PollingInput>(Empty);\n\nexport const BlockTrackerPollingController = <\n PollingInput extends BlockTrackerPollingInput,\n // The return type is inferred from the class defined inside the function\n // scope, so this can't be easily typed.\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n>() =>\n BlockTrackerPollingControllerMixin<typeof BaseController, PollingInput>(\n BaseController,\n );\n"]}
@@ -1,7 +1,7 @@
1
- import { BaseController } from '@metamask/base-controller';
2
- import type { NetworkClientId, NetworkClient } from '@metamask/network-controller';
3
- import { PollingTokenSetId } from '@metamask/polling-controller';
4
- import type { Json } from '@metamask/utils';
1
+ import { BaseController } from "@metamask/base-controller";
2
+ import type { NetworkClientId, NetworkClient } from "@metamask/network-controller";
3
+ import { PollingTokenSetId } from "@metamask/polling-controller";
4
+ import type { Json } from "@metamask/utils";
5
5
  /**
6
6
  * The minimum input required to start polling for a {@link BlockTrackerPollingController}.
7
7
  * Implementing classes may provide additional properties.
@@ -12,12 +12,12 @@ export type BlockTrackerPollingInput = {
12
12
  declare class Empty {
13
13
  }
14
14
  export declare const BlockTrackerPollingControllerOnly: <PollingInput extends BlockTrackerPollingInput>() => (abstract new (...args: any[]) => {
15
- _activeListeners: Record<string, (options: Json) => Promise<void>>;
15
+ "__#21@#activeListeners": Record<string, (options: Json) => Promise<void>>;
16
16
  _getNetworkClientById(networkClientId: NetworkClientId): NetworkClient | undefined;
17
17
  _startPolling(input: PollingInput): void;
18
18
  _stopPollingByPollingTokenSetId(key: PollingTokenSetId): void;
19
- readonly _pollingTokenSets: Map<PollingTokenSetId, Set<string>>;
20
- readonly _callbacks: Map<string, Set<(input: PollingInput) => void>>;
19
+ readonly "__#3@#pollingTokenSets": Map<string, Set<string>>;
20
+ readonly "__#3@#callbacks": Map<string, Set<(input: PollingInput) => void>>;
21
21
  _executePoll(input: PollingInput): Promise<void>;
22
22
  startPolling(input: PollingInput): string;
23
23
  stopAllPolling(): void;
@@ -25,12 +25,12 @@ export declare const BlockTrackerPollingControllerOnly: <PollingInput extends Bl
25
25
  onPollingComplete(input: PollingInput, callback: (input: PollingInput) => void): void;
26
26
  }) & typeof Empty;
27
27
  export declare const BlockTrackerPollingController: <PollingInput extends BlockTrackerPollingInput>() => (abstract new (...args: any[]) => {
28
- _activeListeners: Record<string, (options: Json) => Promise<void>>;
28
+ "__#21@#activeListeners": Record<string, (options: Json) => Promise<void>>;
29
29
  _getNetworkClientById(networkClientId: NetworkClientId): NetworkClient | undefined;
30
30
  _startPolling(input: PollingInput): void;
31
31
  _stopPollingByPollingTokenSetId(key: PollingTokenSetId): void;
32
- readonly _pollingTokenSets: Map<PollingTokenSetId, Set<string>>;
33
- readonly _callbacks: Map<string, Set<(input: PollingInput) => void>>;
32
+ readonly "__#3@#pollingTokenSets": Map<string, Set<string>>;
33
+ readonly "__#3@#callbacks": Map<string, Set<(input: PollingInput) => void>>;
34
34
  _executePoll(input: PollingInput): Promise<void>;
35
35
  startPolling(input: PollingInput): string;
36
36
  stopAllPolling(): void;
@@ -38,4 +38,4 @@ export declare const BlockTrackerPollingController: <PollingInput extends BlockT
38
38
  onPollingComplete(input: PollingInput, callback: (input: PollingInput) => void): void;
39
39
  }) & typeof BaseController;
40
40
  export {};
41
- //# sourceMappingURL=BlockTrackerPollingController.d.ts.map
41
+ //# sourceMappingURL=BlockTrackerPollingController.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockTrackerPollingController.d.cts","sourceRoot":"","sources":["../src/BlockTrackerPollingController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACd,qCAAqC;AACtC,OAAO,EAIL,iBAAiB,EAClB,qCAAqC;AACtC,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,eAAe,EAAE,eAAe,CAAC;CAClC,CAAC;AAoEF,cAAM,KAAK;CAAG;AAEd,eAAO,MAAM,iCAAiC;uDAlDC,IAAI,KAAK,QAAQ,IAAI,CAAC;2CAG9C,eAAe,GAC/B,aAAa,GAAG,SAAS;wCAEQ,IAAI;yCAqBH,iBAAiB,GAAG,IAAI;;;;;;;;iBA4BW,CAAC;AAE7E,eAAO,MAAM,6BAA6B;uDAzDK,IAAI,KAAK,QAAQ,IAAI,CAAC;2CAG9C,eAAe,GAC/B,aAAa,GAAG,SAAS;wCAEQ,IAAI;yCAqBH,iBAAiB,GAAG,IAAI;;;;;;;;0BAsC9D,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { BaseController } from "@metamask/base-controller";
2
+ import type { NetworkClientId, NetworkClient } from "@metamask/network-controller";
3
+ import { PollingTokenSetId } from "@metamask/polling-controller";
4
+ import type { Json } from "@metamask/utils";
5
+ /**
6
+ * The minimum input required to start polling for a {@link BlockTrackerPollingController}.
7
+ * Implementing classes may provide additional properties.
8
+ */
9
+ export type BlockTrackerPollingInput = {
10
+ networkClientId: NetworkClientId;
11
+ };
12
+ declare class Empty {
13
+ }
14
+ export declare const BlockTrackerPollingControllerOnly: <PollingInput extends BlockTrackerPollingInput>() => (abstract new (...args: any[]) => {
15
+ "__#21@#activeListeners": Record<string, (options: Json) => Promise<void>>;
16
+ _getNetworkClientById(networkClientId: NetworkClientId): NetworkClient | undefined;
17
+ _startPolling(input: PollingInput): void;
18
+ _stopPollingByPollingTokenSetId(key: PollingTokenSetId): void;
19
+ readonly "__#3@#pollingTokenSets": Map<string, Set<string>>;
20
+ readonly "__#3@#callbacks": Map<string, Set<(input: PollingInput) => void>>;
21
+ _executePoll(input: PollingInput): Promise<void>;
22
+ startPolling(input: PollingInput): string;
23
+ stopAllPolling(): void;
24
+ stopPollingByPollingToken(pollingToken: string): void;
25
+ onPollingComplete(input: PollingInput, callback: (input: PollingInput) => void): void;
26
+ }) & typeof Empty;
27
+ export declare const BlockTrackerPollingController: <PollingInput extends BlockTrackerPollingInput>() => (abstract new (...args: any[]) => {
28
+ "__#21@#activeListeners": Record<string, (options: Json) => Promise<void>>;
29
+ _getNetworkClientById(networkClientId: NetworkClientId): NetworkClient | undefined;
30
+ _startPolling(input: PollingInput): void;
31
+ _stopPollingByPollingTokenSetId(key: PollingTokenSetId): void;
32
+ readonly "__#3@#pollingTokenSets": Map<string, Set<string>>;
33
+ readonly "__#3@#callbacks": Map<string, Set<(input: PollingInput) => void>>;
34
+ _executePoll(input: PollingInput): Promise<void>;
35
+ startPolling(input: PollingInput): string;
36
+ stopAllPolling(): void;
37
+ stopPollingByPollingToken(pollingToken: string): void;
38
+ onPollingComplete(input: PollingInput, callback: (input: PollingInput) => void): void;
39
+ }) & typeof BaseController;
40
+ export {};
41
+ //# sourceMappingURL=BlockTrackerPollingController.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockTrackerPollingController.d.mts","sourceRoot":"","sources":["../src/BlockTrackerPollingController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACd,qCAAqC;AACtC,OAAO,EAIL,iBAAiB,EAClB,qCAAqC;AACtC,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,eAAe,EAAE,eAAe,CAAC;CAClC,CAAC;AAoEF,cAAM,KAAK;CAAG;AAEd,eAAO,MAAM,iCAAiC;uDAlDC,IAAI,KAAK,QAAQ,IAAI,CAAC;2CAG9C,eAAe,GAC/B,aAAa,GAAG,SAAS;wCAEQ,IAAI;yCAqBH,iBAAiB,GAAG,IAAI;;;;;;;;iBA4BW,CAAC;AAE7E,eAAO,MAAM,6BAA6B;uDAzDK,IAAI,KAAK,QAAQ,IAAI,CAAC;2CAG9C,eAAe,GAC/B,aAAa,GAAG,SAAS;wCAEQ,IAAI;yCAqBH,iBAAiB,GAAG,IAAI;;;;;;;;0BAsC9D,CAAC"}
@@ -1,5 +1,10 @@
1
- import { BaseController } from '@metamask/base-controller';
2
- import { AbstractPollingControllerBaseMixin, getKey, } from '@metamask/polling-controller';
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
+ };
6
+ import { BaseController } from "@metamask/base-controller";
7
+ import { AbstractPollingControllerBaseMixin, getKey } from "@metamask/polling-controller";
3
8
  /**
4
9
  * BlockTrackerPollingControllerMixin
5
10
  * A polling controller that polls using a block tracker.
@@ -11,22 +16,15 @@ import { AbstractPollingControllerBaseMixin, getKey, } from '@metamask/polling-c
11
16
  // the class defined inside the function scope, so this can't be easily typed.
12
17
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/naming-convention
13
18
  function BlockTrackerPollingControllerMixin(Base) {
19
+ var _BlockTrackerPollingController_activeListeners;
14
20
  class BlockTrackerPollingController extends AbstractPollingControllerBaseMixin(Base) {
15
21
  constructor() {
16
22
  super(...arguments);
17
- // This field is public (rather than using `#`) so that declaration
18
- // emission can describe it. Private/protected members on the class
19
- // returned by an exported mixin function trigger TS4094, and giving the
20
- // mixin an explicit return type to work around that breaks consumers
21
- // that supply the base class's own type arguments via
22
- // `BlockTrackerPollingController()<Name, State, Messenger>`. The
23
- // leading underscore signals "internal, do not use" without needing
24
- // true privacy.
25
- this._activeListeners = {};
23
+ _BlockTrackerPollingController_activeListeners.set(this, {});
26
24
  }
27
25
  _startPolling(input) {
28
26
  const key = getKey(input);
29
- if (this._activeListeners[key]) {
27
+ if (__classPrivateFieldGet(this, _BlockTrackerPollingController_activeListeners, "f")[key]) {
30
28
  return;
31
29
  }
32
30
  const networkClient = this._getNetworkClientById(input.networkClientId);
@@ -35,7 +33,7 @@ function BlockTrackerPollingControllerMixin(Base) {
35
33
  // TODO: Either fix this lint violation or explain why it's necessary to ignore.
36
34
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
37
35
  networkClient.blockTracker.addListener('latest', updateOnNewBlock);
38
- this._activeListeners[key] = updateOnNewBlock;
36
+ __classPrivateFieldGet(this, _BlockTrackerPollingController_activeListeners, "f")[key] = updateOnNewBlock;
39
37
  }
40
38
  else {
41
39
  throw new Error(`Unable to retrieve blockTracker for networkClientId ${input.networkClientId}`);
@@ -44,21 +42,22 @@ function BlockTrackerPollingControllerMixin(Base) {
44
42
  _stopPollingByPollingTokenSetId(key) {
45
43
  const { networkClientId } = JSON.parse(key);
46
44
  const networkClient = this._getNetworkClientById(networkClientId);
47
- if (networkClient && this._activeListeners[key]) {
48
- const listener = this._activeListeners[key];
45
+ if (networkClient && __classPrivateFieldGet(this, _BlockTrackerPollingController_activeListeners, "f")[key]) {
46
+ const listener = __classPrivateFieldGet(this, _BlockTrackerPollingController_activeListeners, "f")[key];
49
47
  if (listener) {
50
48
  // TODO: Either fix this lint violation or explain why it's necessary to ignore.
51
49
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
52
50
  networkClient.blockTracker.removeListener('latest', listener);
53
- delete this._activeListeners[key];
51
+ delete __classPrivateFieldGet(this, _BlockTrackerPollingController_activeListeners, "f")[key];
54
52
  }
55
53
  }
56
54
  }
57
55
  }
56
+ _BlockTrackerPollingController_activeListeners = new WeakMap();
58
57
  return BlockTrackerPollingController;
59
58
  }
60
59
  class Empty {
61
60
  }
62
61
  export const BlockTrackerPollingControllerOnly = () => BlockTrackerPollingControllerMixin(Empty);
63
62
  export const BlockTrackerPollingController = () => BlockTrackerPollingControllerMixin(BaseController);
64
- //# sourceMappingURL=BlockTrackerPollingController.js.map
63
+ //# sourceMappingURL=BlockTrackerPollingController.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockTrackerPollingController.mjs","sourceRoot":"","sources":["../src/BlockTrackerPollingController.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAK3D,OAAO,EACL,kCAAkC,EAClC,MAAM,EAGP,qCAAqC;AAWtC;;;;;;GAMG;AACH,gFAAgF;AAChF,8EAA8E;AAC9E,kHAAkH;AAClH,SAAS,kCAAkC,CAGzC,IAAW;;IACX,MAAe,6BAA8B,SAAQ,kCAAkC,CAGrF,IAAI,CAAC;QAHP;;YAIE,yDAAqE,EAAE,EAAC;QA2C1E,CAAC;QArCC,aAAa,CAAC,KAAmB;YAC/B,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YAE1B,IAAI,uBAAA,IAAI,sDAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC/B,OAAO;YACT,CAAC;YAED,MAAM,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YACxE,IAAI,aAAa,EAAE,CAAC;gBAClB,MAAM,gBAAgB,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBAC7D,gFAAgF;gBAChF,kEAAkE;gBAClE,aAAa,CAAC,YAAY,CAAC,WAAW,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;gBACnE,uBAAA,IAAI,sDAAiB,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CACb,uDAAuD,KAAK,CAAC,eAAe,EAAE,CAC/E,CAAC;YACJ,CAAC;QACH,CAAC;QAED,+BAA+B,CAAC,GAAsB;YACpD,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5C,MAAM,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAC9C,eAAkC,CACnC,CAAC;YAEF,IAAI,aAAa,IAAI,uBAAA,IAAI,sDAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;gBAChD,MAAM,QAAQ,GAAG,uBAAA,IAAI,sDAAiB,CAAC,GAAG,CAAC,CAAC;gBAC5C,IAAI,QAAQ,EAAE,CAAC;oBACb,gFAAgF;oBAChF,kEAAkE;oBAClE,aAAa,CAAC,YAAY,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;oBAC9D,OAAO,uBAAA,IAAI,sDAAiB,CAAC,GAAG,CAAC,CAAC;gBACpC,CAAC;YACH,CAAC;QACH,CAAC;KACF;;IAED,OAAO,6BAA6B,CAAC;AACvC,CAAC;AAED,MAAM,KAAK;CAAG;AAEd,MAAM,CAAC,MAAM,iCAAiC,GAAG,GAK7C,EAAE,CAAC,kCAAkC,CAA6B,KAAK,CAAC,CAAC;AAE7E,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAKzC,EAAE,CACJ,kCAAkC,CAChC,cAAc,CACf,CAAC","sourcesContent":["import { BaseController } from '@metamask/base-controller';\nimport type {\n NetworkClientId,\n NetworkClient,\n} from '@metamask/network-controller';\nimport {\n AbstractPollingControllerBaseMixin,\n getKey,\n Constructor,\n PollingTokenSetId,\n} from '@metamask/polling-controller';\nimport type { Json } from '@metamask/utils';\n\n/**\n * The minimum input required to start polling for a {@link BlockTrackerPollingController}.\n * Implementing classes may provide additional properties.\n */\nexport type BlockTrackerPollingInput = {\n networkClientId: NetworkClientId;\n};\n\n/**\n * BlockTrackerPollingControllerMixin\n * A polling controller that polls using a block tracker.\n *\n * @param Base - The base class to mix onto.\n * @returns The composed class.\n */\n// This is a function that's used as class, and the return type is inferred from\n// the class defined inside the function scope, so this can't be easily typed.\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/naming-convention\nfunction BlockTrackerPollingControllerMixin<\n TBase extends Constructor,\n PollingInput extends BlockTrackerPollingInput,\n>(Base: TBase) {\n abstract class BlockTrackerPollingController extends AbstractPollingControllerBaseMixin<\n TBase,\n PollingInput\n >(Base) {\n #activeListeners: Record<string, (options: Json) => Promise<void>> = {};\n\n abstract _getNetworkClientById(\n networkClientId: NetworkClientId,\n ): NetworkClient | undefined;\n\n _startPolling(input: PollingInput): void {\n const key = getKey(input);\n\n if (this.#activeListeners[key]) {\n return;\n }\n\n const networkClient = this._getNetworkClientById(input.networkClientId);\n if (networkClient) {\n const updateOnNewBlock = this._executePoll.bind(this, input);\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n networkClient.blockTracker.addListener('latest', updateOnNewBlock);\n this.#activeListeners[key] = updateOnNewBlock;\n } else {\n throw new Error(\n `Unable to retrieve blockTracker for networkClientId ${input.networkClientId}`,\n );\n }\n }\n\n _stopPollingByPollingTokenSetId(key: PollingTokenSetId): void {\n const { networkClientId } = JSON.parse(key);\n const networkClient = this._getNetworkClientById(\n networkClientId as NetworkClientId,\n );\n\n if (networkClient && this.#activeListeners[key]) {\n const listener = this.#activeListeners[key];\n if (listener) {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n networkClient.blockTracker.removeListener('latest', listener);\n delete this.#activeListeners[key];\n }\n }\n }\n }\n\n return BlockTrackerPollingController;\n}\n\nclass Empty {}\n\nexport const BlockTrackerPollingControllerOnly = <\n PollingInput extends BlockTrackerPollingInput,\n // The return type is inferred from the class defined inside the function\n // scope, so this can't be easily typed.\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n>() => BlockTrackerPollingControllerMixin<typeof Empty, PollingInput>(Empty);\n\nexport const BlockTrackerPollingController = <\n PollingInput extends BlockTrackerPollingInput,\n // The return type is inferred from the class defined inside the function\n // scope, so this can't be easily typed.\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n>() =>\n BlockTrackerPollingControllerMixin<typeof BaseController, PollingInput>(\n BaseController,\n );\n"]}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * This file is auto generated.
4
+ * Do not edit manually.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=UserOperationController-method-action-types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserOperationController-method-action-types.cjs","sourceRoot":"","sources":["../src/UserOperationController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { UserOperationController } from './UserOperationController.js';\n\n/**\n * Create and submit a user operation.\n *\n * @param request - Information required to create a user operation.\n * @param request.data - Data to include in the resulting transaction.\n * @param request.maxFeePerGas - Maximum fee per gas to pay towards the transaction.\n * @param request.maxPriorityFeePerGas - Maximum priority fee per gas to pay towards the transaction.\n * @param request.to - Destination address of the resulting transaction.\n * @param request.value - Value to include in the resulting transaction.\n * @param options - Configuration options when creating a user operation.\n * @param options.networkClientId - ID of the network client used to query the chain.\n * @param options.origin - Origin of the user operation, such as the hostname of a dApp.\n * @param options.requireApproval - Whether to require user approval before submitting the user operation. Defaults to true.\n * @param options.smartContractAccount - Smart contract abstraction to provide the contract specific values such as call data and nonce. Defaults to the current snap account.\n * @param options.swaps - Swap metadata to record with the user operation.\n * @param options.type - Type of the transaction.\n */\nexport type UserOperationControllerAddUserOperationAction = {\n type: `UserOperationController:addUserOperation`;\n handler: UserOperationController['addUserOperation'];\n};\n\n/**\n * Create and submit a user operation equivalent to the provided transaction.\n *\n * @param transaction - Transaction to use as the basis for the user operation.\n * @param options - Configuration options when creating a user operation.\n * @param options.networkClientId - ID of the network client used to query the chain.\n * @param options.origin - Origin of the user operation, such as the hostname of a dApp.\n * @param options.requireApproval - Whether to require user approval before submitting the user operation. Defaults to true.\n * @param options.smartContractAccount - Smart contract abstraction to provide the contract specific values such as call data and nonce. Defaults to the current snap account.\n * @param options.swaps - Swap metadata to record with the user operation.\n * @param options.type - Type of the transaction.\n */\nexport type UserOperationControllerAddUserOperationFromTransactionAction = {\n type: `UserOperationController:addUserOperationFromTransaction`;\n handler: UserOperationController['addUserOperationFromTransaction'];\n};\n\n/**\n * Starts polling for pending user operations on the given network.\n *\n * @param networkClientId - The ID of the network client to poll.\n * @returns The polling token that can be used to stop polling.\n */\nexport type UserOperationControllerStartPollingByNetworkClientIdAction = {\n type: `UserOperationController:startPollingByNetworkClientId`;\n handler: UserOperationController['startPollingByNetworkClientId'];\n};\n\n/**\n * Union of all UserOperationController action types.\n */\nexport type UserOperationControllerMethodActions =\n | UserOperationControllerAddUserOperationAction\n | UserOperationControllerAddUserOperationFromTransactionAction\n | UserOperationControllerStartPollingByNetworkClientIdAction;\n"]}
@@ -2,7 +2,7 @@
2
2
  * This file is auto generated.
3
3
  * Do not edit manually.
4
4
  */
5
- import type { UserOperationController } from './UserOperationController.js';
5
+ import type { UserOperationController } from "./UserOperationController.cjs";
6
6
  /**
7
7
  * Create and submit a user operation.
8
8
  *
@@ -54,4 +54,4 @@ export type UserOperationControllerStartPollingByNetworkClientIdAction = {
54
54
  * Union of all UserOperationController action types.
55
55
  */
56
56
  export type UserOperationControllerMethodActions = UserOperationControllerAddUserOperationAction | UserOperationControllerAddUserOperationFromTransactionAction | UserOperationControllerStartPollingByNetworkClientIdAction;
57
- //# sourceMappingURL=UserOperationController-method-action-types.d.ts.map
57
+ //# sourceMappingURL=UserOperationController-method-action-types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserOperationController-method-action-types.d.cts","sourceRoot":"","sources":["../src/UserOperationController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,sCAAqC;AAE5E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,6CAA6C,GAAG;IAC1D,IAAI,EAAE,0CAA0C,CAAC;IACjD,OAAO,EAAE,uBAAuB,CAAC,kBAAkB,CAAC,CAAC;CACtD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,4DAA4D,GAAG;IACzE,IAAI,EAAE,yDAAyD,CAAC;IAChE,OAAO,EAAE,uBAAuB,CAAC,iCAAiC,CAAC,CAAC;CACrE,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,0DAA0D,GAAG;IACvE,IAAI,EAAE,uDAAuD,CAAC;IAC9D,OAAO,EAAE,uBAAuB,CAAC,+BAA+B,CAAC,CAAC;CACnE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oCAAoC,GAC5C,6CAA6C,GAC7C,4DAA4D,GAC5D,0DAA0D,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * This file is auto generated.
3
+ * Do not edit manually.
4
+ */
5
+ import type { UserOperationController } from "./UserOperationController.mjs";
6
+ /**
7
+ * Create and submit a user operation.
8
+ *
9
+ * @param request - Information required to create a user operation.
10
+ * @param request.data - Data to include in the resulting transaction.
11
+ * @param request.maxFeePerGas - Maximum fee per gas to pay towards the transaction.
12
+ * @param request.maxPriorityFeePerGas - Maximum priority fee per gas to pay towards the transaction.
13
+ * @param request.to - Destination address of the resulting transaction.
14
+ * @param request.value - Value to include in the resulting transaction.
15
+ * @param options - Configuration options when creating a user operation.
16
+ * @param options.networkClientId - ID of the network client used to query the chain.
17
+ * @param options.origin - Origin of the user operation, such as the hostname of a dApp.
18
+ * @param options.requireApproval - Whether to require user approval before submitting the user operation. Defaults to true.
19
+ * @param options.smartContractAccount - Smart contract abstraction to provide the contract specific values such as call data and nonce. Defaults to the current snap account.
20
+ * @param options.swaps - Swap metadata to record with the user operation.
21
+ * @param options.type - Type of the transaction.
22
+ */
23
+ export type UserOperationControllerAddUserOperationAction = {
24
+ type: `UserOperationController:addUserOperation`;
25
+ handler: UserOperationController['addUserOperation'];
26
+ };
27
+ /**
28
+ * Create and submit a user operation equivalent to the provided transaction.
29
+ *
30
+ * @param transaction - Transaction to use as the basis for the user operation.
31
+ * @param options - Configuration options when creating a user operation.
32
+ * @param options.networkClientId - ID of the network client used to query the chain.
33
+ * @param options.origin - Origin of the user operation, such as the hostname of a dApp.
34
+ * @param options.requireApproval - Whether to require user approval before submitting the user operation. Defaults to true.
35
+ * @param options.smartContractAccount - Smart contract abstraction to provide the contract specific values such as call data and nonce. Defaults to the current snap account.
36
+ * @param options.swaps - Swap metadata to record with the user operation.
37
+ * @param options.type - Type of the transaction.
38
+ */
39
+ export type UserOperationControllerAddUserOperationFromTransactionAction = {
40
+ type: `UserOperationController:addUserOperationFromTransaction`;
41
+ handler: UserOperationController['addUserOperationFromTransaction'];
42
+ };
43
+ /**
44
+ * Starts polling for pending user operations on the given network.
45
+ *
46
+ * @param networkClientId - The ID of the network client to poll.
47
+ * @returns The polling token that can be used to stop polling.
48
+ */
49
+ export type UserOperationControllerStartPollingByNetworkClientIdAction = {
50
+ type: `UserOperationController:startPollingByNetworkClientId`;
51
+ handler: UserOperationController['startPollingByNetworkClientId'];
52
+ };
53
+ /**
54
+ * Union of all UserOperationController action types.
55
+ */
56
+ export type UserOperationControllerMethodActions = UserOperationControllerAddUserOperationAction | UserOperationControllerAddUserOperationFromTransactionAction | UserOperationControllerStartPollingByNetworkClientIdAction;
57
+ //# sourceMappingURL=UserOperationController-method-action-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserOperationController-method-action-types.d.mts","sourceRoot":"","sources":["../src/UserOperationController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,sCAAqC;AAE5E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,6CAA6C,GAAG;IAC1D,IAAI,EAAE,0CAA0C,CAAC;IACjD,OAAO,EAAE,uBAAuB,CAAC,kBAAkB,CAAC,CAAC;CACtD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,4DAA4D,GAAG;IACzE,IAAI,EAAE,yDAAyD,CAAC;IAChE,OAAO,EAAE,uBAAuB,CAAC,iCAAiC,CAAC,CAAC;CACrE,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,0DAA0D,GAAG;IACvE,IAAI,EAAE,uDAAuD,CAAC;IAC9D,OAAO,EAAE,uBAAuB,CAAC,+BAA+B,CAAC,CAAC;CACnE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oCAAoC,GAC5C,6CAA6C,GAC7C,4DAA4D,GAC5D,0DAA0D,CAAC"}
@@ -3,4 +3,4 @@
3
3
  * Do not edit manually.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=UserOperationController-method-action-types.js.map
6
+ //# sourceMappingURL=UserOperationController-method-action-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserOperationController-method-action-types.mjs","sourceRoot":"","sources":["../src/UserOperationController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { UserOperationController } from './UserOperationController.js';\n\n/**\n * Create and submit a user operation.\n *\n * @param request - Information required to create a user operation.\n * @param request.data - Data to include in the resulting transaction.\n * @param request.maxFeePerGas - Maximum fee per gas to pay towards the transaction.\n * @param request.maxPriorityFeePerGas - Maximum priority fee per gas to pay towards the transaction.\n * @param request.to - Destination address of the resulting transaction.\n * @param request.value - Value to include in the resulting transaction.\n * @param options - Configuration options when creating a user operation.\n * @param options.networkClientId - ID of the network client used to query the chain.\n * @param options.origin - Origin of the user operation, such as the hostname of a dApp.\n * @param options.requireApproval - Whether to require user approval before submitting the user operation. Defaults to true.\n * @param options.smartContractAccount - Smart contract abstraction to provide the contract specific values such as call data and nonce. Defaults to the current snap account.\n * @param options.swaps - Swap metadata to record with the user operation.\n * @param options.type - Type of the transaction.\n */\nexport type UserOperationControllerAddUserOperationAction = {\n type: `UserOperationController:addUserOperation`;\n handler: UserOperationController['addUserOperation'];\n};\n\n/**\n * Create and submit a user operation equivalent to the provided transaction.\n *\n * @param transaction - Transaction to use as the basis for the user operation.\n * @param options - Configuration options when creating a user operation.\n * @param options.networkClientId - ID of the network client used to query the chain.\n * @param options.origin - Origin of the user operation, such as the hostname of a dApp.\n * @param options.requireApproval - Whether to require user approval before submitting the user operation. Defaults to true.\n * @param options.smartContractAccount - Smart contract abstraction to provide the contract specific values such as call data and nonce. Defaults to the current snap account.\n * @param options.swaps - Swap metadata to record with the user operation.\n * @param options.type - Type of the transaction.\n */\nexport type UserOperationControllerAddUserOperationFromTransactionAction = {\n type: `UserOperationController:addUserOperationFromTransaction`;\n handler: UserOperationController['addUserOperationFromTransaction'];\n};\n\n/**\n * Starts polling for pending user operations on the given network.\n *\n * @param networkClientId - The ID of the network client to poll.\n * @returns The polling token that can be used to stop polling.\n */\nexport type UserOperationControllerStartPollingByNetworkClientIdAction = {\n type: `UserOperationController:startPollingByNetworkClientId`;\n handler: UserOperationController['startPollingByNetworkClientId'];\n};\n\n/**\n * Union of all UserOperationController action types.\n */\nexport type UserOperationControllerMethodActions =\n | UserOperationControllerAddUserOperationAction\n | UserOperationControllerAddUserOperationFromTransactionAction\n | UserOperationControllerStartPollingByNetworkClientIdAction;\n"]}