@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.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { A as
|
|
3
|
-
import { A as onceEvent, C as formatWalletAccountId, D as emitEvent, O as offEvent, T as splitWalletProviderKey, _ as getWalletProviderRegistry, a as parseElevatedAccessToken, b as getWalletAccounts, d as isUserMissingMfaAuth, f as checkAndRaiseWalletAccountsChangedEvent, g as WalletProviderPriority, h as getWalletProviderFromWalletAccount, i as upsertElevatedAccessToken, k as onEvent, n as getWalletProviderByKey, o as restoreUserSharesForAllWalletAccounts,
|
|
4
|
-
import { n as __refreshAuth_wrapped, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-
|
|
5
|
-
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-
|
|
1
|
+
import { A as getUserAgent, B as getCore, C as isCookieEnabled, D as instrumentFunction, E as __getElevatedAccessToken_wrapped, F as NONCE_POOL_SIZE, H as version, I as getDefaultClient, L as setDefaultClient, M as randomString, O as scrubParameters, T as ValueMustBeDefinedError, V as name, _ as MfaRateLimitedError, a as DYNAMIC_ICONIC_SPRITE_URL, b as InvalidExternalAuthError, c as CHAINS_INFO_MAP, d as UnauthorizedError, g as SandboxMaximumThresholdReachedError, h as getNonce, j as extractSessionId, k as DEFAULT_PII_FIELDS, l as fetchAndStoreNonces, o as SDK_API_CORE_VERSION, s as getChainFromVerifiedCredentialChain, t as InvalidParamError, u as createApiClient, v as MfaInvalidOtpError, w as assertDefined, x as APIError, y as LinkCredentialError, z as BaseError } from "./InvalidParamError-BPMi0iWC.esm.js";
|
|
2
|
+
import { A as GENERATE_SESSION_KEYS_TRACKER_KEY, B as createStorage, C as createKeychainService, D as CannotTrackError, F as getBuffer, G as subscribeWithSelector, H as createLocalStorageAdapter, I as __logoutWithReason_wrapped, K as isEqualShallow, L as generateSessionKeys, M as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, N as REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY, O as createDeferredPromise, P as isServerSideRendering, R as fetchProjectSettings, S as createRealtimeService, T as createCrossTabBroadcast, U as isSignedIn, W as retryOnFail, _ as isCaptchaRequired, a as verifyMessageSignatureOwnership, b as NoNetworkProvidersError, c as formatSignInMessage, d as updateWalletProviderKeysForVerifiedCredentials, f as setUnverifiedWalletAccounts, g as consumeCaptchaToken, h as __setCaptchaToken_wrapped, i as getNetworksData, j as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, k as FETCH_PROJECT_SETTINGS_TRACKER_KEY, l as getAppMetadata, m as hasExtension, o as removeUnverifiedWalletAccount, p as createVisit, s as createSignInMessageStatement, t as getNetworkProviderFromNetworkId, u as reconcileWalletAccountsAgainstClient, v as MethodNotImplementedError, w as createLogger, x as getKeychainIndexedDBName, y as WalletAlreadyLinkedToAnotherUserError, z as createStorageKeySchema } from "./getNetworkProviderFromNetworkId-CEeFL-gV.esm.js";
|
|
3
|
+
import { A as onceEvent, C as formatWalletAccountId, D as emitEvent, O as offEvent, T as splitWalletProviderKey, _ as getWalletProviderRegistry, a as parseElevatedAccessToken, b as getWalletAccounts, d as isUserMissingMfaAuth, f as checkAndRaiseWalletAccountsChangedEvent, g as WalletProviderPriority, h as getWalletProviderFromWalletAccount, i as upsertElevatedAccessToken, k as onEvent, n as getWalletProviderByKey, o as restoreUserSharesForAllWalletAccounts, r as updateAuthFromVerifyResponse, t as getVerifiedCredentialForWalletAccount, u as getWalletProviders, w as normalizeAddress, y as NoWalletProviderFoundError } from "./getVerifiedCredentialForWalletAccount-DzwIoeHm.esm.js";
|
|
4
|
+
import { n as __refreshAuth_wrapped, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-Cntietge.esm.js";
|
|
5
|
+
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-D9p_du8C.esm.js";
|
|
6
6
|
import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
|
|
7
7
|
import { AuthModeEnum, ExchangeKeyEnum, JwtVerifiedCredentialFormatEnum, MFAAction, MfaBackupCodeAcknowledgement, ProviderEnum, TokenScope, WaasBackupOptionsEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
8
8
|
import * as z from "zod/mini";
|
|
@@ -25,6 +25,36 @@ const stateChangeEvents = {
|
|
|
25
25
|
user: "userChanged"
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/utils/appendConnectionUriToDeeplink/appendConnectionUriToDeeplink.ts
|
|
30
|
+
/**
|
|
31
|
+
* Appends a wallet connection URI to a deeplink URL.
|
|
32
|
+
*
|
|
33
|
+
* Generic across URI-deeplink connection options — works for both
|
|
34
|
+
* WalletConnect pairing URIs and MetaMask SDK URIs. Determines the
|
|
35
|
+
* appropriate query parameter separator based on whether the deeplink
|
|
36
|
+
* already contains query parameters.
|
|
37
|
+
*
|
|
38
|
+
* @param params.deeplinkUrl - The base deeplink URL (e.g., `walletapp://wc` or `walletapp://wc?param=value`).
|
|
39
|
+
* @param params.connectionUri - The connection URI to append.
|
|
40
|
+
* @returns The deeplink URL with the connection URI appended as a query parameter.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* appendConnectionUriToDeeplink({ deeplinkUrl: 'walletapp://wc', connectionUri: 'wc:123-456' })
|
|
45
|
+
* // Returns: 'walletapp://wc?uri=wc%3A123-456'
|
|
46
|
+
*
|
|
47
|
+
* appendConnectionUriToDeeplink({ deeplinkUrl: 'walletapp://wc?param=value', connectionUri: 'wc:123-456' })
|
|
48
|
+
* // Returns: 'walletapp://wc?param=value&uri=wc%3A123-456'
|
|
49
|
+
* ```
|
|
50
|
+
* @not-instrumented
|
|
51
|
+
*/
|
|
52
|
+
const appendConnectionUriToDeeplink = ({ connectionUri, deeplinkUrl }) => {
|
|
53
|
+
const url = new URL(deeplinkUrl);
|
|
54
|
+
url.searchParams.set("uri", connectionUri);
|
|
55
|
+
return url.href;
|
|
56
|
+
};
|
|
57
|
+
|
|
28
58
|
//#endregion
|
|
29
59
|
//#region src/utils/getNonce/prefetchNoncesIfNeeded/prefetchNoncesIfNeeded.ts
|
|
30
60
|
/** @not-instrumented */
|
|
@@ -626,10 +656,13 @@ const connectLoggerToInstrumentation = ({ environmentId, extensions, instrumenta
|
|
|
626
656
|
const { token, user } = state.get();
|
|
627
657
|
instrumentation.log({
|
|
628
658
|
environmentId,
|
|
629
|
-
parameters: {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
659
|
+
parameters: scrubParameters({
|
|
660
|
+
piiFields: instrumentation.config.piiFields,
|
|
661
|
+
value: {
|
|
662
|
+
args,
|
|
663
|
+
message
|
|
664
|
+
}
|
|
665
|
+
}),
|
|
633
666
|
registeredExtensionKeys: Array.from(extensions),
|
|
634
667
|
sdkSessionId,
|
|
635
668
|
sdkVersion,
|
|
@@ -1541,6 +1574,7 @@ const __checkStepUpAuth_wrapped = instrumentFunction({
|
|
|
1541
1574
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1542
1575
|
* @returns A promise that resolves to the assertion response containing the elevated access token.
|
|
1543
1576
|
* @instrumented
|
|
1577
|
+
* @redact-params
|
|
1544
1578
|
*/
|
|
1545
1579
|
const requestExternalAuthElevatedToken = async ({ externalJwt }, client = getDefaultClient()) => {
|
|
1546
1580
|
const core = getCore(client);
|
|
@@ -1568,7 +1602,8 @@ const __requestExternalAuthElevatedToken_wrapped = instrumentFunction({
|
|
|
1568
1602
|
} catch {
|
|
1569
1603
|
return;
|
|
1570
1604
|
}
|
|
1571
|
-
}
|
|
1605
|
+
},
|
|
1606
|
+
redactAll: true
|
|
1572
1607
|
});
|
|
1573
1608
|
|
|
1574
1609
|
//#endregion
|
|
@@ -1720,6 +1755,7 @@ const serverRegisterPasskey = async ({ registration, createMfaToken }, client) =
|
|
|
1720
1755
|
* @returns A promise that resolves to the registration response.
|
|
1721
1756
|
* @throws NoWebAuthNSupportError If WebAuthn is not supported by the browser.
|
|
1722
1757
|
* @instrumented
|
|
1758
|
+
* @redact-params
|
|
1723
1759
|
*/
|
|
1724
1760
|
const registerPasskey = async ({ createMfaToken } = {}, client = getDefaultClient()) => {
|
|
1725
1761
|
const core = getCore(client);
|
|
@@ -1742,7 +1778,8 @@ const __registerPasskey_wrapped = instrumentFunction({
|
|
|
1742
1778
|
} catch {
|
|
1743
1779
|
return;
|
|
1744
1780
|
}
|
|
1745
|
-
}
|
|
1781
|
+
},
|
|
1782
|
+
redactAll: true
|
|
1746
1783
|
});
|
|
1747
1784
|
|
|
1748
1785
|
//#endregion
|
|
@@ -1787,6 +1824,7 @@ const serverSigninPasskey = async ({ authentication, createMfaToken }, client) =
|
|
|
1787
1824
|
* @returns A promise that resolves to the authentication response.
|
|
1788
1825
|
* @throws NoWebAuthNSupportError If WebAuthn is not supported by the browser.
|
|
1789
1826
|
* @instrumented
|
|
1827
|
+
* @redact-params
|
|
1790
1828
|
*/
|
|
1791
1829
|
const signInWithPasskey = async ({ relatedOriginRpId } = {}, client = getDefaultClient()) => {
|
|
1792
1830
|
const core = getCore(client);
|
|
@@ -1806,7 +1844,8 @@ const __signInWithPasskey_wrapped = instrumentFunction({
|
|
|
1806
1844
|
} catch {
|
|
1807
1845
|
return;
|
|
1808
1846
|
}
|
|
1809
|
-
}
|
|
1847
|
+
},
|
|
1848
|
+
redactAll: true
|
|
1810
1849
|
});
|
|
1811
1850
|
|
|
1812
1851
|
//#endregion
|
|
@@ -2248,6 +2287,7 @@ const getPrimaryWalletAccount = (client = getDefaultClient()) => {
|
|
|
2248
2287
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2249
2288
|
* @returns A promise that resolves to the verify response.
|
|
2250
2289
|
* @instrumented
|
|
2290
|
+
* @redact-params
|
|
2251
2291
|
*/
|
|
2252
2292
|
const unlinkSocialAccount = async ({ verifiedCredentialId }, client = getDefaultClient()) => {
|
|
2253
2293
|
const core = getCore(client);
|
|
@@ -2273,7 +2313,8 @@ const __unlinkSocialAccount_wrapped = instrumentFunction({
|
|
|
2273
2313
|
} catch {
|
|
2274
2314
|
return;
|
|
2275
2315
|
}
|
|
2276
|
-
}
|
|
2316
|
+
},
|
|
2317
|
+
redactAll: true
|
|
2277
2318
|
});
|
|
2278
2319
|
|
|
2279
2320
|
//#endregion
|
|
@@ -2355,6 +2396,52 @@ const createCheckoutApiClient = async ({ transactionId }, client) => {
|
|
|
2355
2396
|
};
|
|
2356
2397
|
};
|
|
2357
2398
|
|
|
2399
|
+
//#endregion
|
|
2400
|
+
//#region src/modules/checkout/utils/clearCheckoutSessionToken/clearCheckoutSessionToken.ts
|
|
2401
|
+
/**
|
|
2402
|
+
* Removes the locally stored checkout session token for the given transaction.
|
|
2403
|
+
*
|
|
2404
|
+
* The checkout session token is the anonymous credential that authorizes
|
|
2405
|
+
* mutations to a single in-flight checkout transaction. Once the transaction
|
|
2406
|
+
* has reached a terminal state (cancelled, expired, failed, completed) it can
|
|
2407
|
+
* no longer be advanced, and the token is dead weight that should not be
|
|
2408
|
+
* persisted in browser storage — leaving it around lets a later XSS payload
|
|
2409
|
+
* exfiltrate a credential with no further use, and it can also confuse the
|
|
2410
|
+
* SDK on subsequent loads into believing an active session exists.
|
|
2411
|
+
*
|
|
2412
|
+
* The server-side revocation lives in dashboard-api; this is the SDK-side
|
|
2413
|
+
* defense-in-depth.
|
|
2414
|
+
*
|
|
2415
|
+
* @not-instrumented
|
|
2416
|
+
*/
|
|
2417
|
+
const clearCheckoutSessionToken = async ({ transactionId }, client) => {
|
|
2418
|
+
await getCore(client).storage.removeItem(createCheckoutSessionTokenStorageKey(transactionId));
|
|
2419
|
+
};
|
|
2420
|
+
|
|
2421
|
+
//#endregion
|
|
2422
|
+
//#region src/modules/checkout/utils/withCheckoutSessionTokenCleanupOn401/withCheckoutSessionTokenCleanupOn401.ts
|
|
2423
|
+
/**
|
|
2424
|
+
* Checkout mutation routes are guarded server-side only by session-token
|
|
2425
|
+
* validation, so a 401 means the token is dead (revoked, expired, deleted,
|
|
2426
|
+
* or invalid). Leaving a dead token in `localStorage` widens the XSS
|
|
2427
|
+
* exfiltration surface for no benefit and makes the next SDK load attempt
|
|
2428
|
+
* requests that are guaranteed to fail.
|
|
2429
|
+
*
|
|
2430
|
+
* @not-instrumented
|
|
2431
|
+
*/
|
|
2432
|
+
const withCheckoutSessionTokenCleanupOn401 = async ({ call, transactionId }, client) => {
|
|
2433
|
+
try {
|
|
2434
|
+
return await call();
|
|
2435
|
+
} catch (error) {
|
|
2436
|
+
if (error instanceof APIError && error.status === 401) try {
|
|
2437
|
+
await clearCheckoutSessionToken({ transactionId }, client);
|
|
2438
|
+
} catch (cleanupError) {
|
|
2439
|
+
getCore(client).logger.error("Failed to clear checkout session token after 401", cleanupError);
|
|
2440
|
+
}
|
|
2441
|
+
throw error;
|
|
2442
|
+
}
|
|
2443
|
+
};
|
|
2444
|
+
|
|
2358
2445
|
//#endregion
|
|
2359
2446
|
//#region src/modules/checkout/attachCheckoutTransactionSource/attachCheckoutTransactionSource.ts
|
|
2360
2447
|
/**
|
|
@@ -2379,12 +2466,15 @@ const attachCheckoutTransactionSource = async (params, client = getDefaultClient
|
|
|
2379
2466
|
attachSourceRequest.fromChainId = params.fromChainId;
|
|
2380
2467
|
attachSourceRequest.fromChainName = params.fromChainName;
|
|
2381
2468
|
}
|
|
2382
|
-
return
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2469
|
+
return withCheckoutSessionTokenCleanupOn401({
|
|
2470
|
+
call: () => apiClient.attachSource({
|
|
2471
|
+
attachSourceRequest,
|
|
2472
|
+
environmentId,
|
|
2473
|
+
transactionId,
|
|
2474
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
2475
|
+
}),
|
|
2476
|
+
transactionId
|
|
2477
|
+
}, client);
|
|
2388
2478
|
};
|
|
2389
2479
|
const __attachCheckoutTransactionSource_impl = attachCheckoutTransactionSource;
|
|
2390
2480
|
const __attachCheckoutTransactionSource_wrapped = instrumentFunction({
|
|
@@ -2415,12 +2505,15 @@ const __attachCheckoutTransactionSource_wrapped = instrumentFunction({
|
|
|
2415
2505
|
*/
|
|
2416
2506
|
const broadcastCheckoutTransaction = async ({ transactionId, txHash }, client = getDefaultClient()) => {
|
|
2417
2507
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
2418
|
-
return
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2508
|
+
return withCheckoutSessionTokenCleanupOn401({
|
|
2509
|
+
call: () => apiClient.recordCheckoutBroadcast({
|
|
2510
|
+
environmentId,
|
|
2511
|
+
recordBroadcastRequest: { txHash },
|
|
2512
|
+
transactionId,
|
|
2513
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
2514
|
+
}),
|
|
2515
|
+
transactionId
|
|
2516
|
+
}, client);
|
|
2424
2517
|
};
|
|
2425
2518
|
const __broadcastCheckoutTransaction_impl = broadcastCheckoutTransaction;
|
|
2426
2519
|
const __broadcastCheckoutTransaction_wrapped = instrumentFunction({
|
|
@@ -2447,12 +2540,15 @@ const __broadcastCheckoutTransaction_wrapped = instrumentFunction({
|
|
|
2447
2540
|
*/
|
|
2448
2541
|
const cancelCheckoutTransaction = async ({ transactionId }, client = getDefaultClient()) => {
|
|
2449
2542
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
2450
|
-
const result = await
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2543
|
+
const result = await withCheckoutSessionTokenCleanupOn401({
|
|
2544
|
+
call: () => apiClient.cancelCheckoutTransaction({
|
|
2545
|
+
environmentId,
|
|
2546
|
+
transactionId,
|
|
2547
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
2548
|
+
}),
|
|
2549
|
+
transactionId
|
|
2550
|
+
}, client);
|
|
2551
|
+
await clearCheckoutSessionToken({ transactionId }, client);
|
|
2456
2552
|
return result;
|
|
2457
2553
|
};
|
|
2458
2554
|
const __cancelCheckoutTransaction_impl = cancelCheckoutTransaction;
|
|
@@ -2553,16 +2649,19 @@ const getCheckoutTransaction = async ({ transactionId }, client = getDefaultClie
|
|
|
2553
2649
|
*/
|
|
2554
2650
|
const getCheckoutTransactionQuote = async ({ fromChainId, fromTokenAddress, slippage, transactionId }, client = getDefaultClient()) => {
|
|
2555
2651
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
2556
|
-
return
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2652
|
+
return withCheckoutSessionTokenCleanupOn401({
|
|
2653
|
+
call: () => apiClient.quoteCheckoutTransaction({
|
|
2654
|
+
environmentId,
|
|
2655
|
+
quoteRequest: {
|
|
2656
|
+
fromChainId,
|
|
2657
|
+
fromTokenAddress,
|
|
2658
|
+
slippage
|
|
2659
|
+
},
|
|
2660
|
+
transactionId,
|
|
2661
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
2662
|
+
}),
|
|
2663
|
+
transactionId
|
|
2664
|
+
}, client);
|
|
2566
2665
|
};
|
|
2567
2666
|
|
|
2568
2667
|
//#endregion
|
|
@@ -2579,15 +2678,18 @@ const getCheckoutTransactionQuote = async ({ fromChainId, fromTokenAddress, slip
|
|
|
2579
2678
|
*/
|
|
2580
2679
|
const prepareCheckoutTransaction = async ({ assertBalanceForGasCost, assertBalanceForTransferAmount, transactionId }, client = getDefaultClient()) => {
|
|
2581
2680
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
2582
|
-
return
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2681
|
+
return withCheckoutSessionTokenCleanupOn401({
|
|
2682
|
+
call: () => apiClient.prepareCheckoutTransaction({
|
|
2683
|
+
environmentId,
|
|
2684
|
+
prepareSigningRequest: {
|
|
2685
|
+
assertBalanceForGasCost: assertBalanceForGasCost ?? false,
|
|
2686
|
+
assertBalanceForTransferAmount: assertBalanceForTransferAmount ?? false
|
|
2687
|
+
},
|
|
2688
|
+
transactionId,
|
|
2689
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
2690
|
+
}),
|
|
2691
|
+
transactionId
|
|
2692
|
+
}, client);
|
|
2591
2693
|
};
|
|
2592
2694
|
const __prepareCheckoutTransaction_impl = prepareCheckoutTransaction;
|
|
2593
2695
|
const __prepareCheckoutTransaction_wrapped = instrumentFunction({
|
|
@@ -3838,7 +3940,7 @@ const getWalletConnectCatalogWalletByWalletProviderKey = async ({ walletProvider
|
|
|
3838
3940
|
//#region src/modules/walletOptionsCatalogue/resolveWalletBookWalletOptionKey/resolveWalletBookWalletOptionKey.ts
|
|
3839
3941
|
/**
|
|
3840
3942
|
* Resolves which wallet option (group) a wallet book entry belongs to. Used
|
|
3841
|
-
* by the catalogue's wallet-book-driven transformers (
|
|
3943
|
+
* by the catalogue's wallet-book-driven transformers (URI deeplink,
|
|
3842
3944
|
* `inAppBrowser`, `installation`) to bucket their emitted options.
|
|
3843
3945
|
*
|
|
3844
3946
|
* Wallet book entries inconsistently use `group` / `chainGroup` /
|
|
@@ -3993,30 +4095,50 @@ const buildInstallationUrlsByWalletOptionKey = ({ walletBook }) => {
|
|
|
3993
4095
|
};
|
|
3994
4096
|
|
|
3995
4097
|
//#endregion
|
|
3996
|
-
//#region src/modules/walletOptionsCatalogue/
|
|
4098
|
+
//#region src/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/resolveUriConnectionType.ts
|
|
4099
|
+
/**
|
|
4100
|
+
* Picks the connection-option `type` discriminator for a wallet-book-
|
|
4101
|
+
* derived URI deeplink option. MetaMask is steered toward its own
|
|
4102
|
+
* MetaMask SDK URI connection extension (`metamaskSdkUri`) so we route
|
|
4103
|
+
* customers off generic WalletConnect for that wallet; every other
|
|
4104
|
+
* wallet uses the standard `walletConnect` discriminator.
|
|
4105
|
+
*
|
|
4106
|
+
* @param params.walletOptionKey - The resolved wallet option key.
|
|
4107
|
+
* @returns The connection-option discriminator to emit.
|
|
4108
|
+
* @not-instrumented
|
|
4109
|
+
*/
|
|
4110
|
+
const resolveUriConnectionType = ({ walletOptionKey }) => walletOptionKey === "metamask" ? "metamaskSdkUri" : "walletConnect";
|
|
4111
|
+
|
|
4112
|
+
//#endregion
|
|
4113
|
+
//#region src/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/buildUriDeeplinkOptions.ts
|
|
3997
4114
|
/**
|
|
3998
|
-
* A wallet only deserves a
|
|
3999
|
-
* least one mobile deeplink — that's the value-add the option provides
|
|
4000
|
-
* the bare
|
|
4001
|
-
* expose a deeplink (rare, but present) are silently skipped.
|
|
4115
|
+
* A wallet only deserves a URI-deeplink catalogue option if it has at
|
|
4116
|
+
* least one mobile deeplink — that's the value-add the option provides
|
|
4117
|
+
* over the bare pairing URI. Wallets that exist in the wallet book but
|
|
4118
|
+
* don't expose a deeplink (rare, but present) are silently skipped.
|
|
4002
4119
|
*/
|
|
4003
4120
|
const hasUsableDeeplink = ({ wallet }) => Boolean(wallet.mobile?.native || wallet.mobile?.universal);
|
|
4004
4121
|
/**
|
|
4005
|
-
* Builds the
|
|
4122
|
+
* Builds the URI-deeplink catalogue options from a fetched wallet book.
|
|
4006
4123
|
* Applies the WalletConnect-specific eligibility filter
|
|
4007
4124
|
* (`shouldFilterWalletForWalletConnect`) so embedded wallets and entries
|
|
4008
4125
|
* without `sign_v2` support are excluded — same surface as
|
|
4009
4126
|
* `getWalletConnectCatalog`.
|
|
4010
4127
|
*
|
|
4011
4128
|
* Each emitted option carries the wallet's mobile deeplinks. Customers
|
|
4012
|
-
* combine these with their chain's
|
|
4013
|
-
* `
|
|
4129
|
+
* combine these with their chain's connection URI via
|
|
4130
|
+
* `appendConnectionUriToDeeplink` to open the wallet's app:
|
|
4131
|
+
*
|
|
4132
|
+
* - `'walletConnect'`: mint via `connectWithWalletConnect<Chain>`.
|
|
4133
|
+
* - `'metamaskSdkUri'`: mint via `connectWithMetaMaskUriEvm` or
|
|
4134
|
+
* `connectWithMetaMaskUriSolana`. Emitted only for the MetaMask
|
|
4135
|
+
* wallet entry — see `resolveUriConnectionType`.
|
|
4014
4136
|
*
|
|
4015
4137
|
* @param params.walletBook - The fetched wallet book.
|
|
4016
|
-
* @returns Tagged
|
|
4138
|
+
* @returns Tagged options paired with their wallet option keys.
|
|
4017
4139
|
* @not-instrumented
|
|
4018
4140
|
*/
|
|
4019
|
-
const
|
|
4141
|
+
const buildUriDeeplinkOptions = ({ walletBook }) => {
|
|
4020
4142
|
const result = [];
|
|
4021
4143
|
for (const [walletKey, wallet] of Object.entries(walletBook.wallets)) {
|
|
4022
4144
|
if (shouldFilterWalletForWalletConnect({
|
|
@@ -4039,7 +4161,7 @@ const buildWalletConnectOptions = ({ walletBook }) => {
|
|
|
4039
4161
|
native: wallet.mobile?.native,
|
|
4040
4162
|
universal: wallet.mobile?.universal
|
|
4041
4163
|
},
|
|
4042
|
-
type:
|
|
4164
|
+
type: resolveUriConnectionType({ walletOptionKey })
|
|
4043
4165
|
},
|
|
4044
4166
|
walletOptionKey
|
|
4045
4167
|
});
|
|
@@ -4380,10 +4502,11 @@ const groupOptionsByWalletOption = ({ options }) => {
|
|
|
4380
4502
|
* wallet-option list is ordered — that's controlled by
|
|
4381
4503
|
* `WalletOptionOrdering`.
|
|
4382
4504
|
*
|
|
4383
|
-
* `withWalletProvider > walletConnect > inAppBrowser`
|
|
4505
|
+
* `withWalletProvider > walletConnect / metamaskSdkUri > inAppBrowser`
|
|
4384
4506
|
*/
|
|
4385
4507
|
const CONNECTION_OPTION_PRIORITY = {
|
|
4386
4508
|
inAppBrowser: 2,
|
|
4509
|
+
metamaskSdkUri: 1,
|
|
4387
4510
|
walletConnect: 1,
|
|
4388
4511
|
withWalletProvider: 0
|
|
4389
4512
|
};
|
|
@@ -4402,7 +4525,7 @@ const getConnectionOptionPriority = ({ option }) => CONNECTION_OPTION_PRIORITY[o
|
|
|
4402
4525
|
/**
|
|
4403
4526
|
* Sorts a wallet option's `connectionOptions` so the most preferred option lands at
|
|
4404
4527
|
* index 0. Primary sort is by option-type priority
|
|
4405
|
-
* (`withWalletProvider` >
|
|
4528
|
+
* (`withWalletProvider` > URI deeplink > `inAppBrowser`);
|
|
4406
4529
|
* within a type, ties break alphabetically by `chain` for deterministic
|
|
4407
4530
|
* output across calls.
|
|
4408
4531
|
*
|
|
@@ -4526,7 +4649,7 @@ const hasInstalledProvider = ({ walletOption }) => walletOption.connectionOption
|
|
|
4526
4649
|
* this order:
|
|
4527
4650
|
* 1. **Installed provider** — user already has the wallet available
|
|
4528
4651
|
* (`withWalletProvider` at index 0).
|
|
4529
|
-
* 2. **Connectable** — has at least one connection (
|
|
4652
|
+
* 2. **Connectable** — has at least one connection (URI deeplink
|
|
4530
4653
|
* or `inAppBrowser`) but no installed provider.
|
|
4531
4654
|
* 3. **Install-only** — no connection at all; only `installationUrls`.
|
|
4532
4655
|
* Within each tier, rank by the hand-curated {@link PRIORITY_WALLET_KEYS}
|
|
@@ -4576,45 +4699,28 @@ const EMPTY_WALLET_BOOK = {
|
|
|
4576
4699
|
wallets: {}
|
|
4577
4700
|
};
|
|
4578
4701
|
/**
|
|
4579
|
-
* Returns
|
|
4580
|
-
* with through this client.
|
|
4581
|
-
* `
|
|
4582
|
-
*
|
|
4583
|
-
* any matching connections are omitted.
|
|
4584
|
-
*
|
|
4585
|
-
* `includeWithWalletProvider` defaults to `true`; all other inclusion flags
|
|
4586
|
-
* are opt-in. `walletOptionOrdering` defaults to `'relevance'` (Dynamic's
|
|
4587
|
-
* recommended order); pass `'alphabetical'` to sort by wallet option name
|
|
4588
|
-
* within each option-priority tier.
|
|
4702
|
+
* Returns the catalogue of external wallet options a user can sign in
|
|
4703
|
+
* with through this client. Always includes installed wallet providers;
|
|
4704
|
+
* pass `includeMobileOptions: true` to additionally surface
|
|
4705
|
+
* WalletConnect, in-app-browser, and install links.
|
|
4589
4706
|
*
|
|
4590
|
-
*
|
|
4591
|
-
* (`includeWalletConnect`, `includeInAppBrowser`). Calls that only need
|
|
4592
|
-
* `includeWithWalletProvider` skip the fetch entirely.
|
|
4593
|
-
*
|
|
4594
|
-
* @param [params] - Inclusion flags + ordering preference.
|
|
4707
|
+
* @param [params] - Inclusion flag + ordering preference.
|
|
4595
4708
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4596
4709
|
* @returns A promise that resolves to the wallet options catalogue.
|
|
4597
4710
|
* @not-instrumented
|
|
4598
4711
|
*/
|
|
4599
4712
|
const getWalletOptionsCatalogue = async (params = {}, client = getDefaultClient()) => {
|
|
4600
|
-
const
|
|
4601
|
-
const includeWalletConnect = params.includeWalletConnect ?? false;
|
|
4602
|
-
const includeInAppBrowser = params.includeInAppBrowser ?? false;
|
|
4603
|
-
const includeInstallation = params.includeInstallation ?? false;
|
|
4713
|
+
const includeMobileOptions = params.includeMobileOptions ?? false;
|
|
4604
4714
|
const walletOptionOrdering = params.walletOptionOrdering ?? "relevance";
|
|
4605
|
-
|
|
4606
|
-
const walletBook = includeWalletConnect || includeInAppBrowser || includeInstallation ? await fetchLegacyWalletBook(client) : EMPTY_WALLET_BOOK;
|
|
4715
|
+
const walletBook = includeMobileOptions ? await fetchLegacyWalletBook(client) : EMPTY_WALLET_BOOK;
|
|
4607
4716
|
const allConnectionOptions = [];
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
}
|
|
4615
|
-
if (includeWalletConnect) allConnectionOptions.push(...buildWalletConnectOptions({ walletBook }));
|
|
4616
|
-
if (includeInAppBrowser) allConnectionOptions.push(...buildInAppBrowserOptions({ walletBook }));
|
|
4617
|
-
const installationUrlsByKey = includeInstallation ? buildInstallationUrlsByWalletOptionKey({ walletBook }) : /* @__PURE__ */ new Map();
|
|
4717
|
+
const entries = getWalletProviderRegistry(client).listProviderEntries();
|
|
4718
|
+
allConnectionOptions.push(...buildWithWalletProviderOptions({
|
|
4719
|
+
entries,
|
|
4720
|
+
walletBook
|
|
4721
|
+
}, client));
|
|
4722
|
+
if (includeMobileOptions) allConnectionOptions.push(...buildUriDeeplinkOptions({ walletBook }), ...buildInAppBrowserOptions({ walletBook }));
|
|
4723
|
+
const installationUrlsByKey = includeMobileOptions ? buildInstallationUrlsByWalletOptionKey({ walletBook }) : /* @__PURE__ */ new Map();
|
|
4618
4724
|
const grouped = groupOptionsByWalletOption({ options: allConnectionOptions });
|
|
4619
4725
|
const allWalletOptionKeys = new Set([...grouped.keys(), ...installationUrlsByKey.keys()]);
|
|
4620
4726
|
const walletOptions = [];
|
|
@@ -4894,6 +5000,7 @@ const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions
|
|
|
4894
5000
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4895
5001
|
* @returns A promise that resolves to the newly generated recovery codes.
|
|
4896
5002
|
* @instrumented
|
|
5003
|
+
* @redact-params
|
|
4897
5004
|
*/
|
|
4898
5005
|
const createNewMfaRecoveryCodes = async (client = getDefaultClient()) => {
|
|
4899
5006
|
const core = getCore(client);
|
|
@@ -4909,7 +5016,8 @@ const __createNewMfaRecoveryCodes_wrapped = instrumentFunction({
|
|
|
4909
5016
|
} catch {
|
|
4910
5017
|
return;
|
|
4911
5018
|
}
|
|
4912
|
-
}
|
|
5019
|
+
},
|
|
5020
|
+
redactAll: true
|
|
4913
5021
|
});
|
|
4914
5022
|
|
|
4915
5023
|
//#endregion
|
|
@@ -6136,6 +6244,7 @@ const verifyOTPForUserUpdate = async ({ otpVerification, verificationToken, requ
|
|
|
6136
6244
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6137
6245
|
* @returns A promise that resolves to the verify response object upon successful verification.
|
|
6138
6246
|
* @instrumented
|
|
6247
|
+
* @redact-params
|
|
6139
6248
|
*/
|
|
6140
6249
|
const verifyOTP = async ({ otpVerification, verificationToken, requestedScopes }, client = getDefaultClient()) => {
|
|
6141
6250
|
let response;
|
|
@@ -6161,7 +6270,8 @@ const __verifyOTP_wrapped = instrumentFunction({
|
|
|
6161
6270
|
} catch {
|
|
6162
6271
|
return;
|
|
6163
6272
|
}
|
|
6164
|
-
}
|
|
6273
|
+
},
|
|
6274
|
+
redactAll: true
|
|
6165
6275
|
});
|
|
6166
6276
|
|
|
6167
6277
|
//#endregion
|
|
@@ -6585,13 +6695,12 @@ const getAddressesWithTypesFromConnectionResult = (connectionResult) => {
|
|
|
6585
6695
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6586
6696
|
* @returns A promise that resolves to the connected wallet account.
|
|
6587
6697
|
* @throws NoAddressFoundError If the request to connect was successful but no address is connected to your app.
|
|
6588
|
-
*
|
|
6698
|
+
* @instrumented
|
|
6589
6699
|
*/
|
|
6590
6700
|
const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWalletAccounts = true, hardwareWalletVendor }, client = getDefaultClient()) => {
|
|
6591
6701
|
const walletProvider = getWalletProviderByKey({ walletProviderKey }, client);
|
|
6592
6702
|
assertWalletProviderMethodDefined(walletProvider, "connect");
|
|
6593
6703
|
const { addresses } = await walletProvider.connect();
|
|
6594
|
-
const currentAddresses = getWalletAccounts(client).map(({ address }) => address);
|
|
6595
6704
|
const mainAddress = addresses?.length ? addresses[0].address : null;
|
|
6596
6705
|
/**
|
|
6597
6706
|
* This error is thrown in case the wallet has no addresses connected
|
|
@@ -6599,27 +6708,25 @@ const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWallet
|
|
|
6599
6708
|
* user on the next steps.
|
|
6600
6709
|
*/
|
|
6601
6710
|
if (!mainAddress) throw new NoAddressFoundError();
|
|
6602
|
-
const
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
chain: walletProvider.chain,
|
|
6606
|
-
hardwareWalletVendor,
|
|
6607
|
-
id: formatWalletAccountId({
|
|
6711
|
+
const [reconciledWalletAccount] = reconcileWalletAccountsAgainstClient({
|
|
6712
|
+
addToDynamicWalletAccounts,
|
|
6713
|
+
walletAccounts: [{
|
|
6608
6714
|
address: mainAddress,
|
|
6715
|
+
addressesWithTypes: getAddressesWithTypesFromConnectionResult({ addresses }),
|
|
6609
6716
|
chain: walletProvider.chain,
|
|
6717
|
+
hardwareWalletVendor,
|
|
6718
|
+
id: formatWalletAccountId({
|
|
6719
|
+
address: mainAddress,
|
|
6720
|
+
chain: walletProvider.chain,
|
|
6721
|
+
walletProviderKey
|
|
6722
|
+
}),
|
|
6723
|
+
lastSelectedAt: null,
|
|
6724
|
+
verifiedCredentialId: null,
|
|
6610
6725
|
walletProviderKey
|
|
6611
|
-
}
|
|
6612
|
-
lastSelectedAt: null,
|
|
6613
|
-
verifiedCredentialId: null,
|
|
6726
|
+
}],
|
|
6614
6727
|
walletProviderKey
|
|
6615
|
-
};
|
|
6616
|
-
|
|
6617
|
-
if (addToDynamicWalletAccounts) {
|
|
6618
|
-
setUnverifiedWalletAccounts({ unverifiedWalletAccountsToUpdate: [walletAccount] }, client);
|
|
6619
|
-
emitWalletAccountsChangedEvent(client);
|
|
6620
|
-
createVisit({ walletAccount }, client);
|
|
6621
|
-
}
|
|
6622
|
-
return walletAccount;
|
|
6728
|
+
}, client);
|
|
6729
|
+
return reconciledWalletAccount;
|
|
6623
6730
|
};
|
|
6624
6731
|
const __connectWithWalletProvider_impl = connectWithWalletProvider;
|
|
6625
6732
|
const __connectWithWalletProvider_wrapped = instrumentFunction({
|
|
@@ -7550,5 +7657,5 @@ const parseUserAgent = ({ userAgent }) => {
|
|
|
7550
7657
|
assertPackageVersion(name, version);
|
|
7551
7658
|
|
|
7552
7659
|
//#endregion
|
|
7553
|
-
export { BaseError, CheckoutSessionTokenMissingError, ClientAlreadyInitializedError, DeeplinkConnectAndVerifyUnsupportedError, FeeEstimationFailedError, GOOGLE_DRIVE_BACKUP_REQUIRED_SCOPES, InvalidDeviceRegistrationRedirectError, InvalidExternalAuthError, InvalidParamError, InvalidRedirectStorageStateError, InvalidSocialCallbackOriginError, LinkCredentialError, MFAAction, MfaInvalidOtpError, MfaRateLimitedError, MissingRedirectStorageStateError, MissingSocialUrlParamError, MissingUserVerificationError, NetworkAddingUnavailableError, NetworkNotAddedError, NetworkSwitchingUnavailableError, NoAddressFoundError, NoNetworkProvidersError, NoPasskeyCredentialsFoundError, NoSmartWalletAccountSignerFoundError, NoWebAuthNSupportError, NotWaasWalletAccountError, SandboxMaximumThresholdReachedError, SimulationFailedError, TokenSwapError, UnauthorizedError, UnavailableInServerSideError, UnrecognizedNetworkError, UserCancelledSocialPopUpError, UserNotAuthenticatedError, UserRejectedError, WalletAccountAlreadyVerifiedError, WalletAccountNotSelectedError, WalletAlreadyLinkedToAnotherUserError, WalletProviderMethodUnavailableError, __acknowledgeRecoveryCodes_wrapped as acknowledgeRecoveryCodes, addCoinbaseOnrampOrderEventListener, __addNetwork_wrapped as addNetwork, assertWalletAccountSigningAvailability, assertWalletProviderMethodDefined, __attachCheckoutTransactionSource_wrapped as attachCheckoutTransactionSource, authenticateMfaRecoveryCode, authenticatePasskeyMFA, authenticateTotpMfaDevice, __authenticateWithSocial_wrapped as authenticateWithSocial, __broadcastCheckoutTransaction_wrapped as broadcastCheckoutTransaction, canConnectWithHardwareWallet, __cancelCheckoutTransaction_wrapped as cancelCheckoutTransaction, __checkStepUpAuth_wrapped as checkStepUpAuth, __completeDeviceRegistration_wrapped as completeDeviceRegistration, __completeSocialAuthentication_wrapped as completeSocialAuthentication, __completeSocialRedirect_wrapped as completeSocialRedirect, __confirmTransaction_wrapped as confirmTransaction, __connectAndVerifyWithWalletProvider_wrapped as connectAndVerifyWithWalletProvider, __connectWithWalletProvider_wrapped as connectWithWalletProvider, __consumeMfaToken_wrapped as consumeMfaToken, __createCheckoutTransaction_wrapped as createCheckoutTransaction, __createCoinbaseOnrampOrder_wrapped as createCoinbaseOnrampOrder, __createCryptoDotComPayment_wrapped as createCryptoDotComPayment, __createDynamicClient_wrapped as createDynamicClient, __createKrakenExchangeTransfer_wrapped as createKrakenExchangeTransfer, __createNewMfaRecoveryCodes_wrapped as createNewMfaRecoveryCodes, __deleteMfaDevice_wrapped as deleteMfaDevice, __deletePasskey_wrapped as deletePasskey, __deleteUser_wrapped as deleteUser, detectDeviceRegistrationRedirect, detectOAuthRedirect, detectSocialRedirectUrl, excludeInstalledFromCatalog, __executeSwapTransaction_wrapped as executeSwapTransaction, fetchProjectSettings, findMissingGoogleDriveBackupScopes, getActiveNetworkData, getActiveNetworkId, getAvailableWalletProvidersData, getBalance, getBalanceForAddress, getBalances, getCheckoutTransaction, getCheckoutTransactionQuote, getCoinbaseBuyUrl, getConnectedAddresses, getDefaultClient, getDeviceRegistrationTokenFromUrl, __getElevatedAccessToken_wrapped as getElevatedAccessToken, __getGoogleDriveBackupReadiness_wrapped as getGoogleDriveBackupReadiness, getKrakenAccounts, getKrakenWhitelistedAddresses, getMfaDevices, getMfaMethods, getMfaRecoveryCodes, getMissingVerificationForCoinbaseOnrampOrder, getMultichainBalances, getNetworksData, getOwnerWalletAccountForSmartWalletAccount, getPasskeys, getPrimaryWalletAccount, getRegisteredDevices, getSwapQuote, getSwapStatus, getTransactionHistory, getUserSocialAccounts, getWalletAccountAddressByType, getWalletAccountFromAddress, getWalletAccounts, getWalletConnectCatalog, getWalletConnectCatalogWalletByWalletProviderKey, getWalletOptionsCatalogue, getWalletProviderDataByKey, hasAllGoogleDriveBackupScopes, hasExtension, __initializeClient_wrapped as initializeClient, isCaptchaRequired, isDeeplinkWalletProvider, isDeviceRegistrationRequired, isHardwareWalletAccount, isInsufficientGoogleDriveScopesError, isMfaRequiredForAction, isMobile, isPendingRecoveryCodesAcknowledgment, isProgrammaticNetworkSwitchAvailable, isSignedIn, isUserMissingMfaAuth, isUserOnboardingComplete, isWalletAccountVerified, logout, matchWalletProvidersToCatalogGroup, offEvent, offWalletProviderEvent, onEvent, onWalletProviderEvent, onceEvent, parseUserAgent, __prepareCheckoutTransaction_wrapped as prepareCheckoutTransaction, __proveWalletAccountOwnership_wrapped as proveWalletAccountOwnership, __refreshAuth_wrapped as refreshAuth, __refreshUser_wrapped as refreshUser, __registerPasskey_wrapped as registerPasskey, __registerTotpMfaDevice_wrapped as registerTotpMfaDevice, __removeWalletAccount_wrapped as removeWalletAccount, __requestExternalAuthElevatedToken_wrapped as requestExternalAuthElevatedToken, requiresConversion, __revokeAllRegisteredDevices_wrapped as revokeAllRegisteredDevices, __revokeRegisteredDevice_wrapped as revokeRegisteredDevice, __selectPrimaryWalletAccount_wrapped as selectPrimaryWalletAccount, __sendEmailOTP_wrapped as sendEmailOTP, __sendSmsOTP_wrapped as sendSmsOTP, __setCaptchaToken_wrapped as setCaptchaToken, __setDefaultMfaDevice_wrapped as setDefaultMfaDevice, __setInstrumentationEnabled_wrapped as setInstrumentationEnabled, __signInWithExternalJwt_wrapped as signInWithExternalJwt, __signInWithPasskey_wrapped as signInWithPasskey, __signInWithSocialPopUp_wrapped as signInWithSocialPopUp, __signInWithSocialRedirect_wrapped as signInWithSocialRedirect, __signMessage_wrapped as signMessage, __submitCheckoutTransaction_wrapped as submitCheckoutTransaction, supportedCountries, __switchActiveNetwork_wrapped as switchActiveNetwork, trackCheckoutTransaction, __transferAmount_wrapped as transferAmount, __transferWalletAccount_wrapped as transferWalletAccount, __unlinkSocialAccount_wrapped as unlinkSocialAccount, __updateUser_wrapped as updateUser, __verifyOTP_wrapped as verifyOTP, __verifyWalletAccount_wrapped as verifyWalletAccount, waitForClientInitialized };
|
|
7660
|
+
export { BaseError, CheckoutSessionTokenMissingError, ClientAlreadyInitializedError, DeeplinkConnectAndVerifyUnsupportedError, FeeEstimationFailedError, GOOGLE_DRIVE_BACKUP_REQUIRED_SCOPES, InvalidDeviceRegistrationRedirectError, InvalidExternalAuthError, InvalidParamError, InvalidRedirectStorageStateError, InvalidSocialCallbackOriginError, LinkCredentialError, MFAAction, MfaInvalidOtpError, MfaRateLimitedError, MissingRedirectStorageStateError, MissingSocialUrlParamError, MissingUserVerificationError, NetworkAddingUnavailableError, NetworkNotAddedError, NetworkSwitchingUnavailableError, NoAddressFoundError, NoNetworkProvidersError, NoPasskeyCredentialsFoundError, NoSmartWalletAccountSignerFoundError, NoWebAuthNSupportError, NotWaasWalletAccountError, SandboxMaximumThresholdReachedError, SimulationFailedError, TokenSwapError, UnauthorizedError, UnavailableInServerSideError, UnrecognizedNetworkError, UserCancelledSocialPopUpError, UserNotAuthenticatedError, UserRejectedError, WalletAccountAlreadyVerifiedError, WalletAccountNotSelectedError, WalletAlreadyLinkedToAnotherUserError, WalletProviderMethodUnavailableError, __acknowledgeRecoveryCodes_wrapped as acknowledgeRecoveryCodes, addCoinbaseOnrampOrderEventListener, __addNetwork_wrapped as addNetwork, appendConnectionUriToDeeplink, assertWalletAccountSigningAvailability, assertWalletProviderMethodDefined, __attachCheckoutTransactionSource_wrapped as attachCheckoutTransactionSource, authenticateMfaRecoveryCode, authenticatePasskeyMFA, authenticateTotpMfaDevice, __authenticateWithSocial_wrapped as authenticateWithSocial, __broadcastCheckoutTransaction_wrapped as broadcastCheckoutTransaction, canConnectWithHardwareWallet, __cancelCheckoutTransaction_wrapped as cancelCheckoutTransaction, __checkStepUpAuth_wrapped as checkStepUpAuth, __completeDeviceRegistration_wrapped as completeDeviceRegistration, __completeSocialAuthentication_wrapped as completeSocialAuthentication, __completeSocialRedirect_wrapped as completeSocialRedirect, __confirmTransaction_wrapped as confirmTransaction, __connectAndVerifyWithWalletProvider_wrapped as connectAndVerifyWithWalletProvider, __connectWithWalletProvider_wrapped as connectWithWalletProvider, __consumeMfaToken_wrapped as consumeMfaToken, __createCheckoutTransaction_wrapped as createCheckoutTransaction, __createCoinbaseOnrampOrder_wrapped as createCoinbaseOnrampOrder, __createCryptoDotComPayment_wrapped as createCryptoDotComPayment, __createDynamicClient_wrapped as createDynamicClient, __createKrakenExchangeTransfer_wrapped as createKrakenExchangeTransfer, __createNewMfaRecoveryCodes_wrapped as createNewMfaRecoveryCodes, __deleteMfaDevice_wrapped as deleteMfaDevice, __deletePasskey_wrapped as deletePasskey, __deleteUser_wrapped as deleteUser, detectDeviceRegistrationRedirect, detectOAuthRedirect, detectSocialRedirectUrl, excludeInstalledFromCatalog, __executeSwapTransaction_wrapped as executeSwapTransaction, fetchProjectSettings, findMissingGoogleDriveBackupScopes, getActiveNetworkData, getActiveNetworkId, getAvailableWalletProvidersData, getBalance, getBalanceForAddress, getBalances, getCheckoutTransaction, getCheckoutTransactionQuote, getCoinbaseBuyUrl, getConnectedAddresses, getDefaultClient, getDeviceRegistrationTokenFromUrl, __getElevatedAccessToken_wrapped as getElevatedAccessToken, __getGoogleDriveBackupReadiness_wrapped as getGoogleDriveBackupReadiness, getKrakenAccounts, getKrakenWhitelistedAddresses, getMfaDevices, getMfaMethods, getMfaRecoveryCodes, getMissingVerificationForCoinbaseOnrampOrder, getMultichainBalances, getNetworksData, getOwnerWalletAccountForSmartWalletAccount, getPasskeys, getPrimaryWalletAccount, getRegisteredDevices, getSwapQuote, getSwapStatus, getTransactionHistory, getUserSocialAccounts, getWalletAccountAddressByType, getWalletAccountFromAddress, getWalletAccounts, getWalletConnectCatalog, getWalletConnectCatalogWalletByWalletProviderKey, getWalletOptionsCatalogue, getWalletProviderDataByKey, hasAllGoogleDriveBackupScopes, hasExtension, __initializeClient_wrapped as initializeClient, isCaptchaRequired, isDeeplinkWalletProvider, isDeviceRegistrationRequired, isHardwareWalletAccount, isInsufficientGoogleDriveScopesError, isMfaRequiredForAction, isMobile, isPendingRecoveryCodesAcknowledgment, isProgrammaticNetworkSwitchAvailable, isSignedIn, isUserMissingMfaAuth, isUserOnboardingComplete, isWalletAccountVerified, logout, matchWalletProvidersToCatalogGroup, offEvent, offWalletProviderEvent, onEvent, onWalletProviderEvent, onceEvent, parseUserAgent, __prepareCheckoutTransaction_wrapped as prepareCheckoutTransaction, __proveWalletAccountOwnership_wrapped as proveWalletAccountOwnership, __refreshAuth_wrapped as refreshAuth, __refreshUser_wrapped as refreshUser, __registerPasskey_wrapped as registerPasskey, __registerTotpMfaDevice_wrapped as registerTotpMfaDevice, __removeWalletAccount_wrapped as removeWalletAccount, __requestExternalAuthElevatedToken_wrapped as requestExternalAuthElevatedToken, requiresConversion, __revokeAllRegisteredDevices_wrapped as revokeAllRegisteredDevices, __revokeRegisteredDevice_wrapped as revokeRegisteredDevice, __selectPrimaryWalletAccount_wrapped as selectPrimaryWalletAccount, __sendEmailOTP_wrapped as sendEmailOTP, __sendSmsOTP_wrapped as sendSmsOTP, __setCaptchaToken_wrapped as setCaptchaToken, __setDefaultMfaDevice_wrapped as setDefaultMfaDevice, __setInstrumentationEnabled_wrapped as setInstrumentationEnabled, __signInWithExternalJwt_wrapped as signInWithExternalJwt, __signInWithPasskey_wrapped as signInWithPasskey, __signInWithSocialPopUp_wrapped as signInWithSocialPopUp, __signInWithSocialRedirect_wrapped as signInWithSocialRedirect, __signMessage_wrapped as signMessage, __submitCheckoutTransaction_wrapped as submitCheckoutTransaction, supportedCountries, __switchActiveNetwork_wrapped as switchActiveNetwork, trackCheckoutTransaction, __transferAmount_wrapped as transferAmount, __transferWalletAccount_wrapped as transferWalletAccount, __unlinkSocialAccount_wrapped as unlinkSocialAccount, __updateUser_wrapped as updateUser, __verifyOTP_wrapped as verifyOTP, __verifyWalletAccount_wrapped as verifyWalletAccount, waitForClientInitialized };
|
|
7554
7661
|
//# sourceMappingURL=index.esm.js.map
|