@metamask-previews/bridge-status-controller 64.1.0-preview-8a0c757a → 64.2.0-preview-e776a73

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 (50) hide show
  1. package/CHANGELOG.md +10 -2
  2. package/dist/bridge-status-controller.cjs +15 -405
  3. package/dist/bridge-status-controller.cjs.map +1 -1
  4. package/dist/bridge-status-controller.d.cts +1 -16
  5. package/dist/bridge-status-controller.d.cts.map +1 -1
  6. package/dist/bridge-status-controller.d.mts +1 -16
  7. package/dist/bridge-status-controller.d.mts.map +1 -1
  8. package/dist/bridge-status-controller.mjs +15 -405
  9. package/dist/bridge-status-controller.mjs.map +1 -1
  10. package/dist/types.cjs +7 -9
  11. package/dist/types.cjs.map +1 -1
  12. package/dist/types.d.cts +16 -26
  13. package/dist/types.d.cts.map +1 -1
  14. package/dist/types.d.mts +16 -26
  15. package/dist/types.d.mts.map +1 -1
  16. package/dist/types.mjs +7 -9
  17. package/dist/types.mjs.map +1 -1
  18. package/dist/utils/transaction.d.cts +2 -21
  19. package/dist/utils/transaction.d.cts.map +1 -1
  20. package/dist/utils/transaction.d.mts +2 -21
  21. package/dist/utils/transaction.d.mts.map +1 -1
  22. package/dist/utils/validators.d.cts +0 -1
  23. package/dist/utils/validators.d.cts.map +1 -1
  24. package/dist/utils/validators.d.mts +0 -1
  25. package/dist/utils/validators.d.mts.map +1 -1
  26. package/package.json +4 -4
  27. package/dist/intent-api.cjs +0 -58
  28. package/dist/intent-api.cjs.map +0 -1
  29. package/dist/intent-api.d.cts +0 -19
  30. package/dist/intent-api.d.cts.map +0 -1
  31. package/dist/intent-api.d.mts +0 -19
  32. package/dist/intent-api.d.mts.map +0 -1
  33. package/dist/intent-api.mjs +0 -54
  34. package/dist/intent-api.mjs.map +0 -1
  35. package/dist/intent-order-status.cjs +0 -14
  36. package/dist/intent-order-status.cjs.map +0 -1
  37. package/dist/intent-order-status.d.cts +0 -10
  38. package/dist/intent-order-status.d.cts.map +0 -1
  39. package/dist/intent-order-status.d.mts +0 -10
  40. package/dist/intent-order-status.d.mts.map +0 -1
  41. package/dist/intent-order-status.mjs +0 -11
  42. package/dist/intent-order-status.mjs.map +0 -1
  43. package/dist/intent-order.cjs +0 -4
  44. package/dist/intent-order.cjs.map +0 -1
  45. package/dist/intent-order.d.cts +0 -10
  46. package/dist/intent-order.d.cts.map +0 -1
  47. package/dist/intent-order.d.mts +0 -10
  48. package/dist/intent-order.d.mts.map +0 -1
  49. package/dist/intent-order.mjs +0 -2
  50. package/dist/intent-order.mjs.map +0 -1
