@dynamic-labs-sdk/client 1.4.0 → 1.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/dist/{InvalidParamError-CDmVW2DS.native.esm.js → InvalidParamError-BIptAjbC.native.esm.js} +839 -93
- package/dist/InvalidParamError-BIptAjbC.native.esm.js.map +1 -0
- package/dist/{InvalidParamError-BPMi0iWC.esm.js → InvalidParamError-BZ0LHaml.esm.js} +806 -93
- package/dist/InvalidParamError-BZ0LHaml.esm.js.map +1 -0
- package/dist/{InvalidParamError-DEmLKJKZ.cjs → InvalidParamError-DyXEKMWn.cjs} +1012 -116
- package/dist/InvalidParamError-DyXEKMWn.cjs.map +1 -0
- package/dist/{NotWaasWalletAccountError-Cntietge.esm.js → NotWaasWalletAccountError-BbOA5rPd.native.esm.js} +4 -4
- package/dist/NotWaasWalletAccountError-BbOA5rPd.native.esm.js.map +1 -0
- package/dist/{NotWaasWalletAccountError-BZsBHRQe.cjs → NotWaasWalletAccountError-CElqwdQO.cjs} +4 -4
- package/dist/NotWaasWalletAccountError-CElqwdQO.cjs.map +1 -0
- package/dist/{NotWaasWalletAccountError-Chpne8_Q.native.esm.js → NotWaasWalletAccountError-nT4jrLbp.esm.js} +4 -4
- package/dist/NotWaasWalletAccountError-nT4jrLbp.esm.js.map +1 -0
- package/dist/core.cjs +45 -23
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +27 -6
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +27 -6
- package/dist/core.native.esm.js.map +1 -1
- package/dist/errors/CorruptedKeyShareError.d.ts +19 -0
- package/dist/errors/CorruptedKeyShareError.d.ts.map +1 -0
- package/dist/errors/WebViewLoadFailedError.d.ts +32 -0
- package/dist/errors/WebViewLoadFailedError.d.ts.map +1 -0
- package/dist/errors/base/BaseError.d.ts.map +1 -1
- package/dist/exports/core.d.ts +4 -0
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/exports/index.d.ts +12 -0
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-JGrKwBj7.native.esm.js → getNetworkProviderFromNetworkId-B7DIqT2T.native.esm.js} +39 -328
- package/dist/getNetworkProviderFromNetworkId-B7DIqT2T.native.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-CEeFL-gV.esm.js → getNetworkProviderFromNetworkId-BkAPIdRC.esm.js} +38 -266
- package/dist/getNetworkProviderFromNetworkId-BkAPIdRC.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-szJOsbQN.cjs → getNetworkProviderFromNetworkId-DbI5MZhq.cjs} +44 -341
- package/dist/getNetworkProviderFromNetworkId-DbI5MZhq.cjs.map +1 -0
- package/dist/{getSignedSessionId-B5DikCap.native.esm.js → getSignedSessionId-1TV-x__C.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-B5DikCap.native.esm.js.map → getSignedSessionId-1TV-x__C.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-BxOK-Tdo.cjs → getSignedSessionId-BF6n8gve.cjs} +3 -3
- package/dist/{getSignedSessionId-BxOK-Tdo.cjs.map → getSignedSessionId-BF6n8gve.cjs.map} +1 -1
- package/dist/{getSignedSessionId-BOx1nFt_.esm.js → getSignedSessionId-y3YtxFHZ.esm.js} +3 -3
- package/dist/{getSignedSessionId-BOx1nFt_.esm.js.map → getSignedSessionId-y3YtxFHZ.esm.js.map} +1 -1
- package/dist/getVerifiedCredentialForWalletAccount-BfJ29erz.cjs +346 -0
- package/dist/getVerifiedCredentialForWalletAccount-BfJ29erz.cjs.map +1 -0
- package/dist/getVerifiedCredentialForWalletAccount-CLyC2nOl.native.esm.js +269 -0
- package/dist/getVerifiedCredentialForWalletAccount-CLyC2nOl.native.esm.js.map +1 -0
- package/dist/getVerifiedCredentialForWalletAccount-etV50QRH.esm.js +269 -0
- package/dist/getVerifiedCredentialForWalletAccount-etV50QRH.esm.js.map +1 -0
- package/dist/index.cjs +580 -253
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +511 -191
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +511 -191
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-DUvZEpjA.native.esm.js → isMfaRequiredForAction-B2vKX31S.native.esm.js} +32 -3
- package/dist/isMfaRequiredForAction-B2vKX31S.native.esm.js.map +1 -0
- package/dist/{isMfaRequiredForAction-D9p_du8C.esm.js → isMfaRequiredForAction-Dy4-S3mr.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-D9p_du8C.esm.js.map → isMfaRequiredForAction-Dy4-S3mr.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-6N6JB7wa.cjs → isMfaRequiredForAction-K2Jh-3-j.cjs} +2 -2
- package/dist/{isMfaRequiredForAction-6N6JB7wa.cjs.map → isMfaRequiredForAction-K2Jh-3-j.cjs.map} +1 -1
- package/dist/modules/apiClient/apiClient.types.d.ts +12 -0
- package/dist/modules/apiClient/apiClient.types.d.ts.map +1 -1
- package/dist/modules/apiClient/createApiClient.d.ts.map +1 -1
- package/dist/modules/apiClient/utils/sessionExpiryLogoutMiddleware/createSessionExpiryLogoutMiddleware.d.ts +27 -0
- package/dist/modules/apiClient/utils/sessionExpiryLogoutMiddleware/createSessionExpiryLogoutMiddleware.d.ts.map +1 -0
- package/dist/modules/auth/isSignedIn/isSignedIn.d.ts +11 -1
- package/dist/modules/auth/isSignedIn/isSignedIn.d.ts.map +1 -1
- package/dist/modules/auth/logoutReason.d.ts +1 -1
- package/dist/modules/auth/logoutReason.d.ts.map +1 -1
- package/dist/modules/auth/logoutWithReason/logoutWithReason.d.ts.map +1 -1
- package/dist/modules/balances/getBalances/getBalances.d.ts +9 -45
- package/dist/modules/balances/getBalances/getBalances.d.ts.map +1 -1
- package/dist/modules/balances/getMultichainBalances/getMultichainBalances.d.ts +13 -20
- package/dist/modules/balances/getMultichainBalances/getMultichainBalances.d.ts.map +1 -1
- package/dist/modules/balances/getMultichainTokenBalances/getMultichainTokenBalances.d.ts +26 -0
- package/dist/modules/balances/getMultichainTokenBalances/getMultichainTokenBalances.d.ts.map +1 -0
- package/dist/modules/balances/getMultichainTokenBalances/index.d.ts +2 -0
- package/dist/modules/balances/getMultichainTokenBalances/index.d.ts.map +1 -0
- package/dist/modules/balances/getTokenBalances/getTokenBalances.d.ts +56 -0
- package/dist/modules/balances/getTokenBalances/getTokenBalances.d.ts.map +1 -0
- package/dist/modules/balances/getTokenBalances/index.d.ts +3 -0
- package/dist/modules/balances/getTokenBalances/index.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.d.ts.map +1 -1
- package/dist/modules/funding/moonpay/errors/MoonPayCurrenciesFetchError.d.ts +5 -0
- package/dist/modules/funding/moonpay/errors/MoonPayCurrenciesFetchError.d.ts.map +1 -0
- package/dist/modules/funding/moonpay/errors/MoonPayInvalidUrlError.d.ts +5 -0
- package/dist/modules/funding/moonpay/errors/MoonPayInvalidUrlError.d.ts.map +1 -0
- package/dist/modules/funding/moonpay/errors/MoonPayProviderNotAvailableError.d.ts +5 -0
- package/dist/modules/funding/moonpay/errors/MoonPayProviderNotAvailableError.d.ts.map +1 -0
- package/dist/modules/funding/moonpay/getMoonPayCurrencies/getMoonPayCurrencies.d.ts +14 -0
- package/dist/modules/funding/moonpay/getMoonPayCurrencies/getMoonPayCurrencies.d.ts.map +1 -0
- package/dist/modules/funding/moonpay/getMoonPayCurrencies/index.d.ts +2 -0
- package/dist/modules/funding/moonpay/getMoonPayCurrencies/index.d.ts.map +1 -0
- package/dist/modules/funding/moonpay/getMoonPayUrl/getMoonPayUrl.d.ts +15 -0
- package/dist/modules/funding/moonpay/getMoonPayUrl/getMoonPayUrl.d.ts.map +1 -0
- package/dist/modules/funding/moonpay/getMoonPayUrl/index.d.ts +2 -0
- package/dist/modules/funding/moonpay/getMoonPayUrl/index.d.ts.map +1 -0
- package/dist/modules/funding/moonpay/moonpay.types.d.ts +26 -0
- package/dist/modules/funding/moonpay/moonpay.types.d.ts.map +1 -0
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainFromWalletSchema/getChainFromWalletSchema.d.ts +12 -0
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainFromWalletSchema/getChainFromWalletSchema.d.ts.map +1 -1
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainsFromWalletSchema/getChainsFromWalletSchema.d.ts +26 -0
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/getChainsFromWalletSchema/getChainsFromWalletSchema.d.ts.map +1 -0
- package/dist/modules/legacyWalletBook/hasUsableDeeplink/hasUsableDeeplink.d.ts +18 -0
- package/dist/modules/legacyWalletBook/hasUsableDeeplink/hasUsableDeeplink.d.ts.map +1 -0
- package/dist/modules/legacyWalletBook/legacyWalletBook.types.d.ts +2 -2
- package/dist/modules/legacyWalletBook/legacyWalletBook.types.d.ts.map +1 -1
- package/dist/modules/swap/executeSwapTransaction/executeSwapTransaction.d.ts +13 -1
- package/dist/modules/swap/executeSwapTransaction/executeSwapTransaction.d.ts.map +1 -1
- package/dist/modules/user/refreshAuth/refreshAuth.d.ts.map +1 -1
- package/dist/modules/waas/createWaasClient/createWaasClient.d.ts +2 -7
- package/dist/modules/waas/createWaasClient/createWaasClient.d.ts.map +1 -1
- package/dist/modules/waas/createWaasClient/createWaasClient.types.d.ts +8 -0
- package/dist/modules/waas/createWaasClient/createWaasClient.types.d.ts.map +1 -0
- package/dist/modules/waas/createWaasClient/createWaasSDKContainer.d.ts +15 -0
- package/dist/modules/waas/createWaasClient/createWaasSDKContainer.d.ts.map +1 -0
- package/dist/modules/waas/createWaasClient/translateNativeOpenError.d.ts +18 -0
- package/dist/modules/waas/createWaasClient/translateNativeOpenError.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildMetaMaskSdkUriOptions/buildMetaMaskSdkUriOptions.d.ts +27 -0
- package/dist/modules/walletOptionsCatalogue/buildMetaMaskSdkUriOptions/buildMetaMaskSdkUriOptions.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts +26 -0
- package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildWalletOption/buildWalletOption.d.ts +11 -4
- package/dist/modules/walletOptionsCatalogue/buildWalletOption/buildWalletOption.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/buildWithWalletProviderOptions/buildWithWalletProviderOptions.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/getInstallationLinkForCurrentPlatform/getInstallationLinkForCurrentPlatform.d.ts +35 -0
- package/dist/modules/walletOptionsCatalogue/getInstallationLinkForCurrentPlatform/getInstallationLinkForCurrentPlatform.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/getInstallationLinkForCurrentPlatform/index.d.ts +2 -0
- package/dist/modules/walletOptionsCatalogue/getInstallationLinkForCurrentPlatform/index.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts +6 -1
- package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts +11 -0
- package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts.map +1 -1
- package/dist/modules/wallets/constants.d.ts +7 -0
- package/dist/modules/wallets/constants.d.ts.map +1 -1
- package/dist/modules/wallets/getAvailableWalletProvidersData/getAvailableWalletProvidersData.d.ts.map +1 -1
- package/dist/modules/wallets/hasWalletProviderConnectMethod/hasWalletProviderConnectMethod.d.ts +26 -0
- package/dist/modules/wallets/hasWalletProviderConnectMethod/hasWalletProviderConnectMethod.d.ts.map +1 -0
- package/dist/modules/wallets/hasWalletProviderConnectMethod/index.d.ts +2 -0
- package/dist/modules/wallets/hasWalletProviderConnectMethod/index.d.ts.map +1 -0
- package/dist/modules/wallets/isAnyWalletAccountConnected/index.d.ts +2 -0
- package/dist/modules/wallets/isAnyWalletAccountConnected/index.d.ts.map +1 -0
- package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts +14 -0
- package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts.map +1 -0
- package/dist/modules/wallets/networks/getBalance/getBalance.d.ts +6 -17
- package/dist/modules/wallets/networks/getBalance/getBalance.d.ts.map +1 -1
- package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts +24 -0
- package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts.map +1 -0
- package/dist/modules/wallets/networks/getNativeBalance/index.d.ts +2 -0
- package/dist/modules/wallets/networks/getNativeBalance/index.d.ts.map +1 -0
- package/dist/modules/wallets/walletProvider/walletProvider.types.d.ts +10 -0
- package/dist/modules/wallets/walletProvider/walletProvider.types.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/getChainFromWalletBookIdentifier/getChainFromWalletBookIdentifier.d.ts +22 -0
- package/dist/utils/getChainFromWalletBookIdentifier/getChainFromWalletBookIdentifier.d.ts.map +1 -0
- package/dist/utils/getChainFromWalletBookIdentifier/index.d.ts +2 -0
- package/dist/utils/getChainFromWalletBookIdentifier/index.d.ts.map +1 -0
- package/dist/utils/getNativeLinkScheme/getNativeLinkScheme.d.ts +18 -0
- package/dist/utils/getNativeLinkScheme/getNativeLinkScheme.d.ts.map +1 -0
- package/dist/utils/getNativeLinkScheme/index.d.ts +3 -0
- package/dist/utils/getNativeLinkScheme/index.d.ts.map +1 -0
- package/dist/utils/isMobile/isMobile.d.ts +8 -0
- package/dist/utils/isMobile/isMobile.d.ts.map +1 -1
- package/dist/waas.cjs +8 -9
- package/dist/waas.cjs.map +1 -1
- package/dist/waas.esm.js +3 -3
- package/dist/waas.native.esm.js +3 -3
- package/dist/waasCore.cjs +3 -4
- package/dist/waasCore.cjs.map +1 -1
- package/dist/waasCore.esm.js +3 -3
- package/dist/waasCore.esm.js.map +1 -1
- package/dist/waasCore.native.esm.js +208 -7
- package/dist/waasCore.native.esm.js.map +1 -1
- package/package.json +5 -5
- package/dist/InvalidParamError-BPMi0iWC.esm.js.map +0 -1
- package/dist/InvalidParamError-CDmVW2DS.native.esm.js.map +0 -1
- package/dist/InvalidParamError-DEmLKJKZ.cjs.map +0 -1
- package/dist/NotWaasWalletAccountError-BZsBHRQe.cjs.map +0 -1
- package/dist/NotWaasWalletAccountError-Chpne8_Q.native.esm.js.map +0 -1
- package/dist/NotWaasWalletAccountError-Cntietge.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-CEeFL-gV.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-JGrKwBj7.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-szJOsbQN.cjs.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-B46O0B48.cjs +0 -887
- package/dist/getVerifiedCredentialForWalletAccount-B46O0B48.cjs.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-CyykSi-M.native.esm.js +0 -701
- package/dist/getVerifiedCredentialForWalletAccount-CyykSi-M.native.esm.js.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-DzwIoeHm.esm.js +0 -701
- package/dist/getVerifiedCredentialForWalletAccount-DzwIoeHm.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-DUvZEpjA.native.esm.js.map +0 -1
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/buildUriDeeplinkOptions.d.ts +0 -28
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/buildUriDeeplinkOptions.d.ts.map +0 -1
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/index.d.ts +0 -2
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/index.d.ts.map +0 -1
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/index.d.ts +0 -2
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/index.d.ts.map +0 -1
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/resolveUriConnectionType.d.ts +0 -17
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/resolveUriConnectionType.d.ts.map +0 -1
|
@@ -1,13 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
2
28
|
let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
|
|
29
|
+
let zod_mini = require("zod/mini");
|
|
30
|
+
zod_mini = __toESM(zod_mini);
|
|
3
31
|
|
|
4
32
|
//#region package.json
|
|
5
33
|
var name = "@dynamic-labs-sdk/client";
|
|
6
|
-
var version = "1.
|
|
34
|
+
var version = "1.6.0";
|
|
7
35
|
var dependencies = {
|
|
8
36
|
"@dynamic-labs-sdk/assert-package-version": "workspace:*",
|
|
9
|
-
"@dynamic-labs-wallet/browser-wallet-client": "
|
|
10
|
-
"@dynamic-labs-wallet/forward-mpc-client": "0.
|
|
37
|
+
"@dynamic-labs-wallet/browser-wallet-client": "1.0.7",
|
|
38
|
+
"@dynamic-labs-wallet/forward-mpc-client": "0.10.1",
|
|
11
39
|
"@dynamic-labs/sdk-api-core": "catalog:",
|
|
12
40
|
"@simplewebauthn/browser": "13.1.0",
|
|
13
41
|
"ably": "2.17.1",
|
|
@@ -62,7 +90,12 @@ var BaseError = class BaseError extends Error {
|
|
|
62
90
|
details
|
|
63
91
|
});
|
|
64
92
|
super(args.shortMessage ?? formattedMessage, args.cause ? { cause: args.cause } : void 0);
|
|
65
|
-
this
|
|
93
|
+
Object.defineProperty(this, "formattedMessage", {
|
|
94
|
+
configurable: true,
|
|
95
|
+
enumerable: false,
|
|
96
|
+
value: formattedMessage,
|
|
97
|
+
writable: true
|
|
98
|
+
});
|
|
66
99
|
this.details = details;
|
|
67
100
|
this.name = args.name ?? this.name;
|
|
68
101
|
this.cause = args.cause ?? this.cause;
|
|
@@ -909,109 +942,186 @@ const createDeviceSignatureHeadersMiddleware = (client) => {
|
|
|
909
942
|
};
|
|
910
943
|
|
|
911
944
|
//#endregion
|
|
912
|
-
//#region src/
|
|
913
|
-
|
|
914
|
-
|
|
945
|
+
//#region src/utils/setCookie/setCookie.ts
|
|
946
|
+
/**
|
|
947
|
+
* Sefelly sets the cookie in the browser.
|
|
948
|
+
* @not-instrumented
|
|
949
|
+
*/
|
|
950
|
+
const setCookie = (cookie) => {
|
|
951
|
+
document.cookie = cookie;
|
|
952
|
+
};
|
|
953
|
+
|
|
954
|
+
//#endregion
|
|
955
|
+
//#region src/modules/clientEvents/clientEvents.ts
|
|
956
|
+
/**
|
|
957
|
+
* Adds an event listener for Dynamic client events.
|
|
958
|
+
*
|
|
959
|
+
* This function allows you to listen for various events emitted by the Dynamic client,
|
|
960
|
+
* such as authentication state changes, wallet connections, and more.
|
|
961
|
+
*
|
|
962
|
+
* @param params.event - The event name to listen for.
|
|
963
|
+
* @param params.listener - The callback function to execute when the event is fired.
|
|
964
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
965
|
+
* @returns A function that can be called to remove the listener.
|
|
966
|
+
* @not-instrumented
|
|
967
|
+
*/
|
|
968
|
+
const onEvent = ({ event, listener }, client = getDefaultClient()) => {
|
|
969
|
+
const { eventEmitter } = getCore(client);
|
|
970
|
+
eventEmitter.on(event, listener);
|
|
971
|
+
return () => {
|
|
972
|
+
eventEmitter.off(event, listener);
|
|
973
|
+
};
|
|
974
|
+
};
|
|
975
|
+
/**
|
|
976
|
+
* Removes an event listener from Dynamic client events.
|
|
977
|
+
*
|
|
978
|
+
* This function unsubscribes a previously registered event listener
|
|
979
|
+
* from the specified Dynamic client event.
|
|
980
|
+
*
|
|
981
|
+
* @param params.event - The event name to remove the listener from.
|
|
982
|
+
* @param params.listener - The callback function to remove.
|
|
983
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
984
|
+
* @not-instrumented
|
|
985
|
+
*/
|
|
986
|
+
const offEvent = ({ event, listener }, client = getDefaultClient()) => {
|
|
987
|
+
const { eventEmitter } = getCore(client);
|
|
988
|
+
eventEmitter.off(event, listener);
|
|
989
|
+
};
|
|
990
|
+
/**
|
|
991
|
+
* Adds a one-time event listener for Dynamic client events.
|
|
992
|
+
*
|
|
993
|
+
* This function listens for an event that will automatically remove itself
|
|
994
|
+
* after being triggered once.
|
|
995
|
+
*
|
|
996
|
+
* @param params.event - The event name to listen for.
|
|
997
|
+
* @param params.listener - The callback function to execute when the event is fired.
|
|
998
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
999
|
+
* @returns A function that can be called to remove the listener before it fires.
|
|
1000
|
+
* @not-instrumented
|
|
1001
|
+
*/
|
|
1002
|
+
const onceEvent = ({ event, listener }, client = getDefaultClient()) => {
|
|
1003
|
+
const { eventEmitter } = getCore(client);
|
|
1004
|
+
eventEmitter.once(event, listener);
|
|
1005
|
+
return () => {
|
|
1006
|
+
eventEmitter.off(event, listener);
|
|
1007
|
+
};
|
|
1008
|
+
};
|
|
1009
|
+
/**
|
|
1010
|
+
* Emits a Dynamic client event.
|
|
1011
|
+
*
|
|
1012
|
+
* This function triggers an event that will be received by all registered
|
|
1013
|
+
* listeners for the specified event type.
|
|
1014
|
+
*
|
|
1015
|
+
* @param params.event - The event name to emit.
|
|
1016
|
+
* @param params.args - The arguments to pass to event listeners.
|
|
1017
|
+
* @param client - The Dynamic client instance.
|
|
1018
|
+
* @not-instrumented
|
|
1019
|
+
*/
|
|
1020
|
+
const emitEvent = ({ event, args }, client) => {
|
|
1021
|
+
const { eventEmitter } = getCore(client);
|
|
1022
|
+
eventEmitter.emit(event, args);
|
|
1023
|
+
};
|
|
1024
|
+
|
|
1025
|
+
//#endregion
|
|
1026
|
+
//#region src/utils/retryOnFail/InvalidRetryOnFailCallError.ts
|
|
1027
|
+
/**
|
|
1028
|
+
* This error is thrown when the `retryOnFail` function is called with an invalid
|
|
1029
|
+
* number of retries (i.e. less than 0).
|
|
1030
|
+
*/
|
|
1031
|
+
var InvalidRetryOnFailCallError = class extends BaseError {
|
|
1032
|
+
constructor(maxRetries) {
|
|
915
1033
|
super({
|
|
916
|
-
cause,
|
|
917
|
-
code: "
|
|
1034
|
+
cause: null,
|
|
1035
|
+
code: "invalid_retry_on_fail_call_error",
|
|
918
1036
|
docsUrl: null,
|
|
919
|
-
name: "
|
|
920
|
-
shortMessage:
|
|
1037
|
+
name: "InvalidRetryOnFailCallError",
|
|
1038
|
+
shortMessage: `Invalid retries parameter for retryOnFail call: ${maxRetries}`
|
|
921
1039
|
});
|
|
922
1040
|
}
|
|
923
1041
|
};
|
|
924
1042
|
|
|
925
1043
|
//#endregion
|
|
926
|
-
//#region src/
|
|
1044
|
+
//#region src/utils/retryOnFail/retryOnFail.ts
|
|
927
1045
|
/** @not-instrumented */
|
|
928
|
-
const
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
} catch {}
|
|
935
|
-
throw new UnauthorizedError({ cause });
|
|
1046
|
+
const retryOnFail = async ({ delay = 0, fn, maxRetries }) => {
|
|
1047
|
+
for (let retry = 0; retry <= maxRetries; retry++) try {
|
|
1048
|
+
return await fn();
|
|
1049
|
+
} catch (error) {
|
|
1050
|
+
if (retry >= maxRetries) throw error;
|
|
1051
|
+
if (delay > 0) await new Promise((resolve) => setTimeout(resolve, delay));
|
|
936
1052
|
}
|
|
937
|
-
|
|
938
|
-
|
|
1053
|
+
/**
|
|
1054
|
+
* Reaching this point should never happen and this
|
|
1055
|
+
* error is thrown to help us debug the issue.
|
|
1056
|
+
*/
|
|
1057
|
+
throw new InvalidRetryOnFailCallError(maxRetries);
|
|
1058
|
+
};
|
|
939
1059
|
|
|
940
1060
|
//#endregion
|
|
941
|
-
//#region src/
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
const settings = {
|
|
952
|
-
basePath: core.apiBaseUrl,
|
|
953
|
-
headers: {
|
|
954
|
-
"Content-Type": "application/json",
|
|
955
|
-
[DYNAMIC_API_VERSION_HEADER]: `API/${DYNAMIC_SDK_API_VERSION}`,
|
|
956
|
-
[DYNAMIC_REQUEST_ID_HEADER]: randomString({ length: 50 }),
|
|
957
|
-
[DYNAMIC_SDK_SESSION_ID_HEADER]: core.sdkSessionId,
|
|
958
|
-
[DYNAMIC_SDK_VERSION_HEADER]: `${CLIENT_SDK_NAME}/${version}`,
|
|
959
|
-
...core.getApiHeaders(),
|
|
960
|
-
...options.headers
|
|
961
|
-
}
|
|
962
|
-
};
|
|
963
|
-
if (core.metadata?.universalLink) settings.headers["Origin"] = core.metadata.universalLink;
|
|
964
|
-
if (client.token) settings.headers.Authorization = `Bearer ${client.token}`;
|
|
965
|
-
if (client.projectSettings && isCookieEnabled(client)) settings.credentials = "include";
|
|
966
|
-
if (options.includeMfaToken && coreState.mfaToken) settings.headers[MFA_TOKEN_HEADER] = coreState.mfaToken;
|
|
967
|
-
if (options.elevatedAccessTokenScope) {
|
|
968
|
-
const elevatedToken = __getElevatedAccessToken_wrapped({ scope: options.elevatedAccessTokenScope }, client);
|
|
969
|
-
if (elevatedToken) settings.headers[ELEVATED_ACCESS_TOKEN_HEADER] = elevatedToken;
|
|
1061
|
+
//#region src/errors/InvalidWalletProviderKeyError.ts
|
|
1062
|
+
var InvalidWalletProviderKeyError = class extends BaseError {
|
|
1063
|
+
constructor(value) {
|
|
1064
|
+
super({
|
|
1065
|
+
cause: null,
|
|
1066
|
+
code: "invalid_wallet_provider_key",
|
|
1067
|
+
docsUrl: null,
|
|
1068
|
+
name: "InvalidWalletProviderKeyError",
|
|
1069
|
+
shortMessage: `Invalid wallet provider key: ${value}. Key must be in the format of <normalizedWalletNameWithChain>:<walletProviderType>[:<suffix>]`
|
|
1070
|
+
});
|
|
970
1071
|
}
|
|
971
|
-
const sessionPublicKey = getSessionKeys(client)?.publicKey;
|
|
972
|
-
const isSessionPublicKeyHeaderPresent = settings.headers[SESSION_PUBLIC_KEY_HEADER] !== void 0;
|
|
973
|
-
if (sessionPublicKey && !isSessionPublicKeyHeaderPresent) settings.headers[SESSION_PUBLIC_KEY_HEADER] = sessionPublicKey;
|
|
974
|
-
return new _dynamic_labs_sdk_api_core.SDKApi(new _dynamic_labs_sdk_api_core.Configuration({
|
|
975
|
-
...settings,
|
|
976
|
-
fetchApi: core.fetch,
|
|
977
|
-
middleware: [
|
|
978
|
-
createDeviceSignatureHeadersMiddleware(client),
|
|
979
|
-
createConvertToApiErrorMiddleware({ errorMappers: [...options.errorMappers || [], clientErrorMapper] }),
|
|
980
|
-
createUnauthorizedMiddleware()
|
|
981
|
-
]
|
|
982
|
-
}));
|
|
983
1072
|
};
|
|
984
1073
|
|
|
985
1074
|
//#endregion
|
|
986
|
-
//#region src/
|
|
987
|
-
/**
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
*
|
|
997
|
-
* New nonces are **appended** to the existing pool so that unconsumed entries
|
|
998
|
-
* are not discarded by a background refetch.
|
|
999
|
-
* @not-instrumented
|
|
1000
|
-
*/
|
|
1001
|
-
const fetchAndStoreNonces = async (client) => {
|
|
1002
|
-
const core = getCore(client);
|
|
1003
|
-
const { environmentId } = core;
|
|
1004
|
-
const { nonces } = await createApiClient({}, client).getNonces({
|
|
1005
|
-
count: NONCE_POOL_SIZE,
|
|
1006
|
-
environmentId
|
|
1007
|
-
});
|
|
1008
|
-
const existing = core.state.get().prefetchedNonces;
|
|
1009
|
-
core.state.set({
|
|
1010
|
-
prefetchedNonces: [...existing, ...nonces],
|
|
1011
|
-
prefetchedNoncesExpiration: Date.now() + NONCE_POOL_EXPIRATION_TIME
|
|
1012
|
-
});
|
|
1075
|
+
//#region src/modules/wallets/walletProvider/splitWalletProviderKey/splitWalletProviderKey.ts
|
|
1076
|
+
/** @not-instrumented */
|
|
1077
|
+
const splitWalletProviderKey = (walletProviderKey) => {
|
|
1078
|
+
const [normalizedWalletNameWithChain, walletProviderType, suffix, ...rest] = walletProviderKey.split(":");
|
|
1079
|
+
if (!normalizedWalletNameWithChain || !Object.values(_dynamic_labs_sdk_api_core.WalletProviderEnum).includes(walletProviderType) || rest.length > 0) throw new InvalidWalletProviderKeyError(walletProviderKey);
|
|
1080
|
+
return {
|
|
1081
|
+
normalizedWalletNameWithChain,
|
|
1082
|
+
suffix,
|
|
1083
|
+
walletProviderType
|
|
1084
|
+
};
|
|
1013
1085
|
};
|
|
1014
1086
|
|
|
1087
|
+
//#endregion
|
|
1088
|
+
//#region src/modules/wallets/utils/normalizeAddress/normalizeAddress.ts
|
|
1089
|
+
/** @not-instrumented */
|
|
1090
|
+
const normalizeAddress = ({ address, chain }) => {
|
|
1091
|
+
let normalizedAddress = address;
|
|
1092
|
+
if (normalizedAddress?.startsWith("0x")) normalizedAddress = normalizedAddress.slice(2);
|
|
1093
|
+
normalizedAddress = ["EVM", "FLOW"].includes(chain) ? normalizedAddress?.toLowerCase() : normalizedAddress;
|
|
1094
|
+
return normalizedAddress;
|
|
1095
|
+
};
|
|
1096
|
+
|
|
1097
|
+
//#endregion
|
|
1098
|
+
//#region src/modules/wallets/utils/formatWalletAccountId/formatWalletAccountId.ts
|
|
1099
|
+
/** @not-instrumented */
|
|
1100
|
+
const formatWalletAccountId = ({ address, chain, walletProviderKey }) => {
|
|
1101
|
+
const { normalizedWalletNameWithChain } = splitWalletProviderKey(walletProviderKey);
|
|
1102
|
+
return `${normalizedWalletNameWithChain}:${normalizeAddress({
|
|
1103
|
+
address,
|
|
1104
|
+
chain
|
|
1105
|
+
})}`;
|
|
1106
|
+
};
|
|
1107
|
+
|
|
1108
|
+
//#endregion
|
|
1109
|
+
//#region src/modules/wallets/utils/convertUnverifiedWalletAccountToWalletAccount/convertUnverifiedWalletAccountToWalletAccount.ts
|
|
1110
|
+
/** @not-instrumented */
|
|
1111
|
+
const convertUnverifiedWalletAccountToWalletAccount = ({ unverifiedWalletAccount }) => ({
|
|
1112
|
+
address: unverifiedWalletAccount.address,
|
|
1113
|
+
addressesWithTypes: unverifiedWalletAccount.addressesWithTypes,
|
|
1114
|
+
chain: unverifiedWalletAccount.chain,
|
|
1115
|
+
id: formatWalletAccountId({
|
|
1116
|
+
address: unverifiedWalletAccount.address,
|
|
1117
|
+
chain: unverifiedWalletAccount.chain,
|
|
1118
|
+
walletProviderKey: unverifiedWalletAccount.walletProviderKey
|
|
1119
|
+
}),
|
|
1120
|
+
lastSelectedAt: unverifiedWalletAccount.lastSelectedAt,
|
|
1121
|
+
verifiedCredentialId: null,
|
|
1122
|
+
walletProviderKey: unverifiedWalletAccount.walletProviderKey
|
|
1123
|
+
});
|
|
1124
|
+
|
|
1015
1125
|
//#endregion
|
|
1016
1126
|
//#region src/modules/wallets/constants.ts
|
|
1017
1127
|
const CHAINS_INFO_MAP = {
|
|
@@ -1033,6 +1143,7 @@ const CHAINS_INFO_MAP = {
|
|
|
1033
1143
|
BTC: {
|
|
1034
1144
|
apiChainName: "bitcoin",
|
|
1035
1145
|
blockchainName: "Bitcoin",
|
|
1146
|
+
legacyWalletBookAliases: ["btc"],
|
|
1036
1147
|
verifiedCredentialChainName: "bip122"
|
|
1037
1148
|
},
|
|
1038
1149
|
COSMOS: {
|
|
@@ -1063,6 +1174,7 @@ const CHAINS_INFO_MAP = {
|
|
|
1063
1174
|
SOL: {
|
|
1064
1175
|
apiChainName: "solana",
|
|
1065
1176
|
blockchainName: "Solana",
|
|
1177
|
+
legacyWalletBookAliases: ["sol"],
|
|
1066
1178
|
verifiedCredentialChainName: "solana",
|
|
1067
1179
|
waasChainNameOverride: "SVM"
|
|
1068
1180
|
},
|
|
@@ -1074,6 +1186,7 @@ const CHAINS_INFO_MAP = {
|
|
|
1074
1186
|
STARK: {
|
|
1075
1187
|
apiChainName: "starknet",
|
|
1076
1188
|
blockchainName: "Starknet",
|
|
1189
|
+
legacyWalletBookAliases: ["stark"],
|
|
1077
1190
|
verifiedCredentialChainName: "starknet"
|
|
1078
1191
|
},
|
|
1079
1192
|
STELLAR: {
|
|
@@ -1113,43 +1226,670 @@ const getChainFromVerifiedCredentialChain = (verifiedCredentialChain) => {
|
|
|
1113
1226
|
};
|
|
1114
1227
|
|
|
1115
1228
|
//#endregion
|
|
1116
|
-
//#region src/
|
|
1117
|
-
|
|
1118
|
-
|
|
1229
|
+
//#region src/modules/wallets/utils/normalizeWalletNameWithChain/normalizeWalletNameWithChain.ts
|
|
1230
|
+
/**
|
|
1231
|
+
* Format the raw wallet name and chain to get the value we can use for
|
|
1232
|
+
* verified credentials' `walletName` field.
|
|
1233
|
+
* @not-instrumented
|
|
1234
|
+
*/
|
|
1235
|
+
const normalizeWalletNameWithChain = ({ displayName, chain }) => {
|
|
1236
|
+
const sanitizedWalletName = displayName.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
|
|
1237
|
+
const chainLowered = chain.toLocaleLowerCase();
|
|
1238
|
+
if (sanitizedWalletName.endsWith(chainLowered)) return sanitizedWalletName;
|
|
1239
|
+
return `${sanitizedWalletName}${chainLowered}`;
|
|
1240
|
+
};
|
|
1119
1241
|
|
|
1120
1242
|
//#endregion
|
|
1121
|
-
//#region src/modules/
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1243
|
+
//#region src/modules/wallets/utils/formatWalletProviderKey/formatWalletProviderKey.ts
|
|
1244
|
+
/**
|
|
1245
|
+
* Assembles the wallet provider key from the wallet name, chain, and wallet provider type.
|
|
1246
|
+
*
|
|
1247
|
+
* The suffix is optional and can be used to add a uniquely identifying string to the key, which
|
|
1248
|
+
* might be necessary for some wallet providers (like Wallet Connect).
|
|
1249
|
+
*
|
|
1250
|
+
* IMPORTANT: Do NOT add a suffix unless absolutely necessary, as it will cause the wallet account
|
|
1251
|
+
* to not be able to find its wallet provider when connecting to a new device (it won't be possible
|
|
1252
|
+
* to determine the full key just from the Verified Credential data).
|
|
1253
|
+
* @not-instrumented
|
|
1254
|
+
*/
|
|
1255
|
+
const formatWalletProviderKey = ({ suffix, chain, displayName, walletProviderType }) => {
|
|
1256
|
+
return `${normalizeWalletNameWithChain({
|
|
1257
|
+
chain,
|
|
1258
|
+
displayName
|
|
1259
|
+
})}:${walletProviderType}${suffix ? `:${suffix}` : ""}`;
|
|
1128
1260
|
};
|
|
1129
1261
|
|
|
1130
1262
|
//#endregion
|
|
1131
|
-
//#region src/
|
|
1132
|
-
|
|
1133
|
-
|
|
1263
|
+
//#region src/modules/wallets/walletProvider/walletProviderKeyMap/getWalletProviderKeyFromVerifiedCredential/getWalletProviderKeyFromVerifiedCredential.ts
|
|
1264
|
+
/** @not-instrumented */
|
|
1265
|
+
const getWalletProviderKeyFromVerifiedCredential = ({ verifiedCredential }, client) => {
|
|
1266
|
+
const { walletProviderKeyMap } = getCore(client).state.get();
|
|
1267
|
+
const storedWalletProviderKey = walletProviderKeyMap[verifiedCredential.id];
|
|
1268
|
+
if (storedWalletProviderKey) return { walletProviderKey: storedWalletProviderKey };
|
|
1269
|
+
/**
|
|
1270
|
+
* We fallback to comprising the wallet provider key from walletName and walletProvider.
|
|
1271
|
+
*
|
|
1272
|
+
* Some wallet provider types (like Wallet Connect) also use a special suffix for their wallet provider
|
|
1273
|
+
* keys, so this won't be enough for them.
|
|
1274
|
+
* Therefore, for those specific wallet providers, the wallet account will remain without a wallet provider
|
|
1275
|
+
* and will require reconnection.
|
|
1276
|
+
* Read walletProvider.types.ts for more info.
|
|
1277
|
+
*/
|
|
1278
|
+
assertDefined(verifiedCredential.walletName, `Failed to get wallet provider for verified credential with ID ${verifiedCredential.id}: missing walletName`);
|
|
1279
|
+
assertDefined(verifiedCredential.walletProvider, `Failed to get wallet provider for verified credential with ID ${verifiedCredential.id}: missing walletProvider`);
|
|
1280
|
+
assertDefined(verifiedCredential.chain, `Failed to get wallet provider for verified credential with ID ${verifiedCredential.id}: missing chain`);
|
|
1281
|
+
return { walletProviderKey: formatWalletProviderKey({
|
|
1282
|
+
chain: getChainFromVerifiedCredentialChain(verifiedCredential.chain),
|
|
1283
|
+
displayName: verifiedCredential.walletName,
|
|
1284
|
+
walletProviderType: verifiedCredential.walletProvider
|
|
1285
|
+
}) };
|
|
1286
|
+
};
|
|
1287
|
+
|
|
1288
|
+
//#endregion
|
|
1289
|
+
//#region src/modules/wallets/utils/convertVerifiedCredentialToWalletAccount/convertVerifiedCredentialToWalletAccount.ts
|
|
1290
|
+
/** @not-instrumented */
|
|
1291
|
+
const convertVerifiedCredentialToWalletAccount = ({ verifiedCredential }, client) => {
|
|
1292
|
+
assertDefined(verifiedCredential.address, "Missing address in verified credential");
|
|
1293
|
+
assertDefined(verifiedCredential.chain, "Missing chain in verified credential");
|
|
1294
|
+
const chain = getChainFromVerifiedCredentialChain(verifiedCredential.chain);
|
|
1295
|
+
const { walletProviderKey } = getWalletProviderKeyFromVerifiedCredential({ verifiedCredential }, client);
|
|
1296
|
+
const walletAccountId = formatWalletAccountId({
|
|
1297
|
+
address: verifiedCredential.address,
|
|
1298
|
+
chain,
|
|
1299
|
+
walletProviderKey
|
|
1300
|
+
});
|
|
1301
|
+
return {
|
|
1302
|
+
address: verifiedCredential.address,
|
|
1303
|
+
addressesWithTypes: verifiedCredential.walletAdditionalAddresses,
|
|
1304
|
+
chain,
|
|
1305
|
+
hardwareWalletVendor: verifiedCredential.walletProperties?.hardwareWallet,
|
|
1306
|
+
id: walletAccountId,
|
|
1307
|
+
lastSelectedAt: verifiedCredential.lastSelectedAt ?? null,
|
|
1308
|
+
verifiedCredentialId: verifiedCredential.id,
|
|
1309
|
+
walletProviderKey
|
|
1310
|
+
};
|
|
1311
|
+
};
|
|
1312
|
+
|
|
1313
|
+
//#endregion
|
|
1314
|
+
//#region src/modules/wallets/getWalletAccounts/getWalletAccountsFromState/getWalletAccountsFromState.ts
|
|
1315
|
+
/** @not-instrumented */
|
|
1316
|
+
const getWalletAccountsFromState = ({ unverifiedWalletAccounts, user }, client) => {
|
|
1317
|
+
const walletAccountsMap = /* @__PURE__ */ new Map();
|
|
1318
|
+
/**
|
|
1319
|
+
* Handle the unverified wallet accounts before the user verified credentials
|
|
1320
|
+
* so the later verified wallet accounts can override the unverified wallet accounts
|
|
1321
|
+
*/
|
|
1322
|
+
unverifiedWalletAccounts.forEach((unverifiedWalletAccount) => {
|
|
1323
|
+
const walletAccount = convertUnverifiedWalletAccountToWalletAccount({ unverifiedWalletAccount });
|
|
1324
|
+
walletAccountsMap.set(walletAccount.id, walletAccount);
|
|
1325
|
+
});
|
|
1326
|
+
(user?.verifiedCredentials ?? []).filter((verified) => verified.format === _dynamic_labs_sdk_api_core.JwtVerifiedCredentialFormatEnum.Blockchain).forEach((verifiedWalletAccount) => {
|
|
1327
|
+
const walletAccount = convertVerifiedCredentialToWalletAccount({ verifiedCredential: verifiedWalletAccount }, client);
|
|
1328
|
+
walletAccountsMap.set(walletAccount.id, walletAccount);
|
|
1329
|
+
});
|
|
1330
|
+
return Array.from(walletAccountsMap.values());
|
|
1331
|
+
};
|
|
1332
|
+
|
|
1333
|
+
//#endregion
|
|
1334
|
+
//#region src/modules/wallets/getWalletAccounts/getWalletAccounts.ts
|
|
1335
|
+
/**
|
|
1336
|
+
* Retrieves all wallet accounts associated with the current session.
|
|
1337
|
+
*
|
|
1338
|
+
* This function returns both verified and unverified wallet accounts,
|
|
1339
|
+
* combining data from user credentials and local unverified accounts.
|
|
1340
|
+
* You can differentiate between verified and unverified wallet accounts by
|
|
1341
|
+
* checking the `verifiedCredentialId` property.
|
|
1342
|
+
*
|
|
1343
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1344
|
+
* @returns An array of wallet accounts associated with the session.
|
|
1345
|
+
* @not-instrumented
|
|
1346
|
+
*/
|
|
1347
|
+
const getWalletAccounts = (client = getDefaultClient()) => {
|
|
1348
|
+
const { unverifiedWalletAccounts, user } = getCore(client).state.get();
|
|
1349
|
+
return getWalletAccountsFromState({
|
|
1350
|
+
unverifiedWalletAccounts,
|
|
1351
|
+
user
|
|
1352
|
+
}, client);
|
|
1353
|
+
};
|
|
1354
|
+
|
|
1355
|
+
//#endregion
|
|
1356
|
+
//#region src/modules/auth/isSignedIn/isSignedIn.ts
|
|
1357
|
+
/**
|
|
1358
|
+
* Checks if the user is currently signed in to the Dynamic client.
|
|
1359
|
+
*
|
|
1360
|
+
* The client is considered to be in a signed in state if a user has
|
|
1361
|
+
* authenticated or if the client has at least one wallet connected.
|
|
1362
|
+
*
|
|
1363
|
+
* @deprecated What counts as "signed in" is your app's business logic, not the
|
|
1364
|
+
* SDK's. This helper bakes in one opinion (a user OR any connected wallet),
|
|
1365
|
+
* which rarely matches every app and forces a dependency on us for every
|
|
1366
|
+
* variation. Compose your own check from the underlying primitives instead —
|
|
1367
|
+
* e.g. `Boolean(client.user) || isAnyWalletAccountConnected(client)` — and
|
|
1368
|
+
* layer in whatever your app requires (device registration, completed
|
|
1369
|
+
* onboarding, satisfied MFA, a required embedded wallet, …). See the
|
|
1370
|
+
* "Check if signed in" guide:
|
|
1371
|
+
* https://www.dynamic.xyz/docs/javascript/user-session-management
|
|
1372
|
+
*
|
|
1373
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1374
|
+
* @returns True if the user is signed in, false otherwise.
|
|
1375
|
+
* @not-instrumented
|
|
1376
|
+
*/
|
|
1377
|
+
const isSignedIn = (client = getDefaultClient()) => Boolean(client.user || getWalletAccounts(client).length > 0);
|
|
1378
|
+
|
|
1379
|
+
//#endregion
|
|
1380
|
+
//#region src/services/storage/createStorageKeySchema/createStorageKeySchema.ts
|
|
1381
|
+
/** @not-instrumented */
|
|
1382
|
+
const createStorageKeySchema = (params) => {
|
|
1383
|
+
return params;
|
|
1384
|
+
};
|
|
1385
|
+
|
|
1386
|
+
//#endregion
|
|
1387
|
+
//#region src/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.ts
|
|
1388
|
+
/**
|
|
1389
|
+
* The schema to track the expiration time of the project settings.
|
|
1390
|
+
*/
|
|
1391
|
+
const projectSettingsExpirationStorageKeySchema = createStorageKeySchema({
|
|
1392
|
+
key: "projectSettingsExpiration",
|
|
1393
|
+
schema: zod_mini.number()
|
|
1394
|
+
});
|
|
1395
|
+
|
|
1396
|
+
//#endregion
|
|
1397
|
+
//#region src/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.ts
|
|
1398
|
+
/**
|
|
1399
|
+
* Expiration time of the project settings in milliseconds.
|
|
1400
|
+
*/
|
|
1401
|
+
const PROJECT_SETTINGS_EXPIRATION_TIME = 1e3 * 60 * 5;
|
|
1402
|
+
/**
|
|
1403
|
+
* Fetches and updates the project settings from the API.
|
|
1404
|
+
*
|
|
1405
|
+
* This function retrieves the latest project configuration settings
|
|
1406
|
+
* from Dynamic's servers, including authentication options, enabled chains,
|
|
1407
|
+
* and security configurations. The settings are cached for performance.
|
|
1408
|
+
*
|
|
1409
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1410
|
+
* @returns A promise that resolves to the updated project settings.
|
|
1411
|
+
* @not-instrumented
|
|
1412
|
+
*/
|
|
1413
|
+
const fetchProjectSettings = async (client = getDefaultClient()) => {
|
|
1414
|
+
const core = getCore(client);
|
|
1415
|
+
const currentExpiration = await core.storage.getItem(projectSettingsExpirationStorageKeySchema);
|
|
1416
|
+
if (Boolean(client.projectSettings) && !(currentExpiration && currentExpiration < Date.now()) && isSignedIn(client)) return client.projectSettings;
|
|
1417
|
+
const apiClient = createApiClient({}, client);
|
|
1418
|
+
core.logger.debug("[fetchProjectSettings] Fetching project settings...");
|
|
1419
|
+
const doFetch = async () => apiClient.getEnvironmentSettings({
|
|
1420
|
+
environmentId: core.environmentId,
|
|
1421
|
+
sdkVersion: `${CLIENT_SDK_NAME}/${core.version}`
|
|
1422
|
+
}, { credentials: "omit" });
|
|
1423
|
+
const projectSettings = await retryOnFail({
|
|
1424
|
+
fn: doFetch,
|
|
1425
|
+
maxRetries: 2
|
|
1426
|
+
});
|
|
1427
|
+
core.state.set({ projectSettings: projectSettings ?? null });
|
|
1428
|
+
await core.storage.setItem(projectSettingsExpirationStorageKeySchema, Date.now() + PROJECT_SETTINGS_EXPIRATION_TIME);
|
|
1429
|
+
return projectSettings;
|
|
1430
|
+
};
|
|
1431
|
+
|
|
1432
|
+
//#endregion
|
|
1433
|
+
//#region src/modules/sessionKeys/generateSessionKeys/generateSessionKeys.ts
|
|
1434
|
+
/** @not-instrumented */
|
|
1435
|
+
const generateSessionKeys = async (client) => {
|
|
1436
|
+
const core = getCore(client);
|
|
1437
|
+
await core.keychain.removeKey("session");
|
|
1438
|
+
const publicKey = await core.keychain.generateKey("session");
|
|
1439
|
+
assertDefined(publicKey, "Public key not found");
|
|
1440
|
+
core.state.set({ sessionKeys: publicKey });
|
|
1441
|
+
return { publicKey };
|
|
1442
|
+
};
|
|
1443
|
+
|
|
1444
|
+
//#endregion
|
|
1445
|
+
//#region src/errors/NoWalletProviderFoundError.ts
|
|
1446
|
+
var NoWalletProviderFoundError = class extends BaseError {
|
|
1447
|
+
constructor({ walletProviderKey }) {
|
|
1134
1448
|
super({
|
|
1135
1449
|
cause: null,
|
|
1136
|
-
code: "
|
|
1450
|
+
code: "no_wallet_provider_found_error",
|
|
1137
1451
|
docsUrl: null,
|
|
1138
|
-
name: "
|
|
1139
|
-
shortMessage:
|
|
1452
|
+
name: "NoWalletProviderFoundError",
|
|
1453
|
+
shortMessage: `No wallet provider found with key: ${walletProviderKey}`
|
|
1140
1454
|
});
|
|
1141
1455
|
}
|
|
1142
1456
|
};
|
|
1143
1457
|
|
|
1144
1458
|
//#endregion
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1459
|
+
//#region src/services/runtimeServices/createRuntimeServiceAccessKey/createRuntimeServiceAccessKey.ts
|
|
1460
|
+
/**
|
|
1461
|
+
* Creates a service accessor function that manages service instantiation and caching.
|
|
1462
|
+
* The returned function will either retrieve an existing service from the registry or
|
|
1463
|
+
* create a new one using the provided builder function.
|
|
1464
|
+
*
|
|
1465
|
+
* @template - The type of service to be created/accessed
|
|
1466
|
+
* @param key - Unique identifier for the service in the registry
|
|
1467
|
+
* @param builder - Function that creates the service instance when called with a DynamicClient
|
|
1468
|
+
* @not-instrumented
|
|
1469
|
+
*/
|
|
1470
|
+
const createRuntimeServiceAccessKey = (key, builder) => (client) => {
|
|
1471
|
+
const { runtimeServices } = getCore(client);
|
|
1472
|
+
const currentService = runtimeServices.getByKey(key);
|
|
1473
|
+
if (currentService) return currentService;
|
|
1474
|
+
const service = builder(client);
|
|
1475
|
+
runtimeServices.register(key, service);
|
|
1476
|
+
return service;
|
|
1477
|
+
};
|
|
1478
|
+
|
|
1479
|
+
//#endregion
|
|
1480
|
+
//#region src/modules/wallets/walletProviderRegistry/createWalletProviderRegistry/createWalletProviderRegistry.ts
|
|
1481
|
+
/**
|
|
1482
|
+
* Creates a new wallet provider registry that manages wallet providers with priority-based registration.
|
|
1483
|
+
*
|
|
1484
|
+
* @returns The wallet provider registry instance
|
|
1485
|
+
*
|
|
1486
|
+
* @example
|
|
1487
|
+
* ```typescript
|
|
1488
|
+
* const registry = createWalletProviderRegistry();
|
|
1489
|
+
*
|
|
1490
|
+
* registry.register({
|
|
1491
|
+
* priority: WalletProviderPriority.WALLET_SDK,
|
|
1492
|
+
* walletProvider: myWalletProvider
|
|
1493
|
+
* });
|
|
1494
|
+
*
|
|
1495
|
+
* const provider = registry.getByKey('my-wallet-key');
|
|
1496
|
+
* const providers = registry.listProviders();
|
|
1497
|
+
* ```
|
|
1498
|
+
* @not-instrumented
|
|
1499
|
+
*/
|
|
1500
|
+
const createWalletProviderRegistry = (client) => {
|
|
1501
|
+
const registry = /* @__PURE__ */ new Map();
|
|
1502
|
+
return {
|
|
1503
|
+
getByKey: (key) => registry.get(key)?.walletProvider,
|
|
1504
|
+
listProviderEntries: () => Array.from(registry.values()),
|
|
1505
|
+
listProviders: () => Array.from(registry.values()).map((v) => v.walletProvider),
|
|
1506
|
+
register: (args) => {
|
|
1507
|
+
const existingEntry = registry.get(args.walletProvider.key);
|
|
1508
|
+
if (existingEntry) {
|
|
1509
|
+
if (existingEntry.priority < args.priority) {
|
|
1510
|
+
registry.set(args.walletProvider.key, args);
|
|
1511
|
+
emitEvent({
|
|
1512
|
+
args: { walletProviderKey: args.walletProvider.key },
|
|
1513
|
+
event: "walletProviderChanged"
|
|
1514
|
+
}, client);
|
|
1515
|
+
}
|
|
1516
|
+
} else {
|
|
1517
|
+
registry.set(args.walletProvider.key, args);
|
|
1518
|
+
emitEvent({
|
|
1519
|
+
args: { walletProvider: args.walletProvider },
|
|
1520
|
+
event: "walletProviderRegistered"
|
|
1521
|
+
}, client);
|
|
1522
|
+
emitEvent({
|
|
1523
|
+
args: { walletProviderKey: args.walletProvider.key },
|
|
1524
|
+
event: "walletProviderChanged"
|
|
1525
|
+
}, client);
|
|
1526
|
+
}
|
|
1527
|
+
},
|
|
1528
|
+
unregister: (key) => {
|
|
1529
|
+
registry.delete(key);
|
|
1530
|
+
emitEvent({
|
|
1531
|
+
args: { walletProviderKey: key },
|
|
1532
|
+
event: "walletProviderUnregistered"
|
|
1533
|
+
}, client);
|
|
1534
|
+
}
|
|
1535
|
+
};
|
|
1536
|
+
};
|
|
1537
|
+
|
|
1538
|
+
//#endregion
|
|
1539
|
+
//#region src/modules/wallets/walletProviderRegistry/getWalletProviderRegistry/getWalletProviderRegistry.ts
|
|
1540
|
+
/**
|
|
1541
|
+
* This function provides access to a shared instance of the wallet provider registry.
|
|
1542
|
+
*
|
|
1543
|
+
* It ensures that the same registry instance is used throughout the client to maintaining
|
|
1544
|
+
* consistency of registered wallet providers across different parts of the codebase.
|
|
1545
|
+
*
|
|
1546
|
+
* @returns The wallet provider registry instance
|
|
1547
|
+
*
|
|
1548
|
+
* @example
|
|
1549
|
+
* ```typescript
|
|
1550
|
+
* // Get the registry instance
|
|
1551
|
+
* const registry = getWalletProviderRegistry();
|
|
1552
|
+
*
|
|
1553
|
+
* // Register a wallet provider
|
|
1554
|
+
* registry.register({
|
|
1555
|
+
* priority: WalletProviderPriority.WALLET_SDK,
|
|
1556
|
+
* walletProvider: myWalletProvider
|
|
1557
|
+
* });
|
|
1558
|
+
*
|
|
1559
|
+
* // Retrieve a specific provider
|
|
1560
|
+
* const provider = registry.getByKey('metamaskevm');
|
|
1561
|
+
* ```
|
|
1562
|
+
*/
|
|
1563
|
+
const getWalletProviderRegistry = createRuntimeServiceAccessKey("walletProviderRegistry", (client) => createWalletProviderRegistry(client));
|
|
1564
|
+
|
|
1565
|
+
//#endregion
|
|
1566
|
+
//#region src/modules/wallets/walletProviderRegistry/walletProviderRegistry.types.ts
|
|
1567
|
+
let WalletProviderPriority = /* @__PURE__ */ function(WalletProviderPriority$1) {
|
|
1568
|
+
/**
|
|
1569
|
+
* Highest priority should be used by wallet providers that implement
|
|
1570
|
+
* the most reliable wallet integration.
|
|
1571
|
+
* example: The SDK provided by the wallet provider.
|
|
1572
|
+
*/
|
|
1573
|
+
WalletProviderPriority$1[WalletProviderPriority$1["WALLET_SDK"] = 100] = "WALLET_SDK";
|
|
1574
|
+
/**
|
|
1575
|
+
* Medium priority should be used by wallet providers that implement
|
|
1576
|
+
* a wallet integration via some reliable standard.
|
|
1577
|
+
* example: A wallet provider that uses EIP6963 announcement.
|
|
1578
|
+
*/
|
|
1579
|
+
WalletProviderPriority$1[WalletProviderPriority$1["WALLET_SELF_ANNOUNCEMENT_STANDARD"] = 50] = "WALLET_SELF_ANNOUNCEMENT_STANDARD";
|
|
1580
|
+
/**
|
|
1581
|
+
* Low priority should be used by wallet providers that implement
|
|
1582
|
+
* a wallet integration on a less reliable standard.
|
|
1583
|
+
* example: A wallet provider that uses window.ethereum, where the
|
|
1584
|
+
* window key can be overridden by other extensions.
|
|
1585
|
+
*/
|
|
1586
|
+
WalletProviderPriority$1[WalletProviderPriority$1["WINDOW_INJECT"] = 20] = "WINDOW_INJECT";
|
|
1587
|
+
return WalletProviderPriority$1;
|
|
1588
|
+
}({});
|
|
1589
|
+
|
|
1590
|
+
//#endregion
|
|
1591
|
+
//#region src/modules/wallets/utils/getWalletProviderFromWalletAccount/getWalletProviderFromWalletAccount.ts
|
|
1592
|
+
/** @not-instrumented */
|
|
1593
|
+
const getWalletProviderFromWalletAccount = ({ walletAccount }, client) => {
|
|
1594
|
+
const walletProvider = getWalletProviderRegistry(client).getByKey(walletAccount.walletProviderKey);
|
|
1595
|
+
if (!walletProvider) throw new NoWalletProviderFoundError({ walletProviderKey: walletAccount.walletProviderKey });
|
|
1596
|
+
return walletProvider;
|
|
1597
|
+
};
|
|
1598
|
+
|
|
1599
|
+
//#endregion
|
|
1600
|
+
//#region src/modules/wallets/utils/getAvailableWalletProvidersFromWalletAccounts/getAvailableWalletProvidersFromWalletAccounts.ts
|
|
1601
|
+
/** @not-instrumented */
|
|
1602
|
+
const getAvailableWalletProvidersFromWalletAccounts = (client) => {
|
|
1603
|
+
const core = getCore(client);
|
|
1604
|
+
const walletProvidersMap = /* @__PURE__ */ new Map();
|
|
1605
|
+
getWalletAccounts(client).forEach((walletAccount) => {
|
|
1606
|
+
if (walletProvidersMap.has(walletAccount.walletProviderKey)) return;
|
|
1607
|
+
try {
|
|
1608
|
+
const walletProvider = getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
1609
|
+
walletProvidersMap.set(walletAccount.walletProviderKey, walletProvider);
|
|
1610
|
+
} catch (error) {
|
|
1611
|
+
core.logger.debug("Wallet provider not found for wallet account", {
|
|
1612
|
+
error,
|
|
1613
|
+
walletAccount: walletAccount.address
|
|
1614
|
+
});
|
|
1615
|
+
}
|
|
1616
|
+
});
|
|
1617
|
+
return Array.from(walletProvidersMap.values());
|
|
1618
|
+
};
|
|
1619
|
+
|
|
1620
|
+
//#endregion
|
|
1621
|
+
//#region src/modules/wallets/destroyWalletProviders/destroyWalletProviders.ts
|
|
1622
|
+
/**
|
|
1623
|
+
* Tear down every wallet provider on the client.
|
|
1624
|
+
*
|
|
1625
|
+
* Each provider's `destroy` is responsible for its own local + remote
|
|
1626
|
+
* cleanup. We swallow errors so a failing destroy on one provider does not
|
|
1627
|
+
* block teardown of the others (e.g. during logout).
|
|
1628
|
+
*
|
|
1629
|
+
* @not-instrumented
|
|
1630
|
+
*/
|
|
1631
|
+
const destroyWalletProviders = async ({ reason }, client) => {
|
|
1632
|
+
const core = getCore(client);
|
|
1633
|
+
const walletProviders = getAvailableWalletProvidersFromWalletAccounts(client);
|
|
1634
|
+
await Promise.all(walletProviders.map(async (walletProvider) => {
|
|
1635
|
+
if (!walletProvider.destroy) return;
|
|
1636
|
+
try {
|
|
1637
|
+
await walletProvider.destroy({ reason });
|
|
1638
|
+
} catch (err) {
|
|
1639
|
+
core.logger.error(`Error destroying wallet provider ${walletProvider.key}`, err);
|
|
1640
|
+
}
|
|
1641
|
+
}));
|
|
1642
|
+
};
|
|
1643
|
+
|
|
1644
|
+
//#endregion
|
|
1645
|
+
//#region src/modules/auth/consts.ts
|
|
1646
|
+
const DYNAMIC_AUTH_COOKIE_NAME = "DYNAMIC_JWT_TOKEN";
|
|
1647
|
+
|
|
1648
|
+
//#endregion
|
|
1649
|
+
//#region src/modules/auth/logoutWithReason/logoutWithReason.ts
|
|
1650
|
+
/**
|
|
1651
|
+
* Logs the user out with an explicit reason.
|
|
1652
|
+
*
|
|
1653
|
+
* Revokes the session, clears auth state, terminates wallet providers, and
|
|
1654
|
+
* emits the `logout` client event with the given reason. The reason is also
|
|
1655
|
+
* captured as an argument on the function-instrumentation event, which is
|
|
1656
|
+
* how Datadog distinguishes between different logout causes.
|
|
1657
|
+
*
|
|
1658
|
+
* Use this instead of the public `logout` when triggering a logout from
|
|
1659
|
+
* internal or extension code — the caller owns the reason string, so the
|
|
1660
|
+
* telemetry correctly attributes *why* the logout happened.
|
|
1661
|
+
*
|
|
1662
|
+
* @param params - The logout params.
|
|
1663
|
+
* @param params.reason - Why the logout is being triggered. Extension authors
|
|
1664
|
+
* needing a reason outside the SDK catalog can cast with `as LogoutReason`.
|
|
1665
|
+
* @param client - The Dynamic client instance.
|
|
1666
|
+
* @instrumented
|
|
1667
|
+
*/
|
|
1668
|
+
const logoutWithReason = async ({ reason }, client) => {
|
|
1669
|
+
const core = getCore(client);
|
|
1670
|
+
core.logger.debug("[logoutWithReason] Logging out...", { reason });
|
|
1671
|
+
await destroyWalletProviders({ reason }, client);
|
|
1672
|
+
if (client.user !== null) {
|
|
1673
|
+
const apiClient = createApiClient({ skipSessionExpiryLogout: true }, client);
|
|
1674
|
+
try {
|
|
1675
|
+
await apiClient.revokeSession({ environmentId: core.environmentId });
|
|
1676
|
+
} catch (error) {
|
|
1677
|
+
core.logger.error("Failed to revoke session", error);
|
|
1678
|
+
}
|
|
1679
|
+
/**
|
|
1680
|
+
* This deletes the auth cookie if it exists.
|
|
1681
|
+
* If the cookie doesn't exist, this sets a new cookie that expires immediately.
|
|
1682
|
+
*/
|
|
1683
|
+
if (isCookieEnabled(client)) setCookie(`${DYNAMIC_AUTH_COOKIE_NAME}=; Max-Age=-99999999; path=/; SameSite=Lax`);
|
|
1684
|
+
}
|
|
1685
|
+
await core.keychain.removeKey("session");
|
|
1686
|
+
core.state.set({
|
|
1687
|
+
captchaToken: null,
|
|
1688
|
+
elevatedAccessTokens: [],
|
|
1689
|
+
legacyToken: null,
|
|
1690
|
+
mfaToken: null,
|
|
1691
|
+
sessionExpiresAt: null,
|
|
1692
|
+
sessionKeys: null,
|
|
1693
|
+
token: null,
|
|
1694
|
+
unverifiedWalletAccounts: [],
|
|
1695
|
+
user: null
|
|
1696
|
+
});
|
|
1697
|
+
emitEvent({
|
|
1698
|
+
args: { reason },
|
|
1699
|
+
event: "logout"
|
|
1700
|
+
}, client);
|
|
1701
|
+
fetchProjectSettings(client);
|
|
1702
|
+
generateSessionKeys(client);
|
|
1703
|
+
};
|
|
1704
|
+
const __logoutWithReason_impl = logoutWithReason;
|
|
1705
|
+
const __logoutWithReason_wrapped = instrumentFunction({
|
|
1706
|
+
fn: __logoutWithReason_impl,
|
|
1707
|
+
functionName: "logoutWithReason",
|
|
1708
|
+
getCore: () => {
|
|
1709
|
+
try {
|
|
1710
|
+
return getCore(getDefaultClient());
|
|
1711
|
+
} catch {
|
|
1712
|
+
return;
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
});
|
|
1716
|
+
|
|
1717
|
+
//#endregion
|
|
1718
|
+
//#region src/modules/apiClient/utils/sessionExpiryLogoutMiddleware/createSessionExpiryLogoutMiddleware.ts
|
|
1719
|
+
const UNAUTHORIZED_STATUS = 401;
|
|
1720
|
+
/**
|
|
1721
|
+
* Creates middleware that ends the local session when an *authenticated*
|
|
1722
|
+
* request is rejected with a 401.
|
|
1723
|
+
*
|
|
1724
|
+
* A 401 on a request that carried an authenticated session means the backend
|
|
1725
|
+
* rejected our credentials, so the local session is stale and must be cleared.
|
|
1726
|
+
* The check is purely local (`client.user`) — we deliberately do not
|
|
1727
|
+
* re-validate over the network, because the 401 itself is the rejection signal
|
|
1728
|
+
* and re-validating would route back through this same middleware.
|
|
1729
|
+
*
|
|
1730
|
+
* Requests made without an authenticated session (e.g. pre-auth probes) are
|
|
1731
|
+
* ignored — there is no session to invalidate. Endpoints that legitimately
|
|
1732
|
+
* return 401 for non-session reasons opt out of this behavior by omitting the
|
|
1733
|
+
* middleware (see `skipSessionExpiryLogout` on `createApiClient`).
|
|
1734
|
+
*
|
|
1735
|
+
* This middleware runs before the error-conversion middleware so it observes
|
|
1736
|
+
* every 401 regardless of response body. The logout is fired as a side effect
|
|
1737
|
+
* and the response is returned unchanged, so the downstream error middleware
|
|
1738
|
+
* still throws the typed error to the caller.
|
|
1739
|
+
*
|
|
1740
|
+
* @param client - The Dynamic client instance.
|
|
1741
|
+
* @not-instrumented
|
|
1742
|
+
*/
|
|
1743
|
+
const createSessionExpiryLogoutMiddleware = (client) => ({ post: async (context) => {
|
|
1744
|
+
if (context.response.status === UNAUTHORIZED_STATUS && client.user !== null) __logoutWithReason_wrapped({ reason: "session-revoked" }, client).catch((error) => {
|
|
1745
|
+
getCore(client).logger.error("Failed to log out after unauthorized response", error);
|
|
1746
|
+
});
|
|
1747
|
+
return context.response;
|
|
1748
|
+
} });
|
|
1749
|
+
|
|
1750
|
+
//#endregion
|
|
1751
|
+
//#region src/errors/UnauthorizedError.ts
|
|
1752
|
+
var UnauthorizedError = class extends BaseError {
|
|
1753
|
+
constructor({ cause }) {
|
|
1754
|
+
super({
|
|
1755
|
+
cause,
|
|
1756
|
+
code: "unauthorized_error",
|
|
1757
|
+
docsUrl: null,
|
|
1758
|
+
name: "UnauthorizedError",
|
|
1759
|
+
shortMessage: "Unauthorized"
|
|
1760
|
+
});
|
|
1761
|
+
}
|
|
1762
|
+
};
|
|
1763
|
+
|
|
1764
|
+
//#endregion
|
|
1765
|
+
//#region src/modules/apiClient/utils/unauthorizedMiddleware/createUnauthorizedMiddleware.ts
|
|
1766
|
+
/** @not-instrumented */
|
|
1767
|
+
const createUnauthorizedMiddleware = () => ({ post: async (context) => {
|
|
1768
|
+
if (context.response.status === 401) {
|
|
1769
|
+
let cause = null;
|
|
1770
|
+
try {
|
|
1771
|
+
const errorBody = await context.response.clone().json();
|
|
1772
|
+
if (errorBody && "error" in errorBody && typeof errorBody.error === "string") cause = new Error(errorBody.error);
|
|
1773
|
+
} catch {}
|
|
1774
|
+
throw new UnauthorizedError({ cause });
|
|
1775
|
+
}
|
|
1776
|
+
return context.response;
|
|
1777
|
+
} });
|
|
1778
|
+
|
|
1779
|
+
//#endregion
|
|
1780
|
+
//#region src/modules/apiClient/createApiClient.ts
|
|
1781
|
+
/**
|
|
1782
|
+
* Returns a new instance of the SDK API client.
|
|
1783
|
+
*
|
|
1784
|
+
* This is not meant for storing, as it is very light we can create it whenever needed.
|
|
1785
|
+
* @not-instrumented
|
|
1786
|
+
*/
|
|
1787
|
+
const createApiClient = (options = {}, client) => {
|
|
1788
|
+
const core = getCore(client);
|
|
1789
|
+
const coreState = core.state.get();
|
|
1790
|
+
const settings = {
|
|
1791
|
+
basePath: core.apiBaseUrl,
|
|
1792
|
+
headers: {
|
|
1793
|
+
"Content-Type": "application/json",
|
|
1794
|
+
[DYNAMIC_API_VERSION_HEADER]: `API/${DYNAMIC_SDK_API_VERSION}`,
|
|
1795
|
+
[DYNAMIC_REQUEST_ID_HEADER]: randomString({ length: 50 }),
|
|
1796
|
+
[DYNAMIC_SDK_SESSION_ID_HEADER]: core.sdkSessionId,
|
|
1797
|
+
[DYNAMIC_SDK_VERSION_HEADER]: `${CLIENT_SDK_NAME}/${version}`,
|
|
1798
|
+
...core.getApiHeaders(),
|
|
1799
|
+
...options.headers
|
|
1800
|
+
}
|
|
1801
|
+
};
|
|
1802
|
+
if (core.metadata?.universalLink) settings.headers["Origin"] = core.metadata.universalLink;
|
|
1803
|
+
if (client.token) settings.headers.Authorization = `Bearer ${client.token}`;
|
|
1804
|
+
if (client.projectSettings && isCookieEnabled(client)) settings.credentials = "include";
|
|
1805
|
+
if (options.includeMfaToken && coreState.mfaToken) settings.headers[MFA_TOKEN_HEADER] = coreState.mfaToken;
|
|
1806
|
+
if (options.elevatedAccessTokenScope) {
|
|
1807
|
+
const elevatedToken = __getElevatedAccessToken_wrapped({ scope: options.elevatedAccessTokenScope }, client);
|
|
1808
|
+
if (elevatedToken) settings.headers[ELEVATED_ACCESS_TOKEN_HEADER] = elevatedToken;
|
|
1809
|
+
}
|
|
1810
|
+
const sessionPublicKey = getSessionKeys(client)?.publicKey;
|
|
1811
|
+
const isSessionPublicKeyHeaderPresent = settings.headers[SESSION_PUBLIC_KEY_HEADER] !== void 0;
|
|
1812
|
+
if (sessionPublicKey && !isSessionPublicKeyHeaderPresent) settings.headers[SESSION_PUBLIC_KEY_HEADER] = sessionPublicKey;
|
|
1813
|
+
return new _dynamic_labs_sdk_api_core.SDKApi(new _dynamic_labs_sdk_api_core.Configuration({
|
|
1814
|
+
...settings,
|
|
1815
|
+
fetchApi: core.fetch,
|
|
1816
|
+
middleware: [
|
|
1817
|
+
createDeviceSignatureHeadersMiddleware(client),
|
|
1818
|
+
...options.skipSessionExpiryLogout ? [] : [createSessionExpiryLogoutMiddleware(client)],
|
|
1819
|
+
createConvertToApiErrorMiddleware({ errorMappers: [...options.errorMappers || [], clientErrorMapper] }),
|
|
1820
|
+
createUnauthorizedMiddleware()
|
|
1821
|
+
]
|
|
1822
|
+
}));
|
|
1823
|
+
};
|
|
1824
|
+
|
|
1825
|
+
//#endregion
|
|
1826
|
+
//#region src/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.ts
|
|
1827
|
+
/**
|
|
1828
|
+
* Fetches a batch of nonces from the API.
|
|
1829
|
+
*
|
|
1830
|
+
* Prefetching is critical for iOS deep link wallet providers (e.g. Phantom
|
|
1831
|
+
* redirect). On iOS, a network request (like fetching a nonce) between a user
|
|
1832
|
+
* action and a deeplink call will break the gesture chain, causing iOS to
|
|
1833
|
+
* silently ignore the deeplink. By prefetching nonces ahead of time,
|
|
1834
|
+
* `getNonce` can return synchronously from cache and the deeplink fires
|
|
1835
|
+
* without an interrupting network round-trip.
|
|
1836
|
+
*
|
|
1837
|
+
* New nonces are **appended** to the existing pool so that unconsumed entries
|
|
1838
|
+
* are not discarded by a background refetch.
|
|
1839
|
+
* @not-instrumented
|
|
1840
|
+
*/
|
|
1841
|
+
const fetchAndStoreNonces = async (client) => {
|
|
1842
|
+
const core = getCore(client);
|
|
1843
|
+
const { environmentId } = core;
|
|
1844
|
+
const { nonces } = await createApiClient({}, client).getNonces({
|
|
1845
|
+
count: NONCE_POOL_SIZE,
|
|
1846
|
+
environmentId
|
|
1847
|
+
});
|
|
1848
|
+
const existing = core.state.get().prefetchedNonces;
|
|
1849
|
+
core.state.set({
|
|
1850
|
+
prefetchedNonces: [...existing, ...nonces],
|
|
1851
|
+
prefetchedNoncesExpiration: Date.now() + NONCE_POOL_EXPIRATION_TIME
|
|
1852
|
+
});
|
|
1853
|
+
};
|
|
1854
|
+
|
|
1855
|
+
//#endregion
|
|
1856
|
+
//#region src/constants.ts
|
|
1857
|
+
const SDK_API_CORE_VERSION = dependencies["@dynamic-labs/sdk-api-core"];
|
|
1858
|
+
const DYNAMIC_ICONIC_SPRITE_URL = "https://iconic.dynamic-static-assets.com/icons/sprite.svg";
|
|
1859
|
+
|
|
1860
|
+
//#endregion
|
|
1861
|
+
//#region src/modules/waas/constants.ts
|
|
1862
|
+
const DEFAULT_WAAS_BASE_API_URL = "https://app.dynamicauth.com";
|
|
1863
|
+
const DEFAULT_WAAS_BASE_MPC_RELAY_API_URL = "https://relay.dynamicauth.com";
|
|
1864
|
+
const DYNAMIC_WAAS_METADATA = {
|
|
1865
|
+
displayName: "Dynamic WaaS",
|
|
1866
|
+
icon: `${DYNAMIC_ICONIC_SPRITE_URL}#dynamicwaas`,
|
|
1867
|
+
normalizedWalletName: "dynamicwaas"
|
|
1868
|
+
};
|
|
1869
|
+
|
|
1870
|
+
//#endregion
|
|
1871
|
+
//#region src/errors/InvalidParamError.ts
|
|
1872
|
+
var InvalidParamError = class extends BaseError {
|
|
1873
|
+
constructor(message) {
|
|
1874
|
+
super({
|
|
1875
|
+
cause: null,
|
|
1876
|
+
code: "invalid_param_error",
|
|
1877
|
+
docsUrl: null,
|
|
1878
|
+
name: "InvalidParamError",
|
|
1879
|
+
shortMessage: message
|
|
1880
|
+
});
|
|
1881
|
+
}
|
|
1882
|
+
};
|
|
1883
|
+
|
|
1884
|
+
//#endregion
|
|
1885
|
+
Object.defineProperty(exports, 'APIError', {
|
|
1886
|
+
enumerable: true,
|
|
1887
|
+
get: function () {
|
|
1888
|
+
return APIError;
|
|
1889
|
+
}
|
|
1890
|
+
});
|
|
1891
|
+
Object.defineProperty(exports, 'BaseError', {
|
|
1892
|
+
enumerable: true,
|
|
1153
1893
|
get: function () {
|
|
1154
1894
|
return BaseError;
|
|
1155
1895
|
}
|
|
@@ -1190,6 +1930,12 @@ Object.defineProperty(exports, 'DEFAULT_WAAS_BASE_MPC_RELAY_API_URL', {
|
|
|
1190
1930
|
return DEFAULT_WAAS_BASE_MPC_RELAY_API_URL;
|
|
1191
1931
|
}
|
|
1192
1932
|
});
|
|
1933
|
+
Object.defineProperty(exports, 'DYNAMIC_AUTH_COOKIE_NAME', {
|
|
1934
|
+
enumerable: true,
|
|
1935
|
+
get: function () {
|
|
1936
|
+
return DYNAMIC_AUTH_COOKIE_NAME;
|
|
1937
|
+
}
|
|
1938
|
+
});
|
|
1193
1939
|
Object.defineProperty(exports, 'DYNAMIC_ICONIC_SPRITE_URL', {
|
|
1194
1940
|
enumerable: true,
|
|
1195
1941
|
get: function () {
|
|
@@ -1220,6 +1966,12 @@ Object.defineProperty(exports, 'InvalidParamError', {
|
|
|
1220
1966
|
return InvalidParamError;
|
|
1221
1967
|
}
|
|
1222
1968
|
});
|
|
1969
|
+
Object.defineProperty(exports, 'InvalidWalletProviderKeyError', {
|
|
1970
|
+
enumerable: true,
|
|
1971
|
+
get: function () {
|
|
1972
|
+
return InvalidWalletProviderKeyError;
|
|
1973
|
+
}
|
|
1974
|
+
});
|
|
1223
1975
|
Object.defineProperty(exports, 'LinkCredentialError', {
|
|
1224
1976
|
enumerable: true,
|
|
1225
1977
|
get: function () {
|
|
@@ -1244,6 +1996,12 @@ Object.defineProperty(exports, 'NONCE_POOL_SIZE', {
|
|
|
1244
1996
|
return NONCE_POOL_SIZE;
|
|
1245
1997
|
}
|
|
1246
1998
|
});
|
|
1999
|
+
Object.defineProperty(exports, 'NoWalletProviderFoundError', {
|
|
2000
|
+
enumerable: true,
|
|
2001
|
+
get: function () {
|
|
2002
|
+
return NoWalletProviderFoundError;
|
|
2003
|
+
}
|
|
2004
|
+
});
|
|
1247
2005
|
Object.defineProperty(exports, 'SDK_API_CORE_VERSION', {
|
|
1248
2006
|
enumerable: true,
|
|
1249
2007
|
get: function () {
|
|
@@ -1268,12 +2026,30 @@ Object.defineProperty(exports, 'ValueMustBeDefinedError', {
|
|
|
1268
2026
|
return ValueMustBeDefinedError;
|
|
1269
2027
|
}
|
|
1270
2028
|
});
|
|
2029
|
+
Object.defineProperty(exports, 'WalletProviderPriority', {
|
|
2030
|
+
enumerable: true,
|
|
2031
|
+
get: function () {
|
|
2032
|
+
return WalletProviderPriority;
|
|
2033
|
+
}
|
|
2034
|
+
});
|
|
1271
2035
|
Object.defineProperty(exports, '__getElevatedAccessToken_wrapped', {
|
|
1272
2036
|
enumerable: true,
|
|
1273
2037
|
get: function () {
|
|
1274
2038
|
return __getElevatedAccessToken_wrapped;
|
|
1275
2039
|
}
|
|
1276
2040
|
});
|
|
2041
|
+
Object.defineProperty(exports, '__logoutWithReason_wrapped', {
|
|
2042
|
+
enumerable: true,
|
|
2043
|
+
get: function () {
|
|
2044
|
+
return __logoutWithReason_wrapped;
|
|
2045
|
+
}
|
|
2046
|
+
});
|
|
2047
|
+
Object.defineProperty(exports, '__toESM', {
|
|
2048
|
+
enumerable: true,
|
|
2049
|
+
get: function () {
|
|
2050
|
+
return __toESM;
|
|
2051
|
+
}
|
|
2052
|
+
});
|
|
1277
2053
|
Object.defineProperty(exports, 'assertDefined', {
|
|
1278
2054
|
enumerable: true,
|
|
1279
2055
|
get: function () {
|
|
@@ -1292,6 +2068,24 @@ Object.defineProperty(exports, 'createDeviceSignatureHeadersMiddleware', {
|
|
|
1292
2068
|
return createDeviceSignatureHeadersMiddleware;
|
|
1293
2069
|
}
|
|
1294
2070
|
});
|
|
2071
|
+
Object.defineProperty(exports, 'createRuntimeServiceAccessKey', {
|
|
2072
|
+
enumerable: true,
|
|
2073
|
+
get: function () {
|
|
2074
|
+
return createRuntimeServiceAccessKey;
|
|
2075
|
+
}
|
|
2076
|
+
});
|
|
2077
|
+
Object.defineProperty(exports, 'createStorageKeySchema', {
|
|
2078
|
+
enumerable: true,
|
|
2079
|
+
get: function () {
|
|
2080
|
+
return createStorageKeySchema;
|
|
2081
|
+
}
|
|
2082
|
+
});
|
|
2083
|
+
Object.defineProperty(exports, 'emitEvent', {
|
|
2084
|
+
enumerable: true,
|
|
2085
|
+
get: function () {
|
|
2086
|
+
return emitEvent;
|
|
2087
|
+
}
|
|
2088
|
+
});
|
|
1295
2089
|
Object.defineProperty(exports, 'extractSessionId', {
|
|
1296
2090
|
enumerable: true,
|
|
1297
2091
|
get: function () {
|
|
@@ -1304,6 +2098,30 @@ Object.defineProperty(exports, 'fetchAndStoreNonces', {
|
|
|
1304
2098
|
return fetchAndStoreNonces;
|
|
1305
2099
|
}
|
|
1306
2100
|
});
|
|
2101
|
+
Object.defineProperty(exports, 'fetchProjectSettings', {
|
|
2102
|
+
enumerable: true,
|
|
2103
|
+
get: function () {
|
|
2104
|
+
return fetchProjectSettings;
|
|
2105
|
+
}
|
|
2106
|
+
});
|
|
2107
|
+
Object.defineProperty(exports, 'formatWalletAccountId', {
|
|
2108
|
+
enumerable: true,
|
|
2109
|
+
get: function () {
|
|
2110
|
+
return formatWalletAccountId;
|
|
2111
|
+
}
|
|
2112
|
+
});
|
|
2113
|
+
Object.defineProperty(exports, 'formatWalletProviderKey', {
|
|
2114
|
+
enumerable: true,
|
|
2115
|
+
get: function () {
|
|
2116
|
+
return formatWalletProviderKey;
|
|
2117
|
+
}
|
|
2118
|
+
});
|
|
2119
|
+
Object.defineProperty(exports, 'generateSessionKeys', {
|
|
2120
|
+
enumerable: true,
|
|
2121
|
+
get: function () {
|
|
2122
|
+
return generateSessionKeys;
|
|
2123
|
+
}
|
|
2124
|
+
});
|
|
1307
2125
|
Object.defineProperty(exports, 'getChainFromVerifiedCredentialChain', {
|
|
1308
2126
|
enumerable: true,
|
|
1309
2127
|
get: function () {
|
|
@@ -1352,6 +2170,30 @@ Object.defineProperty(exports, 'getUserAgent', {
|
|
|
1352
2170
|
return getUserAgent;
|
|
1353
2171
|
}
|
|
1354
2172
|
});
|
|
2173
|
+
Object.defineProperty(exports, 'getWalletAccounts', {
|
|
2174
|
+
enumerable: true,
|
|
2175
|
+
get: function () {
|
|
2176
|
+
return getWalletAccounts;
|
|
2177
|
+
}
|
|
2178
|
+
});
|
|
2179
|
+
Object.defineProperty(exports, 'getWalletAccountsFromState', {
|
|
2180
|
+
enumerable: true,
|
|
2181
|
+
get: function () {
|
|
2182
|
+
return getWalletAccountsFromState;
|
|
2183
|
+
}
|
|
2184
|
+
});
|
|
2185
|
+
Object.defineProperty(exports, 'getWalletProviderFromWalletAccount', {
|
|
2186
|
+
enumerable: true,
|
|
2187
|
+
get: function () {
|
|
2188
|
+
return getWalletProviderFromWalletAccount;
|
|
2189
|
+
}
|
|
2190
|
+
});
|
|
2191
|
+
Object.defineProperty(exports, 'getWalletProviderRegistry', {
|
|
2192
|
+
enumerable: true,
|
|
2193
|
+
get: function () {
|
|
2194
|
+
return getWalletProviderRegistry;
|
|
2195
|
+
}
|
|
2196
|
+
});
|
|
1355
2197
|
Object.defineProperty(exports, 'instrumentFunction', {
|
|
1356
2198
|
enumerable: true,
|
|
1357
2199
|
get: function () {
|
|
@@ -1364,34 +2206,88 @@ Object.defineProperty(exports, 'isCookieEnabled', {
|
|
|
1364
2206
|
return isCookieEnabled;
|
|
1365
2207
|
}
|
|
1366
2208
|
});
|
|
2209
|
+
Object.defineProperty(exports, 'isSignedIn', {
|
|
2210
|
+
enumerable: true,
|
|
2211
|
+
get: function () {
|
|
2212
|
+
return isSignedIn;
|
|
2213
|
+
}
|
|
2214
|
+
});
|
|
1367
2215
|
Object.defineProperty(exports, 'name', {
|
|
1368
2216
|
enumerable: true,
|
|
1369
2217
|
get: function () {
|
|
1370
2218
|
return name;
|
|
1371
2219
|
}
|
|
1372
2220
|
});
|
|
2221
|
+
Object.defineProperty(exports, 'normalizeAddress', {
|
|
2222
|
+
enumerable: true,
|
|
2223
|
+
get: function () {
|
|
2224
|
+
return normalizeAddress;
|
|
2225
|
+
}
|
|
2226
|
+
});
|
|
2227
|
+
Object.defineProperty(exports, 'normalizeWalletNameWithChain', {
|
|
2228
|
+
enumerable: true,
|
|
2229
|
+
get: function () {
|
|
2230
|
+
return normalizeWalletNameWithChain;
|
|
2231
|
+
}
|
|
2232
|
+
});
|
|
2233
|
+
Object.defineProperty(exports, 'offEvent', {
|
|
2234
|
+
enumerable: true,
|
|
2235
|
+
get: function () {
|
|
2236
|
+
return offEvent;
|
|
2237
|
+
}
|
|
2238
|
+
});
|
|
2239
|
+
Object.defineProperty(exports, 'onEvent', {
|
|
2240
|
+
enumerable: true,
|
|
2241
|
+
get: function () {
|
|
2242
|
+
return onEvent;
|
|
2243
|
+
}
|
|
2244
|
+
});
|
|
2245
|
+
Object.defineProperty(exports, 'onceEvent', {
|
|
2246
|
+
enumerable: true,
|
|
2247
|
+
get: function () {
|
|
2248
|
+
return onceEvent;
|
|
2249
|
+
}
|
|
2250
|
+
});
|
|
1373
2251
|
Object.defineProperty(exports, 'randomString', {
|
|
1374
2252
|
enumerable: true,
|
|
1375
2253
|
get: function () {
|
|
1376
2254
|
return randomString;
|
|
1377
2255
|
}
|
|
1378
2256
|
});
|
|
2257
|
+
Object.defineProperty(exports, 'retryOnFail', {
|
|
2258
|
+
enumerable: true,
|
|
2259
|
+
get: function () {
|
|
2260
|
+
return retryOnFail;
|
|
2261
|
+
}
|
|
2262
|
+
});
|
|
1379
2263
|
Object.defineProperty(exports, 'scrubParameters', {
|
|
1380
2264
|
enumerable: true,
|
|
1381
2265
|
get: function () {
|
|
1382
2266
|
return scrubParameters;
|
|
1383
2267
|
}
|
|
1384
2268
|
});
|
|
2269
|
+
Object.defineProperty(exports, 'setCookie', {
|
|
2270
|
+
enumerable: true,
|
|
2271
|
+
get: function () {
|
|
2272
|
+
return setCookie;
|
|
2273
|
+
}
|
|
2274
|
+
});
|
|
1385
2275
|
Object.defineProperty(exports, 'setDefaultClient', {
|
|
1386
2276
|
enumerable: true,
|
|
1387
2277
|
get: function () {
|
|
1388
2278
|
return setDefaultClient;
|
|
1389
2279
|
}
|
|
1390
2280
|
});
|
|
2281
|
+
Object.defineProperty(exports, 'splitWalletProviderKey', {
|
|
2282
|
+
enumerable: true,
|
|
2283
|
+
get: function () {
|
|
2284
|
+
return splitWalletProviderKey;
|
|
2285
|
+
}
|
|
2286
|
+
});
|
|
1391
2287
|
Object.defineProperty(exports, 'version', {
|
|
1392
2288
|
enumerable: true,
|
|
1393
2289
|
get: function () {
|
|
1394
2290
|
return version;
|
|
1395
2291
|
}
|
|
1396
2292
|
});
|
|
1397
|
-
//# sourceMappingURL=InvalidParamError-
|
|
2293
|
+
//# sourceMappingURL=InvalidParamError-DyXEKMWn.cjs.map
|