@dynamic-labs-sdk/client 1.3.0 → 1.4.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-Za4cvW7K.esm.js → InvalidParamError-BPMi0iWC.esm.js} +55 -6
- package/dist/InvalidParamError-BPMi0iWC.esm.js.map +1 -0
- package/dist/{InvalidParamError-9kQBK3sP.native.esm.js → InvalidParamError-CDmVW2DS.native.esm.js} +55 -6
- package/dist/InvalidParamError-CDmVW2DS.native.esm.js.map +1 -0
- package/dist/{InvalidParamError-DQvZQdQ9.cjs → InvalidParamError-DEmLKJKZ.cjs} +61 -6
- package/dist/InvalidParamError-DEmLKJKZ.cjs.map +1 -0
- package/dist/{NotWaasWalletAccountError-Ciq7b-Y6.cjs → NotWaasWalletAccountError-BZsBHRQe.cjs} +6 -4
- package/dist/NotWaasWalletAccountError-BZsBHRQe.cjs.map +1 -0
- package/dist/{NotWaasWalletAccountError-By3Y4taq.esm.js → NotWaasWalletAccountError-Chpne8_Q.native.esm.js} +6 -4
- package/dist/NotWaasWalletAccountError-Chpne8_Q.native.esm.js.map +1 -0
- package/dist/{NotWaasWalletAccountError-BTMvHTA8.native.esm.js → NotWaasWalletAccountError-Cntietge.esm.js} +6 -4
- package/dist/NotWaasWalletAccountError-Cntietge.esm.js.map +1 -0
- package/dist/core.cjs +6 -5
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +6 -6
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +6 -6
- package/dist/core.native.esm.js.map +1 -1
- package/dist/exports/core.d.ts +2 -0
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/exports/index.d.ts +2 -1
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-RWcIZDgC.esm.js → getNetworkProviderFromNetworkId-CEeFL-gV.esm.js} +72 -16
- package/dist/getNetworkProviderFromNetworkId-CEeFL-gV.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-COptFPwJ.native.esm.js → getNetworkProviderFromNetworkId-JGrKwBj7.native.esm.js} +72 -16
- package/dist/getNetworkProviderFromNetworkId-JGrKwBj7.native.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-BA0CHZzu.cjs → getNetworkProviderFromNetworkId-szJOsbQN.cjs} +77 -15
- package/dist/getNetworkProviderFromNetworkId-szJOsbQN.cjs.map +1 -0
- package/dist/{getSignedSessionId-DzNCj6g_.native.esm.js → getSignedSessionId-B5DikCap.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-DzNCj6g_.native.esm.js.map → getSignedSessionId-B5DikCap.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-la6RXITX.esm.js → getSignedSessionId-BOx1nFt_.esm.js} +3 -3
- package/dist/{getSignedSessionId-la6RXITX.esm.js.map → getSignedSessionId-BOx1nFt_.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-BCU987hO.cjs → getSignedSessionId-BxOK-Tdo.cjs} +3 -3
- package/dist/{getSignedSessionId-BCU987hO.cjs.map → getSignedSessionId-BxOK-Tdo.cjs.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-DSSDwOyq.cjs → getVerifiedCredentialForWalletAccount-B46O0B48.cjs} +3 -3
- package/dist/{getVerifiedCredentialForWalletAccount-DSSDwOyq.cjs.map → getVerifiedCredentialForWalletAccount-B46O0B48.cjs.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-DKJcLLHq.native.esm.js → getVerifiedCredentialForWalletAccount-CyykSi-M.native.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-DKJcLLHq.native.esm.js.map → getVerifiedCredentialForWalletAccount-CyykSi-M.native.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-Ozctwnyv.esm.js → getVerifiedCredentialForWalletAccount-DzwIoeHm.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-Ozctwnyv.esm.js.map → getVerifiedCredentialForWalletAccount-DzwIoeHm.esm.js.map} +1 -1
- package/dist/index.cjs +225 -117
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +225 -118
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +225 -118
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-CMClgbT0.cjs → isMfaRequiredForAction-6N6JB7wa.cjs} +5 -3
- package/dist/isMfaRequiredForAction-6N6JB7wa.cjs.map +1 -0
- package/dist/{isMfaRequiredForAction-DSX-TV2z.native.esm.js → isMfaRequiredForAction-D9p_du8C.esm.js} +5 -3
- package/dist/isMfaRequiredForAction-D9p_du8C.esm.js.map +1 -0
- package/dist/{isMfaRequiredForAction-C1u4Z__n.esm.js → isMfaRequiredForAction-DUvZEpjA.native.esm.js} +5 -3
- package/dist/isMfaRequiredForAction-DUvZEpjA.native.esm.js.map +1 -0
- package/dist/modules/auth/externalAuth/requestExternalAuthElevatedToken/requestExternalAuthElevatedToken.d.ts +1 -0
- package/dist/modules/auth/externalAuth/requestExternalAuthElevatedToken/requestExternalAuthElevatedToken.d.ts.map +1 -1
- package/dist/modules/auth/passkeys/registerPasskey/registerPasskey.d.ts +2 -1
- package/dist/modules/auth/passkeys/registerPasskey/registerPasskey.d.ts.map +1 -1
- package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts +1 -0
- package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/unlinkSocialAccount/unlinkSocialAccount.d.ts +2 -1
- package/dist/modules/auth/social/oauth/unlinkSocialAccount/unlinkSocialAccount.d.ts.map +1 -1
- package/dist/modules/captcha/setCaptchaToken/setCaptchaToken.d.ts +2 -1
- package/dist/modules/captcha/setCaptchaToken/setCaptchaToken.d.ts.map +1 -1
- package/dist/modules/checkout/attachCheckoutTransactionSource/attachCheckoutTransactionSource.d.ts.map +1 -1
- package/dist/modules/checkout/broadcastCheckoutTransaction/broadcastCheckoutTransaction.d.ts +1 -1
- package/dist/modules/checkout/broadcastCheckoutTransaction/broadcastCheckoutTransaction.d.ts.map +1 -1
- package/dist/modules/checkout/cancelCheckoutTransaction/cancelCheckoutTransaction.d.ts +1 -1
- package/dist/modules/checkout/cancelCheckoutTransaction/cancelCheckoutTransaction.d.ts.map +1 -1
- package/dist/modules/checkout/getCheckoutTransactionQuote/getCheckoutTransactionQuote.d.ts.map +1 -1
- package/dist/modules/checkout/prepareCheckoutTransaction/prepareCheckoutTransaction.d.ts.map +1 -1
- package/dist/modules/checkout/utils/clearCheckoutSessionToken/clearCheckoutSessionToken.d.ts +22 -0
- package/dist/modules/checkout/utils/clearCheckoutSessionToken/clearCheckoutSessionToken.d.ts.map +1 -0
- package/dist/modules/checkout/utils/clearCheckoutSessionToken/index.d.ts +3 -0
- package/dist/modules/checkout/utils/clearCheckoutSessionToken/index.d.ts.map +1 -0
- package/dist/modules/checkout/utils/subscribeToCheckoutTransaction/subscribeToCheckoutTransaction.d.ts.map +1 -1
- package/dist/modules/checkout/utils/withCheckoutSessionTokenCleanupOn401/index.d.ts +3 -0
- package/dist/modules/checkout/utils/withCheckoutSessionTokenCleanupOn401/index.d.ts.map +1 -0
- package/dist/modules/checkout/utils/withCheckoutSessionTokenCleanupOn401/withCheckoutSessionTokenCleanupOn401.d.ts +16 -0
- package/dist/modules/checkout/utils/withCheckoutSessionTokenCleanupOn401/withCheckoutSessionTokenCleanupOn401.d.ts.map +1 -0
- package/dist/modules/mfa/consumeMfaToken/consumeMfaToken.d.ts +2 -1
- package/dist/modules/mfa/consumeMfaToken/consumeMfaToken.d.ts.map +1 -1
- package/dist/modules/mfa/createNewMfaRecoveryCodes/createNewMfaRecoveryCodes.d.ts +2 -1
- package/dist/modules/mfa/createNewMfaRecoveryCodes/createNewMfaRecoveryCodes.d.ts.map +1 -1
- package/dist/modules/otp/verifyOTP/verifyOTP.d.ts +2 -1
- package/dist/modules/otp/verifyOTP/verifyOTP.d.ts.map +1 -1
- package/dist/modules/user/refreshAuth/refreshAuth.d.ts +2 -1
- package/dist/modules/user/refreshAuth/refreshAuth.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/buildUriDeeplinkOptions.d.ts +28 -0
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/buildUriDeeplinkOptions.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/index.d.ts +2 -0
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/index.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/index.d.ts +2 -0
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/index.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/resolveUriConnectionType.d.ts +17 -0
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/resolveUriConnectionType.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/getConnectionOptionPriority/getConnectionOptionPriority.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts +5 -15
- package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/resolveWalletBookWalletOptionKey/resolveWalletBookWalletOptionKey.d.ts +1 -1
- package/dist/modules/walletOptionsCatalogue/sortConnectionOptions/sortConnectionOptions.d.ts +1 -1
- package/dist/modules/walletOptionsCatalogue/sortWalletOptions/sortWalletOptions.d.ts +1 -1
- package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts +25 -37
- package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts.map +1 -1
- package/dist/modules/wallets/connectWithWalletProvider/connectWithWalletProvider.d.ts +1 -1
- package/dist/modules/wallets/connectWithWalletProvider/connectWithWalletProvider.d.ts.map +1 -1
- package/dist/modules/wallets/reconcileWalletAccountsAgainstClient/index.d.ts +2 -0
- package/dist/modules/wallets/reconcileWalletAccountsAgainstClient/index.d.ts.map +1 -0
- package/dist/modules/wallets/reconcileWalletAccountsAgainstClient/reconcileWalletAccountsAgainstClient.d.ts +25 -0
- package/dist/modules/wallets/reconcileWalletAccountsAgainstClient/reconcileWalletAccountsAgainstClient.d.ts.map +1 -0
- package/dist/services/instrumentation/connectLoggerToInstrumentation/connectLoggerToInstrumentation.d.ts.map +1 -1
- package/dist/services/instrumentation/constants.d.ts +22 -0
- package/dist/services/instrumentation/constants.d.ts.map +1 -1
- package/dist/services/instrumentation/scrubParameters/scrubParameters.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/appendConnectionUriToDeeplink/appendConnectionUriToDeeplink.d.ts +29 -0
- package/dist/utils/appendConnectionUriToDeeplink/appendConnectionUriToDeeplink.d.ts.map +1 -0
- package/dist/utils/appendConnectionUriToDeeplink/index.d.ts +2 -0
- package/dist/utils/appendConnectionUriToDeeplink/index.d.ts.map +1 -0
- package/dist/waas.cjs +4 -4
- package/dist/waas.esm.js +3 -3
- package/dist/waas.native.esm.js +3 -3
- package/dist/waasCore.cjs +4 -4
- package/dist/waasCore.esm.js +3 -3
- package/dist/waasCore.native.esm.js +3 -3
- package/package.json +2 -2
- package/dist/InvalidParamError-9kQBK3sP.native.esm.js.map +0 -1
- package/dist/InvalidParamError-DQvZQdQ9.cjs.map +0 -1
- package/dist/InvalidParamError-Za4cvW7K.esm.js.map +0 -1
- package/dist/NotWaasWalletAccountError-BTMvHTA8.native.esm.js.map +0 -1
- package/dist/NotWaasWalletAccountError-By3Y4taq.esm.js.map +0 -1
- package/dist/NotWaasWalletAccountError-Ciq7b-Y6.cjs.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-BA0CHZzu.cjs.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-COptFPwJ.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-RWcIZDgC.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-C1u4Z__n.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-CMClgbT0.cjs.map +0 -1
- package/dist/isMfaRequiredForAction-DSX-TV2z.native.esm.js.map +0 -1
- package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts +0 -23
- package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-
|
|
2
|
-
const require_InvalidParamError = require('./InvalidParamError-
|
|
3
|
-
const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-
|
|
4
|
-
const require_NotWaasWalletAccountError = require('./NotWaasWalletAccountError-
|
|
5
|
-
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-
|
|
1
|
+
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-szJOsbQN.cjs');
|
|
2
|
+
const require_InvalidParamError = require('./InvalidParamError-DEmLKJKZ.cjs');
|
|
3
|
+
const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-B46O0B48.cjs');
|
|
4
|
+
const require_NotWaasWalletAccountError = require('./NotWaasWalletAccountError-BZsBHRQe.cjs');
|
|
5
|
+
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-6N6JB7wa.cjs');
|
|
6
6
|
let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
|
|
7
7
|
let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
|
|
8
8
|
let zod_mini = require("zod/mini");
|
|
@@ -27,6 +27,36 @@ const stateChangeEvents = {
|
|
|
27
27
|
user: "userChanged"
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/utils/appendConnectionUriToDeeplink/appendConnectionUriToDeeplink.ts
|
|
32
|
+
/**
|
|
33
|
+
* Appends a wallet connection URI to a deeplink URL.
|
|
34
|
+
*
|
|
35
|
+
* Generic across URI-deeplink connection options — works for both
|
|
36
|
+
* WalletConnect pairing URIs and MetaMask SDK URIs. Determines the
|
|
37
|
+
* appropriate query parameter separator based on whether the deeplink
|
|
38
|
+
* already contains query parameters.
|
|
39
|
+
*
|
|
40
|
+
* @param params.deeplinkUrl - The base deeplink URL (e.g., `walletapp://wc` or `walletapp://wc?param=value`).
|
|
41
|
+
* @param params.connectionUri - The connection URI to append.
|
|
42
|
+
* @returns The deeplink URL with the connection URI appended as a query parameter.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* appendConnectionUriToDeeplink({ deeplinkUrl: 'walletapp://wc', connectionUri: 'wc:123-456' })
|
|
47
|
+
* // Returns: 'walletapp://wc?uri=wc%3A123-456'
|
|
48
|
+
*
|
|
49
|
+
* appendConnectionUriToDeeplink({ deeplinkUrl: 'walletapp://wc?param=value', connectionUri: 'wc:123-456' })
|
|
50
|
+
* // Returns: 'walletapp://wc?param=value&uri=wc%3A123-456'
|
|
51
|
+
* ```
|
|
52
|
+
* @not-instrumented
|
|
53
|
+
*/
|
|
54
|
+
const appendConnectionUriToDeeplink = ({ connectionUri, deeplinkUrl }) => {
|
|
55
|
+
const url = new URL(deeplinkUrl);
|
|
56
|
+
url.searchParams.set("uri", connectionUri);
|
|
57
|
+
return url.href;
|
|
58
|
+
};
|
|
59
|
+
|
|
30
60
|
//#endregion
|
|
31
61
|
//#region src/utils/getNonce/prefetchNoncesIfNeeded/prefetchNoncesIfNeeded.ts
|
|
32
62
|
/** @not-instrumented */
|
|
@@ -628,10 +658,13 @@ const connectLoggerToInstrumentation = ({ environmentId, extensions, instrumenta
|
|
|
628
658
|
const { token, user } = state.get();
|
|
629
659
|
instrumentation.log({
|
|
630
660
|
environmentId,
|
|
631
|
-
parameters: {
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
661
|
+
parameters: require_InvalidParamError.scrubParameters({
|
|
662
|
+
piiFields: instrumentation.config.piiFields,
|
|
663
|
+
value: {
|
|
664
|
+
args,
|
|
665
|
+
message
|
|
666
|
+
}
|
|
667
|
+
}),
|
|
635
668
|
registeredExtensionKeys: Array.from(extensions),
|
|
636
669
|
sdkSessionId,
|
|
637
670
|
sdkVersion,
|
|
@@ -1543,6 +1576,7 @@ const __checkStepUpAuth_wrapped = require_InvalidParamError.instrumentFunction({
|
|
|
1543
1576
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1544
1577
|
* @returns A promise that resolves to the assertion response containing the elevated access token.
|
|
1545
1578
|
* @instrumented
|
|
1579
|
+
* @redact-params
|
|
1546
1580
|
*/
|
|
1547
1581
|
const requestExternalAuthElevatedToken = async ({ externalJwt }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
1548
1582
|
const core = require_InvalidParamError.getCore(client);
|
|
@@ -1570,7 +1604,8 @@ const __requestExternalAuthElevatedToken_wrapped = require_InvalidParamError.ins
|
|
|
1570
1604
|
} catch {
|
|
1571
1605
|
return;
|
|
1572
1606
|
}
|
|
1573
|
-
}
|
|
1607
|
+
},
|
|
1608
|
+
redactAll: true
|
|
1574
1609
|
});
|
|
1575
1610
|
|
|
1576
1611
|
//#endregion
|
|
@@ -1722,6 +1757,7 @@ const serverRegisterPasskey = async ({ registration, createMfaToken }, client) =
|
|
|
1722
1757
|
* @returns A promise that resolves to the registration response.
|
|
1723
1758
|
* @throws NoWebAuthNSupportError If WebAuthn is not supported by the browser.
|
|
1724
1759
|
* @instrumented
|
|
1760
|
+
* @redact-params
|
|
1725
1761
|
*/
|
|
1726
1762
|
const registerPasskey = async ({ createMfaToken } = {}, client = require_InvalidParamError.getDefaultClient()) => {
|
|
1727
1763
|
const core = require_InvalidParamError.getCore(client);
|
|
@@ -1744,7 +1780,8 @@ const __registerPasskey_wrapped = require_InvalidParamError.instrumentFunction({
|
|
|
1744
1780
|
} catch {
|
|
1745
1781
|
return;
|
|
1746
1782
|
}
|
|
1747
|
-
}
|
|
1783
|
+
},
|
|
1784
|
+
redactAll: true
|
|
1748
1785
|
});
|
|
1749
1786
|
|
|
1750
1787
|
//#endregion
|
|
@@ -1789,6 +1826,7 @@ const serverSigninPasskey = async ({ authentication, createMfaToken }, client) =
|
|
|
1789
1826
|
* @returns A promise that resolves to the authentication response.
|
|
1790
1827
|
* @throws NoWebAuthNSupportError If WebAuthn is not supported by the browser.
|
|
1791
1828
|
* @instrumented
|
|
1829
|
+
* @redact-params
|
|
1792
1830
|
*/
|
|
1793
1831
|
const signInWithPasskey = async ({ relatedOriginRpId } = {}, client = require_InvalidParamError.getDefaultClient()) => {
|
|
1794
1832
|
const core = require_InvalidParamError.getCore(client);
|
|
@@ -1808,7 +1846,8 @@ const __signInWithPasskey_wrapped = require_InvalidParamError.instrumentFunction
|
|
|
1808
1846
|
} catch {
|
|
1809
1847
|
return;
|
|
1810
1848
|
}
|
|
1811
|
-
}
|
|
1849
|
+
},
|
|
1850
|
+
redactAll: true
|
|
1812
1851
|
});
|
|
1813
1852
|
|
|
1814
1853
|
//#endregion
|
|
@@ -2250,6 +2289,7 @@ const getPrimaryWalletAccount = (client = require_InvalidParamError.getDefaultCl
|
|
|
2250
2289
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2251
2290
|
* @returns A promise that resolves to the verify response.
|
|
2252
2291
|
* @instrumented
|
|
2292
|
+
* @redact-params
|
|
2253
2293
|
*/
|
|
2254
2294
|
const unlinkSocialAccount = async ({ verifiedCredentialId }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
2255
2295
|
const core = require_InvalidParamError.getCore(client);
|
|
@@ -2275,7 +2315,8 @@ const __unlinkSocialAccount_wrapped = require_InvalidParamError.instrumentFuncti
|
|
|
2275
2315
|
} catch {
|
|
2276
2316
|
return;
|
|
2277
2317
|
}
|
|
2278
|
-
}
|
|
2318
|
+
},
|
|
2319
|
+
redactAll: true
|
|
2279
2320
|
});
|
|
2280
2321
|
|
|
2281
2322
|
//#endregion
|
|
@@ -2357,6 +2398,52 @@ const createCheckoutApiClient = async ({ transactionId }, client) => {
|
|
|
2357
2398
|
};
|
|
2358
2399
|
};
|
|
2359
2400
|
|
|
2401
|
+
//#endregion
|
|
2402
|
+
//#region src/modules/checkout/utils/clearCheckoutSessionToken/clearCheckoutSessionToken.ts
|
|
2403
|
+
/**
|
|
2404
|
+
* Removes the locally stored checkout session token for the given transaction.
|
|
2405
|
+
*
|
|
2406
|
+
* The checkout session token is the anonymous credential that authorizes
|
|
2407
|
+
* mutations to a single in-flight checkout transaction. Once the transaction
|
|
2408
|
+
* has reached a terminal state (cancelled, expired, failed, completed) it can
|
|
2409
|
+
* no longer be advanced, and the token is dead weight that should not be
|
|
2410
|
+
* persisted in browser storage — leaving it around lets a later XSS payload
|
|
2411
|
+
* exfiltrate a credential with no further use, and it can also confuse the
|
|
2412
|
+
* SDK on subsequent loads into believing an active session exists.
|
|
2413
|
+
*
|
|
2414
|
+
* The server-side revocation lives in dashboard-api; this is the SDK-side
|
|
2415
|
+
* defense-in-depth.
|
|
2416
|
+
*
|
|
2417
|
+
* @not-instrumented
|
|
2418
|
+
*/
|
|
2419
|
+
const clearCheckoutSessionToken = async ({ transactionId }, client) => {
|
|
2420
|
+
await require_InvalidParamError.getCore(client).storage.removeItem(createCheckoutSessionTokenStorageKey(transactionId));
|
|
2421
|
+
};
|
|
2422
|
+
|
|
2423
|
+
//#endregion
|
|
2424
|
+
//#region src/modules/checkout/utils/withCheckoutSessionTokenCleanupOn401/withCheckoutSessionTokenCleanupOn401.ts
|
|
2425
|
+
/**
|
|
2426
|
+
* Checkout mutation routes are guarded server-side only by session-token
|
|
2427
|
+
* validation, so a 401 means the token is dead (revoked, expired, deleted,
|
|
2428
|
+
* or invalid). Leaving a dead token in `localStorage` widens the XSS
|
|
2429
|
+
* exfiltration surface for no benefit and makes the next SDK load attempt
|
|
2430
|
+
* requests that are guaranteed to fail.
|
|
2431
|
+
*
|
|
2432
|
+
* @not-instrumented
|
|
2433
|
+
*/
|
|
2434
|
+
const withCheckoutSessionTokenCleanupOn401 = async ({ call, transactionId }, client) => {
|
|
2435
|
+
try {
|
|
2436
|
+
return await call();
|
|
2437
|
+
} catch (error) {
|
|
2438
|
+
if (error instanceof require_InvalidParamError.APIError && error.status === 401) try {
|
|
2439
|
+
await clearCheckoutSessionToken({ transactionId }, client);
|
|
2440
|
+
} catch (cleanupError) {
|
|
2441
|
+
require_InvalidParamError.getCore(client).logger.error("Failed to clear checkout session token after 401", cleanupError);
|
|
2442
|
+
}
|
|
2443
|
+
throw error;
|
|
2444
|
+
}
|
|
2445
|
+
};
|
|
2446
|
+
|
|
2360
2447
|
//#endregion
|
|
2361
2448
|
//#region src/modules/checkout/attachCheckoutTransactionSource/attachCheckoutTransactionSource.ts
|
|
2362
2449
|
/**
|
|
@@ -2381,12 +2468,15 @@ const attachCheckoutTransactionSource = async (params, client = require_InvalidP
|
|
|
2381
2468
|
attachSourceRequest.fromChainId = params.fromChainId;
|
|
2382
2469
|
attachSourceRequest.fromChainName = params.fromChainName;
|
|
2383
2470
|
}
|
|
2384
|
-
return
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2471
|
+
return withCheckoutSessionTokenCleanupOn401({
|
|
2472
|
+
call: () => apiClient.attachSource({
|
|
2473
|
+
attachSourceRequest,
|
|
2474
|
+
environmentId,
|
|
2475
|
+
transactionId,
|
|
2476
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
2477
|
+
}),
|
|
2478
|
+
transactionId
|
|
2479
|
+
}, client);
|
|
2390
2480
|
};
|
|
2391
2481
|
const __attachCheckoutTransactionSource_impl = attachCheckoutTransactionSource;
|
|
2392
2482
|
const __attachCheckoutTransactionSource_wrapped = require_InvalidParamError.instrumentFunction({
|
|
@@ -2417,12 +2507,15 @@ const __attachCheckoutTransactionSource_wrapped = require_InvalidParamError.inst
|
|
|
2417
2507
|
*/
|
|
2418
2508
|
const broadcastCheckoutTransaction = async ({ transactionId, txHash }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
2419
2509
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
2420
|
-
return
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2510
|
+
return withCheckoutSessionTokenCleanupOn401({
|
|
2511
|
+
call: () => apiClient.recordCheckoutBroadcast({
|
|
2512
|
+
environmentId,
|
|
2513
|
+
recordBroadcastRequest: { txHash },
|
|
2514
|
+
transactionId,
|
|
2515
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
2516
|
+
}),
|
|
2517
|
+
transactionId
|
|
2518
|
+
}, client);
|
|
2426
2519
|
};
|
|
2427
2520
|
const __broadcastCheckoutTransaction_impl = broadcastCheckoutTransaction;
|
|
2428
2521
|
const __broadcastCheckoutTransaction_wrapped = require_InvalidParamError.instrumentFunction({
|
|
@@ -2449,12 +2542,15 @@ const __broadcastCheckoutTransaction_wrapped = require_InvalidParamError.instrum
|
|
|
2449
2542
|
*/
|
|
2450
2543
|
const cancelCheckoutTransaction = async ({ transactionId }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
2451
2544
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
2452
|
-
const result = await
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2545
|
+
const result = await withCheckoutSessionTokenCleanupOn401({
|
|
2546
|
+
call: () => apiClient.cancelCheckoutTransaction({
|
|
2547
|
+
environmentId,
|
|
2548
|
+
transactionId,
|
|
2549
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
2550
|
+
}),
|
|
2551
|
+
transactionId
|
|
2552
|
+
}, client);
|
|
2553
|
+
await clearCheckoutSessionToken({ transactionId }, client);
|
|
2458
2554
|
return result;
|
|
2459
2555
|
};
|
|
2460
2556
|
const __cancelCheckoutTransaction_impl = cancelCheckoutTransaction;
|
|
@@ -2555,16 +2651,19 @@ const getCheckoutTransaction = async ({ transactionId }, client = require_Invali
|
|
|
2555
2651
|
*/
|
|
2556
2652
|
const getCheckoutTransactionQuote = async ({ fromChainId, fromTokenAddress, slippage, transactionId }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
2557
2653
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
2558
|
-
return
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2654
|
+
return withCheckoutSessionTokenCleanupOn401({
|
|
2655
|
+
call: () => apiClient.quoteCheckoutTransaction({
|
|
2656
|
+
environmentId,
|
|
2657
|
+
quoteRequest: {
|
|
2658
|
+
fromChainId,
|
|
2659
|
+
fromTokenAddress,
|
|
2660
|
+
slippage
|
|
2661
|
+
},
|
|
2662
|
+
transactionId,
|
|
2663
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
2664
|
+
}),
|
|
2665
|
+
transactionId
|
|
2666
|
+
}, client);
|
|
2568
2667
|
};
|
|
2569
2668
|
|
|
2570
2669
|
//#endregion
|
|
@@ -2581,15 +2680,18 @@ const getCheckoutTransactionQuote = async ({ fromChainId, fromTokenAddress, slip
|
|
|
2581
2680
|
*/
|
|
2582
2681
|
const prepareCheckoutTransaction = async ({ assertBalanceForGasCost, assertBalanceForTransferAmount, transactionId }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
2583
2682
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
2584
|
-
return
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2683
|
+
return withCheckoutSessionTokenCleanupOn401({
|
|
2684
|
+
call: () => apiClient.prepareCheckoutTransaction({
|
|
2685
|
+
environmentId,
|
|
2686
|
+
prepareSigningRequest: {
|
|
2687
|
+
assertBalanceForGasCost: assertBalanceForGasCost ?? false,
|
|
2688
|
+
assertBalanceForTransferAmount: assertBalanceForTransferAmount ?? false
|
|
2689
|
+
},
|
|
2690
|
+
transactionId,
|
|
2691
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
2692
|
+
}),
|
|
2693
|
+
transactionId
|
|
2694
|
+
}, client);
|
|
2593
2695
|
};
|
|
2594
2696
|
const __prepareCheckoutTransaction_impl = prepareCheckoutTransaction;
|
|
2595
2697
|
const __prepareCheckoutTransaction_wrapped = require_InvalidParamError.instrumentFunction({
|
|
@@ -3840,7 +3942,7 @@ const getWalletConnectCatalogWalletByWalletProviderKey = async ({ walletProvider
|
|
|
3840
3942
|
//#region src/modules/walletOptionsCatalogue/resolveWalletBookWalletOptionKey/resolveWalletBookWalletOptionKey.ts
|
|
3841
3943
|
/**
|
|
3842
3944
|
* Resolves which wallet option (group) a wallet book entry belongs to. Used
|
|
3843
|
-
* by the catalogue's wallet-book-driven transformers (
|
|
3945
|
+
* by the catalogue's wallet-book-driven transformers (URI deeplink,
|
|
3844
3946
|
* `inAppBrowser`, `installation`) to bucket their emitted options.
|
|
3845
3947
|
*
|
|
3846
3948
|
* Wallet book entries inconsistently use `group` / `chainGroup` /
|
|
@@ -3995,30 +4097,50 @@ const buildInstallationUrlsByWalletOptionKey = ({ walletBook }) => {
|
|
|
3995
4097
|
};
|
|
3996
4098
|
|
|
3997
4099
|
//#endregion
|
|
3998
|
-
//#region src/modules/walletOptionsCatalogue/
|
|
4100
|
+
//#region src/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/resolveUriConnectionType.ts
|
|
4101
|
+
/**
|
|
4102
|
+
* Picks the connection-option `type` discriminator for a wallet-book-
|
|
4103
|
+
* derived URI deeplink option. MetaMask is steered toward its own
|
|
4104
|
+
* MetaMask SDK URI connection extension (`metamaskSdkUri`) so we route
|
|
4105
|
+
* customers off generic WalletConnect for that wallet; every other
|
|
4106
|
+
* wallet uses the standard `walletConnect` discriminator.
|
|
4107
|
+
*
|
|
4108
|
+
* @param params.walletOptionKey - The resolved wallet option key.
|
|
4109
|
+
* @returns The connection-option discriminator to emit.
|
|
4110
|
+
* @not-instrumented
|
|
4111
|
+
*/
|
|
4112
|
+
const resolveUriConnectionType = ({ walletOptionKey }) => walletOptionKey === "metamask" ? "metamaskSdkUri" : "walletConnect";
|
|
4113
|
+
|
|
4114
|
+
//#endregion
|
|
4115
|
+
//#region src/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/buildUriDeeplinkOptions.ts
|
|
3999
4116
|
/**
|
|
4000
|
-
* A wallet only deserves a
|
|
4001
|
-
* least one mobile deeplink — that's the value-add the option provides
|
|
4002
|
-
* the bare
|
|
4003
|
-
* expose a deeplink (rare, but present) are silently skipped.
|
|
4117
|
+
* A wallet only deserves a URI-deeplink catalogue option if it has at
|
|
4118
|
+
* least one mobile deeplink — that's the value-add the option provides
|
|
4119
|
+
* over the bare pairing URI. Wallets that exist in the wallet book but
|
|
4120
|
+
* don't expose a deeplink (rare, but present) are silently skipped.
|
|
4004
4121
|
*/
|
|
4005
4122
|
const hasUsableDeeplink = ({ wallet }) => Boolean(wallet.mobile?.native || wallet.mobile?.universal);
|
|
4006
4123
|
/**
|
|
4007
|
-
* Builds the
|
|
4124
|
+
* Builds the URI-deeplink catalogue options from a fetched wallet book.
|
|
4008
4125
|
* Applies the WalletConnect-specific eligibility filter
|
|
4009
4126
|
* (`shouldFilterWalletForWalletConnect`) so embedded wallets and entries
|
|
4010
4127
|
* without `sign_v2` support are excluded — same surface as
|
|
4011
4128
|
* `getWalletConnectCatalog`.
|
|
4012
4129
|
*
|
|
4013
4130
|
* Each emitted option carries the wallet's mobile deeplinks. Customers
|
|
4014
|
-
* combine these with their chain's
|
|
4015
|
-
* `
|
|
4131
|
+
* combine these with their chain's connection URI via
|
|
4132
|
+
* `appendConnectionUriToDeeplink` to open the wallet's app:
|
|
4133
|
+
*
|
|
4134
|
+
* - `'walletConnect'`: mint via `connectWithWalletConnect<Chain>`.
|
|
4135
|
+
* - `'metamaskSdkUri'`: mint via `connectWithMetaMaskUriEvm` or
|
|
4136
|
+
* `connectWithMetaMaskUriSolana`. Emitted only for the MetaMask
|
|
4137
|
+
* wallet entry — see `resolveUriConnectionType`.
|
|
4016
4138
|
*
|
|
4017
4139
|
* @param params.walletBook - The fetched wallet book.
|
|
4018
|
-
* @returns Tagged
|
|
4140
|
+
* @returns Tagged options paired with their wallet option keys.
|
|
4019
4141
|
* @not-instrumented
|
|
4020
4142
|
*/
|
|
4021
|
-
const
|
|
4143
|
+
const buildUriDeeplinkOptions = ({ walletBook }) => {
|
|
4022
4144
|
const result = [];
|
|
4023
4145
|
for (const [walletKey, wallet] of Object.entries(walletBook.wallets)) {
|
|
4024
4146
|
if (shouldFilterWalletForWalletConnect({
|
|
@@ -4041,7 +4163,7 @@ const buildWalletConnectOptions = ({ walletBook }) => {
|
|
|
4041
4163
|
native: wallet.mobile?.native,
|
|
4042
4164
|
universal: wallet.mobile?.universal
|
|
4043
4165
|
},
|
|
4044
|
-
type:
|
|
4166
|
+
type: resolveUriConnectionType({ walletOptionKey })
|
|
4045
4167
|
},
|
|
4046
4168
|
walletOptionKey
|
|
4047
4169
|
});
|
|
@@ -4382,10 +4504,11 @@ const groupOptionsByWalletOption = ({ options }) => {
|
|
|
4382
4504
|
* wallet-option list is ordered — that's controlled by
|
|
4383
4505
|
* `WalletOptionOrdering`.
|
|
4384
4506
|
*
|
|
4385
|
-
* `withWalletProvider > walletConnect > inAppBrowser`
|
|
4507
|
+
* `withWalletProvider > walletConnect / metamaskSdkUri > inAppBrowser`
|
|
4386
4508
|
*/
|
|
4387
4509
|
const CONNECTION_OPTION_PRIORITY = {
|
|
4388
4510
|
inAppBrowser: 2,
|
|
4511
|
+
metamaskSdkUri: 1,
|
|
4389
4512
|
walletConnect: 1,
|
|
4390
4513
|
withWalletProvider: 0
|
|
4391
4514
|
};
|
|
@@ -4404,7 +4527,7 @@ const getConnectionOptionPriority = ({ option }) => CONNECTION_OPTION_PRIORITY[o
|
|
|
4404
4527
|
/**
|
|
4405
4528
|
* Sorts a wallet option's `connectionOptions` so the most preferred option lands at
|
|
4406
4529
|
* index 0. Primary sort is by option-type priority
|
|
4407
|
-
* (`withWalletProvider` >
|
|
4530
|
+
* (`withWalletProvider` > URI deeplink > `inAppBrowser`);
|
|
4408
4531
|
* within a type, ties break alphabetically by `chain` for deterministic
|
|
4409
4532
|
* output across calls.
|
|
4410
4533
|
*
|
|
@@ -4528,7 +4651,7 @@ const hasInstalledProvider = ({ walletOption }) => walletOption.connectionOption
|
|
|
4528
4651
|
* this order:
|
|
4529
4652
|
* 1. **Installed provider** — user already has the wallet available
|
|
4530
4653
|
* (`withWalletProvider` at index 0).
|
|
4531
|
-
* 2. **Connectable** — has at least one connection (
|
|
4654
|
+
* 2. **Connectable** — has at least one connection (URI deeplink
|
|
4532
4655
|
* or `inAppBrowser`) but no installed provider.
|
|
4533
4656
|
* 3. **Install-only** — no connection at all; only `installationUrls`.
|
|
4534
4657
|
* Within each tier, rank by the hand-curated {@link PRIORITY_WALLET_KEYS}
|
|
@@ -4578,45 +4701,28 @@ const EMPTY_WALLET_BOOK = {
|
|
|
4578
4701
|
wallets: {}
|
|
4579
4702
|
};
|
|
4580
4703
|
/**
|
|
4581
|
-
* Returns
|
|
4582
|
-
* with through this client.
|
|
4583
|
-
* `
|
|
4584
|
-
*
|
|
4585
|
-
* any matching connections are omitted.
|
|
4586
|
-
*
|
|
4587
|
-
* `includeWithWalletProvider` defaults to `true`; all other inclusion flags
|
|
4588
|
-
* are opt-in. `walletOptionOrdering` defaults to `'relevance'` (Dynamic's
|
|
4589
|
-
* recommended order); pass `'alphabetical'` to sort by wallet option name
|
|
4590
|
-
* within each option-priority tier.
|
|
4704
|
+
* Returns the catalogue of external wallet options a user can sign in
|
|
4705
|
+
* with through this client. Always includes installed wallet providers;
|
|
4706
|
+
* pass `includeMobileOptions: true` to additionally surface
|
|
4707
|
+
* WalletConnect, in-app-browser, and install links.
|
|
4591
4708
|
*
|
|
4592
|
-
*
|
|
4593
|
-
* (`includeWalletConnect`, `includeInAppBrowser`). Calls that only need
|
|
4594
|
-
* `includeWithWalletProvider` skip the fetch entirely.
|
|
4595
|
-
*
|
|
4596
|
-
* @param [params] - Inclusion flags + ordering preference.
|
|
4709
|
+
* @param [params] - Inclusion flag + ordering preference.
|
|
4597
4710
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4598
4711
|
* @returns A promise that resolves to the wallet options catalogue.
|
|
4599
4712
|
* @not-instrumented
|
|
4600
4713
|
*/
|
|
4601
4714
|
const getWalletOptionsCatalogue = async (params = {}, client = require_InvalidParamError.getDefaultClient()) => {
|
|
4602
|
-
const
|
|
4603
|
-
const includeWalletConnect = params.includeWalletConnect ?? false;
|
|
4604
|
-
const includeInAppBrowser = params.includeInAppBrowser ?? false;
|
|
4605
|
-
const includeInstallation = params.includeInstallation ?? false;
|
|
4715
|
+
const includeMobileOptions = params.includeMobileOptions ?? false;
|
|
4606
4716
|
const walletOptionOrdering = params.walletOptionOrdering ?? "relevance";
|
|
4607
|
-
|
|
4608
|
-
const walletBook = includeWalletConnect || includeInAppBrowser || includeInstallation ? await fetchLegacyWalletBook(client) : EMPTY_WALLET_BOOK;
|
|
4717
|
+
const walletBook = includeMobileOptions ? await fetchLegacyWalletBook(client) : EMPTY_WALLET_BOOK;
|
|
4609
4718
|
const allConnectionOptions = [];
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
}
|
|
4617
|
-
if (includeWalletConnect) allConnectionOptions.push(...buildWalletConnectOptions({ walletBook }));
|
|
4618
|
-
if (includeInAppBrowser) allConnectionOptions.push(...buildInAppBrowserOptions({ walletBook }));
|
|
4619
|
-
const installationUrlsByKey = includeInstallation ? buildInstallationUrlsByWalletOptionKey({ walletBook }) : /* @__PURE__ */ new Map();
|
|
4719
|
+
const entries = require_getVerifiedCredentialForWalletAccount.getWalletProviderRegistry(client).listProviderEntries();
|
|
4720
|
+
allConnectionOptions.push(...buildWithWalletProviderOptions({
|
|
4721
|
+
entries,
|
|
4722
|
+
walletBook
|
|
4723
|
+
}, client));
|
|
4724
|
+
if (includeMobileOptions) allConnectionOptions.push(...buildUriDeeplinkOptions({ walletBook }), ...buildInAppBrowserOptions({ walletBook }));
|
|
4725
|
+
const installationUrlsByKey = includeMobileOptions ? buildInstallationUrlsByWalletOptionKey({ walletBook }) : /* @__PURE__ */ new Map();
|
|
4620
4726
|
const grouped = groupOptionsByWalletOption({ options: allConnectionOptions });
|
|
4621
4727
|
const allWalletOptionKeys = new Set([...grouped.keys(), ...installationUrlsByKey.keys()]);
|
|
4622
4728
|
const walletOptions = [];
|
|
@@ -4896,6 +5002,7 @@ const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions
|
|
|
4896
5002
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4897
5003
|
* @returns A promise that resolves to the newly generated recovery codes.
|
|
4898
5004
|
* @instrumented
|
|
5005
|
+
* @redact-params
|
|
4899
5006
|
*/
|
|
4900
5007
|
const createNewMfaRecoveryCodes = async (client = require_InvalidParamError.getDefaultClient()) => {
|
|
4901
5008
|
const core = require_InvalidParamError.getCore(client);
|
|
@@ -4911,7 +5018,8 @@ const __createNewMfaRecoveryCodes_wrapped = require_InvalidParamError.instrument
|
|
|
4911
5018
|
} catch {
|
|
4912
5019
|
return;
|
|
4913
5020
|
}
|
|
4914
|
-
}
|
|
5021
|
+
},
|
|
5022
|
+
redactAll: true
|
|
4915
5023
|
});
|
|
4916
5024
|
|
|
4917
5025
|
//#endregion
|
|
@@ -6138,6 +6246,7 @@ const verifyOTPForUserUpdate = async ({ otpVerification, verificationToken, requ
|
|
|
6138
6246
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6139
6247
|
* @returns A promise that resolves to the verify response object upon successful verification.
|
|
6140
6248
|
* @instrumented
|
|
6249
|
+
* @redact-params
|
|
6141
6250
|
*/
|
|
6142
6251
|
const verifyOTP = async ({ otpVerification, verificationToken, requestedScopes }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
6143
6252
|
let response;
|
|
@@ -6163,7 +6272,8 @@ const __verifyOTP_wrapped = require_InvalidParamError.instrumentFunction({
|
|
|
6163
6272
|
} catch {
|
|
6164
6273
|
return;
|
|
6165
6274
|
}
|
|
6166
|
-
}
|
|
6275
|
+
},
|
|
6276
|
+
redactAll: true
|
|
6167
6277
|
});
|
|
6168
6278
|
|
|
6169
6279
|
//#endregion
|
|
@@ -6587,13 +6697,12 @@ const getAddressesWithTypesFromConnectionResult = (connectionResult) => {
|
|
|
6587
6697
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6588
6698
|
* @returns A promise that resolves to the connected wallet account.
|
|
6589
6699
|
* @throws NoAddressFoundError If the request to connect was successful but no address is connected to your app.
|
|
6590
|
-
*
|
|
6700
|
+
* @instrumented
|
|
6591
6701
|
*/
|
|
6592
6702
|
const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWalletAccounts = true, hardwareWalletVendor }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
6593
6703
|
const walletProvider = require_getVerifiedCredentialForWalletAccount.getWalletProviderByKey({ walletProviderKey }, client);
|
|
6594
6704
|
assertWalletProviderMethodDefined(walletProvider, "connect");
|
|
6595
6705
|
const { addresses } = await walletProvider.connect();
|
|
6596
|
-
const currentAddresses = require_getVerifiedCredentialForWalletAccount.getWalletAccounts(client).map(({ address }) => address);
|
|
6597
6706
|
const mainAddress = addresses?.length ? addresses[0].address : null;
|
|
6598
6707
|
/**
|
|
6599
6708
|
* This error is thrown in case the wallet has no addresses connected
|
|
@@ -6601,27 +6710,25 @@ const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWallet
|
|
|
6601
6710
|
* user on the next steps.
|
|
6602
6711
|
*/
|
|
6603
6712
|
if (!mainAddress) throw new NoAddressFoundError();
|
|
6604
|
-
const
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
chain: walletProvider.chain,
|
|
6608
|
-
hardwareWalletVendor,
|
|
6609
|
-
id: require_getVerifiedCredentialForWalletAccount.formatWalletAccountId({
|
|
6713
|
+
const [reconciledWalletAccount] = require_getNetworkProviderFromNetworkId.reconcileWalletAccountsAgainstClient({
|
|
6714
|
+
addToDynamicWalletAccounts,
|
|
6715
|
+
walletAccounts: [{
|
|
6610
6716
|
address: mainAddress,
|
|
6717
|
+
addressesWithTypes: getAddressesWithTypesFromConnectionResult({ addresses }),
|
|
6611
6718
|
chain: walletProvider.chain,
|
|
6719
|
+
hardwareWalletVendor,
|
|
6720
|
+
id: require_getVerifiedCredentialForWalletAccount.formatWalletAccountId({
|
|
6721
|
+
address: mainAddress,
|
|
6722
|
+
chain: walletProvider.chain,
|
|
6723
|
+
walletProviderKey
|
|
6724
|
+
}),
|
|
6725
|
+
lastSelectedAt: null,
|
|
6726
|
+
verifiedCredentialId: null,
|
|
6612
6727
|
walletProviderKey
|
|
6613
|
-
}
|
|
6614
|
-
lastSelectedAt: null,
|
|
6615
|
-
verifiedCredentialId: null,
|
|
6728
|
+
}],
|
|
6616
6729
|
walletProviderKey
|
|
6617
|
-
};
|
|
6618
|
-
|
|
6619
|
-
if (addToDynamicWalletAccounts) {
|
|
6620
|
-
require_getNetworkProviderFromNetworkId.setUnverifiedWalletAccounts({ unverifiedWalletAccountsToUpdate: [walletAccount] }, client);
|
|
6621
|
-
require_getVerifiedCredentialForWalletAccount.emitWalletAccountsChangedEvent(client);
|
|
6622
|
-
require_getNetworkProviderFromNetworkId.createVisit({ walletAccount }, client);
|
|
6623
|
-
}
|
|
6624
|
-
return walletAccount;
|
|
6730
|
+
}, client);
|
|
6731
|
+
return reconciledWalletAccount;
|
|
6625
6732
|
};
|
|
6626
6733
|
const __connectWithWalletProvider_impl = connectWithWalletProvider;
|
|
6627
6734
|
const __connectWithWalletProvider_wrapped = require_InvalidParamError.instrumentFunction({
|
|
@@ -7600,6 +7707,7 @@ exports.WalletProviderMethodUnavailableError = WalletProviderMethodUnavailableEr
|
|
|
7600
7707
|
exports.acknowledgeRecoveryCodes = __acknowledgeRecoveryCodes_wrapped;
|
|
7601
7708
|
exports.addCoinbaseOnrampOrderEventListener = addCoinbaseOnrampOrderEventListener;
|
|
7602
7709
|
exports.addNetwork = __addNetwork_wrapped;
|
|
7710
|
+
exports.appendConnectionUriToDeeplink = appendConnectionUriToDeeplink;
|
|
7603
7711
|
exports.assertWalletAccountSigningAvailability = assertWalletAccountSigningAvailability;
|
|
7604
7712
|
exports.assertWalletProviderMethodDefined = assertWalletProviderMethodDefined;
|
|
7605
7713
|
exports.attachCheckoutTransactionSource = __attachCheckoutTransactionSource_wrapped;
|