@@ -1,54 +0,0 @@
1
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
- if (kind === "m") throw new TypeError("Private method is not writable");
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
- };
7
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
- 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");
10
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
- };
12
- var _IntentApiImpl_baseUrl, _IntentApiImpl_fetchFn;
13
- export class IntentApiImpl {
14
- constructor(baseUrl, fetchFn) {
15
- _IntentApiImpl_baseUrl.set(this, void 0);
16
- _IntentApiImpl_fetchFn.set(this, void 0);
17
- __classPrivateFieldSet(this, _IntentApiImpl_baseUrl, baseUrl, "f");
18
- __classPrivateFieldSet(this, _IntentApiImpl_fetchFn, fetchFn, "f");
19
- }
20
- async submitIntent(params) {
21
- const endpoint = `${__classPrivateFieldGet(this, _IntentApiImpl_baseUrl, "f")}/submitOrder`;
22
- try {
23
- const response = await __classPrivateFieldGet(this, _IntentApiImpl_fetchFn, "f").call(this, endpoint, {
24
- method: 'POST',
25
- headers: { 'Content-Type': 'application/json' },
26
- body: JSON.stringify(params),
27
- });
28
- return response;
29
- }
30
- catch (error) {
31
- if (error instanceof Error) {
32
- throw new Error(`Failed to submit intent: ${error.message}`);
33
- }
34
- return null;
35
- }
36
- }
37
- async getOrderStatus(orderId, aggregatorId, srcChainId) {
38
- const endpoint = `${__classPrivateFieldGet(this, _IntentApiImpl_baseUrl, "f")}/getOrderStatus?orderId=${orderId}&aggregatorId=${encodeURIComponent(aggregatorId)}&srcChainId=${srcChainId}`;
39
- try {
40
- const response = await __classPrivateFieldGet(this, _IntentApiImpl_fetchFn, "f").call(this, endpoint, {
41
- method: 'GET',
42
- });
43
- return response;
44
- }
45
- catch (error) {
46
- if (error instanceof Error) {
47
- throw new Error(`Failed to get order status: ${error.message}`);
48
- }
49
- return null;
50
- }
51
- }
52
- }
53
- _IntentApiImpl_baseUrl = new WeakMap(), _IntentApiImpl_fetchFn = new WeakMap();
54
- //# sourceMappingURL=intent-api.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent-api.mjs","sourceRoot":"","sources":["../src/intent-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAeA,MAAM,OAAO,aAAa;IAKxB,YAAY,OAAe,EAAE,OAAsB;QAJ1C,yCAAiB;QAEjB,yCAAwB;QAG/B,uBAAA,IAAI,0BAAY,OAAO,MAAA,CAAC;QACxB,uBAAA,IAAI,0BAAY,OAAO,MAAA,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,MAA8B;QAC/C,MAAM,QAAQ,GAAG,GAAG,uBAAA,IAAI,8BAAS,cAAc,CAAC;QAChD,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,uBAAA,IAAI,8BAAS,MAAb,IAAI,EAAU,QAAQ,EAAE;gBAC7C,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;gBAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;aAC7B,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC;QAClB,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,MAAM,IAAI,KAAK,CAAC,4BAA4B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YAC/D,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,OAAe,EACf,YAAoB,EACpB,UAAkB;QAElB,MAAM,QAAQ,GAAG,GAAG,uBAAA,IAAI,8BAAS,2BAA2B,OAAO,iBAAiB,kBAAkB,CAAC,YAAY,CAAC,eAAe,UAAU,EAAE,CAAC;QAChJ,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,uBAAA,IAAI,8BAAS,MAAb,IAAI,EAAU,QAAQ,EAAE;gBAC7C,MAAM,EAAE,KAAK;aACd,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC;QAClB,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,MAAM,IAAI,KAAK,CAAC,+BAA+B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YAClE,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF","sourcesContent":["import type { FetchFunction } from './types';\n\nexport type IntentSubmissionParams = {\n srcChainId: string;\n quoteId: string;\n signature: string;\n order: unknown;\n userAddress: string;\n aggregatorId: string;\n};\n\nexport type IntentApi = {\n submitIntent(params: IntentSubmissionParams): Promise<unknown>;\n};\n\nexport class IntentApiImpl implements IntentApi {\n readonly #baseUrl: string;\n\n readonly #fetchFn: FetchFunction;\n\n constructor(baseUrl: string, fetchFn: FetchFunction) {\n this.#baseUrl = baseUrl;\n this.#fetchFn = fetchFn;\n }\n\n async submitIntent(params: IntentSubmissionParams): Promise<unknown> {\n const endpoint = `${this.#baseUrl}/submitOrder`;\n try {\n const response = await this.#fetchFn(endpoint, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(params),\n });\n return response;\n } catch (error: unknown) {\n if (error instanceof Error) {\n throw new Error(`Failed to submit intent: ${error.message}`);\n }\n return null;\n }\n }\n\n async getOrderStatus(\n orderId: string,\n aggregatorId: string,\n srcChainId: string,\n ): Promise<unknown> {\n const endpoint = `${this.#baseUrl}/getOrderStatus?orderId=${orderId}&aggregatorId=${encodeURIComponent(aggregatorId)}&srcChainId=${srcChainId}`;\n try {\n const response = await this.#fetchFn(endpoint, {\n method: 'GET',\n });\n return response;\n } catch (error: unknown) {\n if (error instanceof Error) {\n throw new Error(`Failed to get order status: ${error.message}`);\n }\n return null;\n }\n }\n}\n"]}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IntentOrderStatus = void 0;
4
- var IntentOrderStatus;
5
- (function (IntentOrderStatus) {
6
- IntentOrderStatus["PENDING"] = "pending";
7
- IntentOrderStatus["SUBMITTED"] = "submitted";
8
- IntentOrderStatus["CONFIRMED"] = "confirmed";
9
- IntentOrderStatus["COMPLETED"] = "completed";
10
- IntentOrderStatus["FAILED"] = "failed";
11
- IntentOrderStatus["CANCELLED"] = "cancelled";
12
- IntentOrderStatus["EXPIRED"] = "expired";
13
- })(IntentOrderStatus || (exports.IntentOrderStatus = IntentOrderStatus = {}));
14
- //# sourceMappingURL=intent-order-status.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent-order-status.cjs","sourceRoot":"","sources":["../src/intent-order-status.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAQX;AARD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,4CAAuB,CAAA;IACvB,4CAAuB,CAAA;IACvB,4CAAuB,CAAA;IACvB,sCAAiB,CAAA;IACjB,4CAAuB,CAAA;IACvB,wCAAmB,CAAA;AACrB,CAAC,EARW,iBAAiB,iCAAjB,iBAAiB,QAQ5B","sourcesContent":["export enum IntentOrderStatus {\n PENDING = 'pending',\n SUBMITTED = 'submitted',\n CONFIRMED = 'confirmed',\n COMPLETED = 'completed',\n FAILED = 'failed',\n CANCELLED = 'cancelled',\n EXPIRED = 'expired',\n}\n"]}
@@ -1,10 +0,0 @@
1
- export declare enum IntentOrderStatus {
2
- PENDING = "pending",
3
- SUBMITTED = "submitted",
4
- CONFIRMED = "confirmed",
5
- COMPLETED = "completed",
6
- FAILED = "failed",
7
- CANCELLED = "cancelled",
8
- EXPIRED = "expired"
9
- }
10
- //# sourceMappingURL=intent-order-status.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent-order-status.d.cts","sourceRoot":"","sources":["../src/intent-order-status.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,OAAO,YAAY;CACpB"}
@@ -1,10 +0,0 @@
1
- export declare enum IntentOrderStatus {
2
- PENDING = "pending",
3
- SUBMITTED = "submitted",
4
- CONFIRMED = "confirmed",
5
- COMPLETED = "completed",
6
- FAILED = "failed",
7
- CANCELLED = "cancelled",
8
- EXPIRED = "expired"
9
- }
10
- //# sourceMappingURL=intent-order-status.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent-order-status.d.mts","sourceRoot":"","sources":["../src/intent-order-status.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,OAAO,YAAY;CACpB"}
@@ -1,11 +0,0 @@
1
- export var IntentOrderStatus;
2
- (function (IntentOrderStatus) {
3
- IntentOrderStatus["PENDING"] = "pending";
4
- IntentOrderStatus["SUBMITTED"] = "submitted";
5
- IntentOrderStatus["CONFIRMED"] = "confirmed";
6
- IntentOrderStatus["COMPLETED"] = "completed";
7
- IntentOrderStatus["FAILED"] = "failed";
8
- IntentOrderStatus["CANCELLED"] = "cancelled";
9
- IntentOrderStatus["EXPIRED"] = "expired";
10
- })(IntentOrderStatus || (IntentOrderStatus = {}));
11
- //# sourceMappingURL=intent-order-status.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent-order-status.mjs","sourceRoot":"","sources":["../src/intent-order-status.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBAQX;AARD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,4CAAuB,CAAA;IACvB,4CAAuB,CAAA;IACvB,4CAAuB,CAAA;IACvB,sCAAiB,CAAA;IACjB,4CAAuB,CAAA;IACvB,wCAAmB,CAAA;AACrB,CAAC,EARW,iBAAiB,KAAjB,iBAAiB,QAQ5B","sourcesContent":["export enum IntentOrderStatus {\n PENDING = 'pending',\n SUBMITTED = 'submitted',\n CONFIRMED = 'confirmed',\n COMPLETED = 'completed',\n FAILED = 'failed',\n CANCELLED = 'cancelled',\n EXPIRED = 'expired',\n}\n"]}
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const intent_order_status_1 = require("./intent-order-status.cjs");
4
- //# sourceMappingURL=intent-order.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent-order.cjs","sourceRoot":"","sources":["../src/intent-order.ts"],"names":[],"mappings":";;AAAA,mEAA0D","sourcesContent":["import { IntentOrderStatus } from './intent-order-status';\n\nexport type IntentOrder = {\n id: string;\n status: IntentOrderStatus;\n txHash?: string;\n metadata: {\n txHashes?: string[] | string;\n };\n};\n"]}
@@ -1,10 +0,0 @@
1
- import { IntentOrderStatus } from "./intent-order-status.cjs";
2
- export type IntentOrder = {
3
- id: string;
4
- status: IntentOrderStatus;
5
- txHash?: string;
6
- metadata: {
7
- txHashes?: string[] | string;
8
- };
9
- };
10
- //# sourceMappingURL=intent-order.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent-order.d.cts","sourceRoot":"","sources":["../src/intent-order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kCAA8B;AAE1D,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE;QACR,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;KAC9B,CAAC;CACH,CAAC"}
@@ -1,10 +0,0 @@
1
- import { IntentOrderStatus } from "./intent-order-status.mjs";
2
- export type IntentOrder = {
3
- id: string;
4
- status: IntentOrderStatus;
5
- txHash?: string;
6
- metadata: {
7
- txHashes?: string[] | string;
8
- };
9
- };
10
- //# sourceMappingURL=intent-order.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent-order.d.mts","sourceRoot":"","sources":["../src/intent-order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kCAA8B;AAE1D,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE;QACR,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;KAC9B,CAAC;CACH,CAAC"}
@@ -1,2 +0,0 @@
1
- import { IntentOrderStatus } from "./intent-order-status.mjs";
2
- //# sourceMappingURL=intent-order.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent-order.mjs","sourceRoot":"","sources":["../src/intent-order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kCAA8B","sourcesContent":["import { IntentOrderStatus } from './intent-order-status';\n\nexport type IntentOrder = {\n id: string;\n status: IntentOrderStatus;\n txHash?: string;\n metadata: {\n txHashes?: string[] | string;\n };\n};\n"]}