@metamask/connect-multichain 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -1
- package/README.md +415 -3
- package/dist/browser/es/connect-multichain.d.mts +33 -9
- package/dist/browser/es/connect-multichain.mjs +864 -510
- package/dist/browser/es/connect-multichain.mjs.map +1 -1
- package/dist/browser/es/metafile-esm.json +1 -1
- package/dist/browser/iife/connect-multichain.d.ts +33 -9
- package/dist/browser/iife/connect-multichain.js +24802 -24331
- package/dist/browser/iife/connect-multichain.js.map +1 -1
- package/dist/browser/iife/metafile-iife.json +1 -1
- package/dist/browser/umd/connect-multichain.d.ts +33 -9
- package/dist/browser/umd/connect-multichain.js +864 -510
- package/dist/browser/umd/connect-multichain.js.map +1 -1
- package/dist/browser/umd/metafile-cjs.json +1 -1
- package/dist/node/cjs/connect-multichain.d.ts +33 -9
- package/dist/node/cjs/connect-multichain.js +693 -340
- package/dist/node/cjs/connect-multichain.js.map +1 -1
- package/dist/node/cjs/metafile-cjs.json +1 -1
- package/dist/node/es/connect-multichain.d.mts +33 -9
- package/dist/node/es/connect-multichain.mjs +694 -339
- package/dist/node/es/connect-multichain.mjs.map +1 -1
- package/dist/node/es/metafile-esm.json +1 -1
- package/dist/react-native/es/connect-multichain.d.mts +33 -9
- package/dist/react-native/es/connect-multichain.mjs +857 -503
- package/dist/react-native/es/connect-multichain.mjs.map +1 -1
- package/dist/react-native/es/metafile-esm.json +1 -1
- package/dist/src/domain/logger/index.d.ts +1 -1
- package/dist/src/domain/logger/index.d.ts.map +1 -1
- package/dist/src/domain/logger/index.js.map +1 -1
- package/dist/src/domain/multichain/api/constants.js.map +1 -1
- package/dist/src/domain/multichain/api/types.d.ts +1 -1
- package/dist/src/domain/multichain/api/types.d.ts.map +1 -1
- package/dist/src/domain/multichain/index.d.ts +15 -4
- package/dist/src/domain/multichain/index.d.ts.map +1 -1
- package/dist/src/domain/multichain/index.js +14 -0
- package/dist/src/domain/multichain/index.js.map +1 -1
- package/dist/src/domain/multichain/types.d.ts +14 -0
- package/dist/src/domain/multichain/types.d.ts.map +1 -1
- package/dist/src/domain/platform/index.d.ts.map +1 -1
- package/dist/src/domain/platform/index.js +1 -0
- package/dist/src/domain/platform/index.js.map +1 -1
- package/dist/src/index.browser.d.ts.map +1 -1
- package/dist/src/index.browser.js +9 -4
- package/dist/src/index.browser.js.map +1 -1
- package/dist/src/index.native.d.ts.map +1 -1
- package/dist/src/index.native.js +9 -4
- package/dist/src/index.native.js.map +1 -1
- package/dist/src/index.node.d.ts.map +1 -1
- package/dist/src/index.node.js +8 -4
- package/dist/src/index.node.js.map +1 -1
- package/dist/src/multichain/index.d.ts +4 -3
- package/dist/src/multichain/index.d.ts.map +1 -1
- package/dist/src/multichain/index.js +181 -59
- package/dist/src/multichain/index.js.map +1 -1
- package/dist/src/multichain/rpc/handlers/rpcClient.d.ts +9 -2
- package/dist/src/multichain/rpc/handlers/rpcClient.d.ts.map +1 -1
- package/dist/src/multichain/rpc/handlers/rpcClient.js +13 -3
- package/dist/src/multichain/rpc/handlers/rpcClient.js.map +1 -1
- package/dist/src/multichain/rpc/requestRouter.d.ts +14 -1
- package/dist/src/multichain/rpc/requestRouter.d.ts.map +1 -1
- package/dist/src/multichain/rpc/requestRouter.js +27 -5
- package/dist/src/multichain/rpc/requestRouter.js.map +1 -1
- package/dist/src/multichain/transports/default/index.d.ts +5 -3
- package/dist/src/multichain/transports/default/index.d.ts.map +1 -1
- package/dist/src/multichain/transports/default/index.js +31 -28
- package/dist/src/multichain/transports/default/index.js.map +1 -1
- package/dist/src/multichain/transports/multichainApiClientWrapper/index.d.ts +3 -3
- package/dist/src/multichain/transports/multichainApiClientWrapper/index.d.ts.map +1 -1
- package/dist/src/multichain/transports/multichainApiClientWrapper/index.js +33 -29
- package/dist/src/multichain/transports/multichainApiClientWrapper/index.js.map +1 -1
- package/dist/src/multichain/transports/mwp/KeyManager.d.ts.map +1 -1
- package/dist/src/multichain/transports/mwp/KeyManager.js.map +1 -1
- package/dist/src/multichain/transports/mwp/index.d.ts +16 -3
- package/dist/src/multichain/transports/mwp/index.d.ts.map +1 -1
- package/dist/src/multichain/transports/mwp/index.js +157 -39
- package/dist/src/multichain/transports/mwp/index.js.map +1 -1
- package/dist/src/multichain/utils/analytics.d.ts.map +1 -1
- package/dist/src/multichain/utils/analytics.js +1 -0
- package/dist/src/multichain/utils/analytics.js.map +1 -1
- package/dist/src/multichain/utils/index.d.ts +48 -0
- package/dist/src/multichain/utils/index.d.ts.map +1 -1
- package/dist/src/multichain/utils/index.js +91 -6
- package/dist/src/multichain/utils/index.js.map +1 -1
- package/dist/src/polyfills/buffer-shim.js +5 -11
- package/dist/src/polyfills/buffer-shim.js.map +1 -1
- package/dist/src/store/adapters/node.d.ts +1 -1
- package/dist/src/store/adapters/node.d.ts.map +1 -1
- package/dist/src/store/adapters/node.js +11 -4
- package/dist/src/store/adapters/node.js.map +1 -1
- package/dist/src/store/adapters/rn.d.ts.map +1 -1
- package/dist/src/store/adapters/rn.js +1 -0
- package/dist/src/store/adapters/rn.js.map +1 -1
- package/dist/src/store/adapters/web.d.ts +5 -5
- package/dist/src/store/adapters/web.d.ts.map +1 -1
- package/dist/src/store/adapters/web.js +7 -1
- package/dist/src/store/adapters/web.js.map +1 -1
- package/dist/src/store/index.d.ts.map +1 -1
- package/dist/src/store/index.js +2 -0
- package/dist/src/store/index.js.map +1 -1
- package/dist/src/ui/ModalFactory.d.ts.map +1 -1
- package/dist/src/ui/ModalFactory.js +1 -4
- package/dist/src/ui/ModalFactory.js.map +1 -1
- package/dist/src/ui/index.d.ts.map +1 -1
- package/dist/src/ui/index.js +2 -0
- package/dist/src/ui/index.js.map +1 -1
- package/dist/src/ui/index.native.d.ts.map +1 -1
- package/dist/src/ui/index.native.js +4 -1
- package/dist/src/ui/index.native.js.map +1 -1
- package/dist/src/ui/modals/base/AbstractInstallModal.d.ts +2 -3
- package/dist/src/ui/modals/base/AbstractInstallModal.d.ts.map +1 -1
- package/dist/src/ui/modals/base/AbstractInstallModal.js +28 -12
- package/dist/src/ui/modals/base/AbstractInstallModal.js.map +1 -1
- package/dist/src/ui/modals/base/AbstractOTPModal.d.ts +2 -2
- package/dist/src/ui/modals/base/AbstractOTPModal.d.ts.map +1 -1
- package/dist/src/ui/modals/base/AbstractOTPModal.js.map +1 -1
- package/dist/src/ui/modals/base/utils.d.ts +12 -0
- package/dist/src/ui/modals/base/utils.d.ts.map +1 -1
- package/dist/src/ui/modals/base/utils.js +16 -5
- package/dist/src/ui/modals/base/utils.js.map +1 -1
- package/dist/src/ui/modals/node/install.d.ts.map +1 -1
- package/dist/src/ui/modals/node/install.js +1 -1
- package/dist/src/ui/modals/node/install.js.map +1 -1
- package/dist/src/ui/modals/node/otp.d.ts.map +1 -1
- package/dist/src/ui/modals/node/otp.js +6 -2
- package/dist/src/ui/modals/node/otp.js.map +1 -1
- package/dist/src/ui/modals/rn/install.d.ts.map +1 -1
- package/dist/src/ui/modals/rn/install.js +7 -3
- package/dist/src/ui/modals/rn/install.js.map +1 -1
- package/dist/src/ui/modals/rn/otp.d.ts.map +1 -1
- package/dist/src/ui/modals/rn/otp.js +6 -2
- package/dist/src/ui/modals/rn/otp.js.map +1 -1
- package/dist/src/ui/modals/web/install.d.ts.map +1 -1
- package/dist/src/ui/modals/web/install.js +1 -1
- package/dist/src/ui/modals/web/install.js.map +1 -1
- package/dist/src/ui/modals/web/otp.d.ts.map +1 -1
- package/dist/src/ui/modals/web/otp.js +6 -2
- package/dist/src/ui/modals/web/otp.js.map +1 -1
- package/dist/types/connect-multichain.d.ts +33 -9
- package/package.json +3 -3
|
@@ -7,14 +7,29 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
11
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
12
|
+
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");
|
|
13
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
14
|
+
};
|
|
15
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
16
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
17
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
18
|
+
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");
|
|
19
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
20
|
+
};
|
|
21
|
+
var _AbstractInstallModal_expirationInterval, _AbstractInstallModal_lastLoggedCountdown;
|
|
22
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type -- Getters/setters have inferred types */
|
|
23
|
+
/* eslint-disable require-atomic-updates -- False positive: connectionRequest is reassigned atomically */
|
|
24
|
+
/* eslint-disable @typescript-eslint/no-misused-promises -- setInterval callback is async intentionally */
|
|
11
25
|
import { formatRemainingTime, shouldLogCountdown } from './utils';
|
|
26
|
+
import { createLogger, Modal, } from '../../../domain';
|
|
12
27
|
const logger = createLogger('metamask-sdk:ui');
|
|
13
28
|
export class AbstractInstallModal extends Modal {
|
|
14
29
|
constructor() {
|
|
15
30
|
super(...arguments);
|
|
16
|
-
this
|
|
17
|
-
this
|
|
31
|
+
_AbstractInstallModal_expirationInterval.set(this, null);
|
|
32
|
+
_AbstractInstallModal_lastLoggedCountdown.set(this, -1);
|
|
18
33
|
}
|
|
19
34
|
get link() {
|
|
20
35
|
return this.data;
|
|
@@ -42,17 +57,17 @@ export class AbstractInstallModal extends Modal {
|
|
|
42
57
|
startExpirationCheck(connectionRequest) {
|
|
43
58
|
this.stopExpirationCheck();
|
|
44
59
|
let currentConnectionRequest = connectionRequest;
|
|
45
|
-
this
|
|
60
|
+
__classPrivateFieldSet(this, _AbstractInstallModal_expirationInterval, setInterval(() => __awaiter(this, void 0, void 0, function* () {
|
|
46
61
|
const { sessionRequest } = currentConnectionRequest;
|
|
47
62
|
const now = Date.now();
|
|
48
63
|
const remainingMs = sessionRequest.expiresAt - now;
|
|
49
64
|
const remainingSeconds = Math.floor(remainingMs / 1000);
|
|
50
65
|
if (remainingMs > 0 &&
|
|
51
66
|
shouldLogCountdown(remainingSeconds) &&
|
|
52
|
-
this
|
|
67
|
+
__classPrivateFieldGet(this, _AbstractInstallModal_lastLoggedCountdown, "f") !== remainingSeconds) {
|
|
53
68
|
const formattedTime = formatRemainingTime(remainingMs);
|
|
54
69
|
logger(`[UI: InstallModal-nodejs()] QR code expires in: ${formattedTime} (${remainingSeconds}s)`);
|
|
55
|
-
this
|
|
70
|
+
__classPrivateFieldSet(this, _AbstractInstallModal_lastLoggedCountdown, remainingSeconds, "f");
|
|
56
71
|
}
|
|
57
72
|
if (now >= sessionRequest.expiresAt) {
|
|
58
73
|
this.stopExpirationCheck();
|
|
@@ -62,8 +77,8 @@ export class AbstractInstallModal extends Modal {
|
|
|
62
77
|
currentConnectionRequest =
|
|
63
78
|
yield this.options.createConnectionRequest();
|
|
64
79
|
const generateQRCode = yield this.options.generateQRCode(currentConnectionRequest);
|
|
65
|
-
this
|
|
66
|
-
//Update local instances with new data
|
|
80
|
+
__classPrivateFieldSet(this, _AbstractInstallModal_lastLoggedCountdown, -1, "f"); // Reset countdown logging
|
|
81
|
+
// Update local instances with new data
|
|
67
82
|
this.updateLink(generateQRCode);
|
|
68
83
|
this.updateExpiresIn(remainingSeconds);
|
|
69
84
|
// Render QRCode on each platform
|
|
@@ -73,14 +88,15 @@ export class AbstractInstallModal extends Modal {
|
|
|
73
88
|
logger(`[UI: InstallModal-nodejs()] ❌ Error generating new QR code: ${error}`);
|
|
74
89
|
}
|
|
75
90
|
}
|
|
76
|
-
}), 1000);
|
|
91
|
+
}), 1000), "f");
|
|
77
92
|
}
|
|
78
93
|
stopExpirationCheck() {
|
|
79
|
-
if (this
|
|
80
|
-
clearInterval(this
|
|
81
|
-
this
|
|
94
|
+
if (__classPrivateFieldGet(this, _AbstractInstallModal_expirationInterval, "f")) {
|
|
95
|
+
clearInterval(__classPrivateFieldGet(this, _AbstractInstallModal_expirationInterval, "f"));
|
|
96
|
+
__classPrivateFieldSet(this, _AbstractInstallModal_expirationInterval, null, "f");
|
|
82
97
|
logger('[UI: InstallModal-nodejs()] 🛑 Stopped QR code expiration checking');
|
|
83
98
|
}
|
|
84
99
|
}
|
|
85
100
|
}
|
|
101
|
+
_AbstractInstallModal_expirationInterval = new WeakMap(), _AbstractInstallModal_lastLoggedCountdown = new WeakMap();
|
|
86
102
|
//# sourceMappingURL=AbstractInstallModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractInstallModal.js","sourceRoot":"","sources":["../../../../../src/ui/modals/base/AbstractInstallModal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AbstractInstallModal.js","sourceRoot":"","sources":["../../../../../src/ui/modals/base/AbstractInstallModal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,4GAA4G;AAC5G,yGAAyG;AACzG,0GAA0G;AAC1G,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAEL,YAAY,EAEZ,KAAK,GAEN,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,GAAG,YAAY,CAAC,iBAAiB,CAAC,CAAC;AAE/C,MAAM,OAAgB,oBAAqB,SAAQ,KAAyB;IAA5E;;QAGE,mDAA6C,IAAI,EAAC;QAElD,oDAA+B,CAAC,CAAC,EAAC;IAkGpC,CAAC;IA3FC,IAAI,IAAI;QACN,OAAO,IA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al<OTPCodeWidgetProps
|
|
1
|
+
import { Modal, type OTPCodeWidgetProps } from '../../../domain';
|
|
2
|
+
export declare abstract class AbstractOTPCodeModal extends Modal<OTPCodeWidgetProps> {
|
|
3
3
|
protected instance?: HTMLMmOtpModalElement | undefined;
|
|
4
4
|
get otpCode(): string;
|
|
5
5
|
set otpCode(code: string);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractOTPModal.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/base/AbstractOTPModal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"AbstractOTPModal.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/base/AbstractOTPModal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEjE,8BAAsB,oBAAqB,SAAQ,KAAK,CAAC,kBAAkB,CAAC;IAC1E,SAAS,CAAC,QAAQ,CAAC,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAEvD,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,OAAO,CAAC,IAAI,EAAE,MAAM,EAEvB;IAED,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAMlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractOTPModal.js","sourceRoot":"","sources":["../../../../../src/ui/modals/base/AbstractOTPModal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"AbstractOTPModal.js","sourceRoot":"","sources":["../../../../../src/ui/modals/base/AbstractOTPModal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAA2B,MAAM,iBAAiB,CAAC;AAEjE,MAAM,OAAgB,oBAAqB,SAAQ,KAAyB;IAG1E,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,IAAI,OAAO,CAAC,IAAY;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,aAAa,CAAC,IAAY;QACxB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;QAC/B,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats remaining time in a human-readable format.
|
|
3
|
+
*
|
|
4
|
+
* @param milliseconds - The remaining time in milliseconds.
|
|
5
|
+
* @returns A formatted string representing the remaining time.
|
|
6
|
+
*/
|
|
1
7
|
export declare function formatRemainingTime(milliseconds: number): string;
|
|
8
|
+
/**
|
|
9
|
+
* Determines whether to log the countdown at the current remaining seconds.
|
|
10
|
+
*
|
|
11
|
+
* @param remainingSeconds - The remaining seconds until expiration.
|
|
12
|
+
* @returns True if the countdown should be logged, false otherwise.
|
|
13
|
+
*/
|
|
2
14
|
export declare function shouldLogCountdown(remainingSeconds: number): boolean;
|
|
3
15
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/base/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/base/utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAMhE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAiBpE"}
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats remaining time in a human-readable format.
|
|
3
|
+
*
|
|
4
|
+
* @param milliseconds - The remaining time in milliseconds.
|
|
5
|
+
* @returns A formatted string representing the remaining time.
|
|
6
|
+
*/
|
|
1
7
|
export function formatRemainingTime(milliseconds) {
|
|
2
|
-
if (milliseconds <= 0)
|
|
8
|
+
if (milliseconds <= 0) {
|
|
3
9
|
return 'EXPIRED';
|
|
10
|
+
}
|
|
4
11
|
const seconds = Math.floor(milliseconds / 1000);
|
|
5
12
|
return `${seconds}s`;
|
|
6
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Determines whether to log the countdown at the current remaining seconds.
|
|
16
|
+
*
|
|
17
|
+
* @param remainingSeconds - The remaining seconds until expiration.
|
|
18
|
+
* @returns True if the countdown should be logged, false otherwise.
|
|
19
|
+
*/
|
|
7
20
|
export function shouldLogCountdown(remainingSeconds) {
|
|
8
21
|
// Log at specific intervals to avoid spam
|
|
9
22
|
if (remainingSeconds <= 10) {
|
|
@@ -22,9 +35,7 @@ export function shouldLogCountdown(remainingSeconds) {
|
|
|
22
35
|
// Log every 30 seconds for the last 5 minutes
|
|
23
36
|
return remainingSeconds % 30 === 0;
|
|
24
37
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return remainingSeconds % 60 === 0;
|
|
28
|
-
}
|
|
38
|
+
// Log every minute for longer durations
|
|
39
|
+
return remainingSeconds % 60 === 0;
|
|
29
40
|
}
|
|
30
41
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/ui/modals/base/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,mBAAmB,CAAC,YAAoB;IACtD,IAAI,YAAY,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/ui/modals/base/utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,YAAoB;IACtD,IAAI,YAAY,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAChD,OAAO,GAAG,OAAO,GAAG,CAAC;AACvB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,gBAAwB;IACzD,0CAA0C;IAC1C,IAAI,gBAAgB,IAAI,EAAE,EAAE,CAAC;QAC3B,2CAA2C;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,IAAI,gBAAgB,IAAI,EAAE,EAAE,CAAC;QAClC,8CAA8C;QAC9C,OAAO,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;SAAM,IAAI,gBAAgB,IAAI,EAAE,EAAE,CAAC;QAClC,2CAA2C;QAC3C,OAAO,gBAAgB,GAAG,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;SAAM,IAAI,gBAAgB,IAAI,GAAG,EAAE,CAAC;QACnC,8CAA8C;QAC9C,OAAO,gBAAgB,GAAG,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;IACD,wCAAwC;IACxC,OAAO,gBAAgB,GAAG,EAAE,KAAK,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/node/install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/node/install.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,MAAM,EACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAKpE,qBAAa,YAAa,SAAQ,oBAAoB;IACpD,OAAO,CAAC,sBAAsB;IAgB9B,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,iBAAiB,GAAG,IAAI;IAiBtE,KAAK;IAQL,OAAO,IAAI,IAAI;CAIhB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
2
2
|
/* eslint-disable no-restricted-syntax */
|
|
3
|
-
import { createLogger, } from '../../../domain';
|
|
4
3
|
import encodeQR from '@paulmillr/qr';
|
|
4
|
+
import { createLogger, } from '../../../domain';
|
|
5
5
|
import { AbstractInstallModal } from '../base/AbstractInstallModal';
|
|
6
6
|
import { formatRemainingTime, shouldLogCountdown } from '../base/utils';
|
|
7
7
|
const logger = createLogger('metamask-sdk:ui');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../../../src/ui/modals/node/install.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,yCAAyC;AACzC,OAAO,
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../../../src/ui/modals/node/install.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,yCAAyC;AACzC,OAAO,QAAQ,MAAM,eAAe,CAAC;AAErC,OAAO,EAEL,YAAY,GAEb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExE,MAAM,MAAM,GAAG,YAAY,CAAC,iBAAiB,CAAC,CAAC;AAE/C,MAAM,OAAO,YAAa,SAAQ,oBAAoB;IAC5C,sBAAsB,CAAC,UAAkB,EAAE,WAAmB;QACpE,MAAM,SAAS,GAAG,WAAW,IAAI,CAAC,CAAC;QACnC,MAAM,aAAa,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;QACvD,MAAM,MAAM,GAAG,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAE7C,wDAAwD;QAC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@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/node/otp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;GAGG;AACH,qBAAa,YAAa,SAAQ,oBAAoB;IACpD,KAAK;
|
|
1
|
+
{"version":3,"file":"otp.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/node/otp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;GAGG;AACH,qBAAa,YAAa,SAAQ,oBAAoB;IACpD,KAAK,IAAI,IAAI;IAIb,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -4,7 +4,11 @@ import { AbstractOTPCodeModal } from '../base/AbstractOTPModal';
|
|
|
4
4
|
* It will be replaced with the actual OTP code modal once it is implemented.
|
|
5
5
|
*/
|
|
6
6
|
export class OTPCodeModal extends AbstractOTPCodeModal {
|
|
7
|
-
mount() {
|
|
8
|
-
|
|
7
|
+
mount() {
|
|
8
|
+
// No-op: placeholder implementation
|
|
9
|
+
}
|
|
10
|
+
unmount() {
|
|
11
|
+
// No-op: placeholder implementation
|
|
12
|
+
}
|
|
9
13
|
}
|
|
10
14
|
//# sourceMappingURL=otp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp.js","sourceRoot":"","sources":["../../../../../src/ui/modals/node/otp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,oBAAoB;IACpD,KAAK,
|
|
1
|
+
{"version":3,"file":"otp.js","sourceRoot":"","sources":["../../../../../src/ui/modals/node/otp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,oBAAoB;IACpD,KAAK;QACH,oCAAoC;IACtC,CAAC;IAED,OAAO;QACL,oCAAoC;IACtC,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/rn/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,qBAAa,YAAa,SAAQ,oBAAoB;IACpD,YAAY,IAAI,IAAI;IAIpB,KAAK;
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/rn/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,qBAAa,YAAa,SAAQ,oBAAoB;IACpD,YAAY,IAAI,IAAI;IAIpB,KAAK,IAAI,IAAI;IAIb,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { AbstractInstallModal } from '../base/AbstractInstallModal';
|
|
2
2
|
export class InstallModal extends AbstractInstallModal {
|
|
3
3
|
renderQRCode() {
|
|
4
|
-
//Not needed for RN (WORK IN Progress)
|
|
4
|
+
// Not needed for RN (WORK IN Progress)
|
|
5
|
+
}
|
|
6
|
+
mount() {
|
|
7
|
+
// No-op: React Native modal mounting handled by RN component
|
|
8
|
+
}
|
|
9
|
+
unmount() {
|
|
10
|
+
// No-op: React Native modal unmounting handled by RN component
|
|
5
11
|
}
|
|
6
|
-
mount() { }
|
|
7
|
-
unmount() { }
|
|
8
12
|
}
|
|
9
13
|
//# sourceMappingURL=install.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../../../src/ui/modals/rn/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,OAAO,YAAa,SAAQ,oBAAoB;IACpD,YAAY;QACV,
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../../../src/ui/modals/rn/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,OAAO,YAAa,SAAQ,oBAAoB;IACpD,YAAY;QACV,uCAAuC;IACzC,CAAC;IAED,KAAK;QACH,6DAA6D;IAC/D,CAAC;IAED,OAAO;QACL,+DAA+D;IACjE,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/rn/otp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;GAGG;AACH,qBAAa,YAAa,SAAQ,oBAAoB;IACpD,KAAK;
|
|
1
|
+
{"version":3,"file":"otp.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/rn/otp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;GAGG;AACH,qBAAa,YAAa,SAAQ,oBAAoB;IACpD,KAAK,IAAI,IAAI;IAIb,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -4,7 +4,11 @@ import { AbstractOTPCodeModal } from '../base/AbstractOTPModal';
|
|
|
4
4
|
* It will be replaced with the actual OTP code modal once it is implemented.
|
|
5
5
|
*/
|
|
6
6
|
export class OTPCodeModal extends AbstractOTPCodeModal {
|
|
7
|
-
mount() {
|
|
8
|
-
|
|
7
|
+
mount() {
|
|
8
|
+
// No-op: placeholder implementation
|
|
9
|
+
}
|
|
10
|
+
unmount() {
|
|
11
|
+
// No-op: placeholder implementation
|
|
12
|
+
}
|
|
9
13
|
}
|
|
10
14
|
//# sourceMappingURL=otp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp.js","sourceRoot":"","sources":["../../../../../src/ui/modals/rn/otp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,oBAAoB;IACpD,KAAK,
|
|
1
|
+
{"version":3,"file":"otp.js","sourceRoot":"","sources":["../../../../../src/ui/modals/rn/otp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,oBAAoB;IACpD,KAAK;QACH,oCAAoC;IACtC,CAAC;IAED,OAAO;QACL,oCAAoC;IACtC,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/web/install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/web/install.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,qBAAa,YAAa,SAAQ,oBAAoB;IACpD,YAAY,IAAI,IAAI;IAIpB,KAAK,IAAI,IAAI;IA0Bb,OAAO,IAAI,IAAI;CAQhB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractInstallModal } from '../base/AbstractInstallModal';
|
|
2
2
|
export class InstallModal extends AbstractInstallModal {
|
|
3
3
|
renderQRCode() {
|
|
4
|
-
//Not needed for web as its using install Modal
|
|
4
|
+
// Not needed for web as its using install Modal
|
|
5
5
|
}
|
|
6
6
|
mount() {
|
|
7
7
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../../../src/ui/modals/web/install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../../../src/ui/modals/web/install.ts"],"names":[],"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QAAQ,GAAG,SAAS,CAAC;QAC5B,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/web/otp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;GAGG;AACH,qBAAa,YAAa,SAAQ,oBAAoB;IACpD,KAAK;
|
|
1
|
+
{"version":3,"file":"otp.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/web/otp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;GAGG;AACH,qBAAa,YAAa,SAAQ,oBAAoB;IACpD,KAAK,IAAI,IAAI;IAIb,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -4,7 +4,11 @@ import { AbstractOTPCodeModal } from '../base/AbstractOTPModal';
|
|
|
4
4
|
* It will be replaced with the actual OTP code modal once it is implemented.
|
|
5
5
|
*/
|
|
6
6
|
export class OTPCodeModal extends AbstractOTPCodeModal {
|
|
7
|
-
mount() {
|
|
8
|
-
|
|
7
|
+
mount() {
|
|
8
|
+
// No-op: placeholder implementation
|
|
9
|
+
}
|
|
10
|
+
unmount() {
|
|
11
|
+
// No-op: placeholder implementation
|
|
12
|
+
}
|
|
9
13
|
}
|
|
10
14
|
//# sourceMappingURL=otp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp.js","sourceRoot":"","sources":["../../../../../src/ui/modals/web/otp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,oBAAoB;IACpD,KAAK,
|
|
1
|
+
{"version":3,"file":"otp.js","sourceRoot":"","sources":["../../../../../src/ui/modals/web/otp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,oBAAoB;IACpD,KAAK;QACH,oCAAoC;IACtC,CAAC;IAED,OAAO;QACL,oCAAoC;IACtC,CAAC;CACF"}
|
|
@@ -265,17 +265,16 @@ type RPCResponse = {
|
|
|
265
265
|
result: unknown;
|
|
266
266
|
};
|
|
267
267
|
|
|
268
|
-
declare abstract class AbstractOTPCodeModal extends Modal<OTPCodeWidgetProps
|
|
268
|
+
declare abstract class AbstractOTPCodeModal extends Modal<OTPCodeWidgetProps> {
|
|
269
269
|
protected instance?: HTMLMmOtpModalElement | undefined;
|
|
270
270
|
get otpCode(): string;
|
|
271
271
|
set otpCode(code: string);
|
|
272
272
|
updateOTPCode(code: string): void;
|
|
273
273
|
}
|
|
274
274
|
|
|
275
|
-
declare abstract class AbstractInstallModal extends Modal<InstallWidgetProps
|
|
275
|
+
declare abstract class AbstractInstallModal extends Modal<InstallWidgetProps> {
|
|
276
|
+
#private;
|
|
276
277
|
protected instance?: HTMLMmInstallModalElement | undefined;
|
|
277
|
-
private expirationInterval;
|
|
278
|
-
private lastLoggedCountdown;
|
|
279
278
|
abstract renderQRCode(link: QRLink, connectionRequest: ConnectionRequest): void;
|
|
280
279
|
get link(): QRLink;
|
|
281
280
|
set link(link: QRLink);
|
|
@@ -428,12 +427,24 @@ type MultichainOptions = {
|
|
|
428
427
|
extensionId?: string;
|
|
429
428
|
onNotification?: (notification: unknown) => void;
|
|
430
429
|
};
|
|
430
|
+
/** Enable debug logging */
|
|
431
|
+
debug?: boolean;
|
|
431
432
|
};
|
|
432
433
|
type MultiChainFNOptions = Omit<MultichainOptions, 'storage' | 'ui'> & {
|
|
433
434
|
ui?: Omit<MultichainOptions['ui'], 'factory'>;
|
|
434
435
|
} & {
|
|
435
436
|
storage?: StoreClient;
|
|
436
437
|
};
|
|
438
|
+
/**
|
|
439
|
+
* Options that can be merged/overwritten when createMultichainClient is called
|
|
440
|
+
* with an existing singleton.
|
|
441
|
+
*/
|
|
442
|
+
type MergeableMultichainOptions = Omit<MultichainOptions, 'dapp' | 'analytics' | 'storage' | 'api' | 'ui' | 'transport'> & {
|
|
443
|
+
api?: MultichainOptions['api'];
|
|
444
|
+
ui?: Pick<MultichainOptions['ui'], 'headless' | 'preferExtension' | 'showInstallModal'>;
|
|
445
|
+
transport?: Pick<NonNullable<MultichainOptions['transport']>, 'extensionId'>;
|
|
446
|
+
debug?: boolean;
|
|
447
|
+
};
|
|
437
448
|
/**
|
|
438
449
|
* Complete options for Multichain SDK configuration.
|
|
439
450
|
*
|
|
@@ -452,6 +463,8 @@ type ExtendedTransport = Omit<Transport, 'connect'> & {
|
|
|
452
463
|
timeout?: number;
|
|
453
464
|
}) => Promise<TResponse>;
|
|
454
465
|
getActiveSession: () => Promise<Session | undefined>;
|
|
466
|
+
getStoredPendingSessionRequest: () => Promise<SessionRequest | null>;
|
|
467
|
+
disconnect: (scopes: Scope[]) => Promise<void>;
|
|
455
468
|
};
|
|
456
469
|
|
|
457
470
|
declare const infuraRpcUrls: RpcUrlsMap;
|
|
@@ -473,7 +486,7 @@ declare enum TransportType {
|
|
|
473
486
|
* must provide, including session management, connection handling, and method invocation.
|
|
474
487
|
*/
|
|
475
488
|
declare abstract class MultichainCore extends EventEmitter<SDKEvents> {
|
|
476
|
-
protected
|
|
489
|
+
protected options: MultichainOptions;
|
|
477
490
|
abstract storage: StoreClient;
|
|
478
491
|
abstract status: ConnectionStatus;
|
|
479
492
|
abstract provider: MultichainApiClient<RPCAPI>;
|
|
@@ -490,7 +503,7 @@ declare abstract class MultichainCore extends EventEmitter<SDKEvents> {
|
|
|
490
503
|
*
|
|
491
504
|
* @returns Promise that resolves when disconnection is complete
|
|
492
505
|
*/
|
|
493
|
-
abstract disconnect(): Promise<void>;
|
|
506
|
+
abstract disconnect(scopes?: Scope[]): Promise<void>;
|
|
494
507
|
/**
|
|
495
508
|
* Invokes an RPC method with the specified options.
|
|
496
509
|
*
|
|
@@ -498,8 +511,19 @@ declare abstract class MultichainCore extends EventEmitter<SDKEvents> {
|
|
|
498
511
|
* @returns Promise that resolves to the method result
|
|
499
512
|
*/
|
|
500
513
|
abstract invokeMethod(options: InvokeMethodOptions): Promise<Json>;
|
|
501
|
-
abstract
|
|
514
|
+
abstract openSimpleDeeplinkIfNeeded(): void;
|
|
515
|
+
abstract emitSessionChanged(): Promise<void>;
|
|
502
516
|
constructor(options: MultichainOptions);
|
|
517
|
+
/**
|
|
518
|
+
* Merges the given options into the current instance options.
|
|
519
|
+
* Only the mergeable keys are updated (api.supportedNetworks, ui.*, mobile.*, transport.extensionId, debug).
|
|
520
|
+
* The main thing to note is that the value for `dapp` is not merged as it does not make sense for
|
|
521
|
+
* subsequent calls to `createMultichainClient` to have a different `dapp` value.
|
|
522
|
+
* Used when createMultichainClient is called with an existing singleton.
|
|
523
|
+
*
|
|
524
|
+
* @param partial - Options to merge/overwrite onto the current instance
|
|
525
|
+
*/
|
|
526
|
+
mergeOptions(partial: MergeableMultichainOptions): void;
|
|
503
527
|
}
|
|
504
528
|
declare function getTransportType(type: string): TransportType;
|
|
505
529
|
|
|
@@ -521,7 +545,7 @@ declare abstract class StoreClient {
|
|
|
521
545
|
* Supported debug namespace types for the MetaMask SDK logger.
|
|
522
546
|
* These namespaces help categorize and filter debug output.
|
|
523
547
|
*/
|
|
524
|
-
type LoggerNameSpaces = 'metamask-sdk' | 'metamask-sdk:core' | 'metamask-sdk:provider' | 'metamask-sdk:ui' | 'metamask-sdk:transport';
|
|
548
|
+
type LoggerNameSpaces = 'metamask-sdk:*' | 'metamask-sdk' | 'metamask-sdk:core' | 'metamask-sdk:provider' | 'metamask-sdk:ui' | 'metamask-sdk:transport';
|
|
525
549
|
/**
|
|
526
550
|
* Creates a debug logger instance with the specified namespace and color.
|
|
527
551
|
*
|
|
@@ -651,4 +675,4 @@ declare function getVersion(): string;
|
|
|
651
675
|
|
|
652
676
|
declare const createMultichainClient: CreateMultichainFN;
|
|
653
677
|
|
|
654
|
-
export { type ConnectionRequest, type ConnectionStatus, type CreateMultichainFN, type DappSettings, type DataType, type DomainErrorCodes, type Enumerate, type ErrorCodeRange, type ErrorCodes, EventEmitter, type EventTypes, type ExtendedTransport, type InstallWidgetProps, type InvokeMethodOptions, type LoggerNameSpaces, Modal, type ModalFactoryConnectOptions, type ModalFactoryOptions, MultichainCore, type MultichainOptions, type NotificationCallback, type OTPCode, type OTPCodeWidgetProps, PlatformType, type QRLink, type RPCAPI, type RPCErrorCodes, RPCHttpErr, RPCInvokeMethodErr, RPCReadonlyRequestErr, RPCReadonlyResponseErr, type RPCResponse, RPC_HANDLED_METHODS, type RpcMethod, type RpcUrlsMap, type SDKEvents, SDK_HANDLED_METHODS, type Scope, type StorageErrorCodes, StoreAdapter, StoreClient, type StoreOptions, TransportType, createLogger, createMultichainClient, enableDebug, getInfuraRpcUrls, getPlatformType, getTransportType, getVersion, getWalletActionAnalyticsProperties, hasExtension, infuraRpcUrls, isEnabled, isMetamaskExtensionInstalled, isRejectionError, isSecure };
|
|
678
|
+
export { type ConnectionRequest, type ConnectionStatus, type CreateMultichainFN, type DappSettings, type DataType, type DomainErrorCodes, type Enumerate, type ErrorCodeRange, type ErrorCodes, EventEmitter, type EventTypes, type ExtendedTransport, type InstallWidgetProps, type InvokeMethodOptions, type LoggerNameSpaces, type MergeableMultichainOptions, Modal, type ModalFactoryConnectOptions, type ModalFactoryOptions, MultichainCore, type MultichainOptions, type NotificationCallback, type OTPCode, type OTPCodeWidgetProps, PlatformType, type QRLink, type RPCAPI, type RPCErrorCodes, RPCHttpErr, RPCInvokeMethodErr, RPCReadonlyRequestErr, RPCReadonlyResponseErr, type RPCResponse, RPC_HANDLED_METHODS, type RpcMethod, type RpcUrlsMap, type SDKEvents, SDK_HANDLED_METHODS, type Scope, type StorageErrorCodes, StoreAdapter, StoreClient, type StoreOptions, TransportType, createLogger, createMultichainClient, enableDebug, getInfuraRpcUrls, getPlatformType, getTransportType, getVersion, getWalletActionAnalyticsProperties, hasExtension, infuraRpcUrls, isEnabled, isMetamaskExtensionInstalled, isRejectionError, isSecure };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask/connect-multichain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Multichain package for MetaMask Connect",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"dist/"
|
|
51
51
|
],
|
|
52
52
|
"scripts": {
|
|
53
|
+
"allow-scripts": "",
|
|
53
54
|
"build": "yarn clean && tsc -b tsconfig.build.json && npx tsup",
|
|
54
55
|
"build:docs": "typedoc",
|
|
55
56
|
"changelog:format": "../../scripts/format-changelog.sh @metamask/connect-multichain",
|
|
@@ -66,8 +67,7 @@
|
|
|
66
67
|
"test:ci": "yarn pretest:ci && vitest run --coverage --coverage.reporter=text --silent",
|
|
67
68
|
"test:unit": "vitest run",
|
|
68
69
|
"test:verbose": "vitest run --reporter=verbose",
|
|
69
|
-
"test:watch": "vitest watch"
|
|
70
|
-
"allow-scripts": ""
|
|
70
|
+
"test:watch": "vitest watch"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"@metamask/analytics": "^0.2.0",
|