@dynamic-labs-sdk/client 1.2.1 → 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-uluG140m.esm.js → InvalidParamError-BPMi0iWC.esm.js} +55 -6
- package/dist/InvalidParamError-BPMi0iWC.esm.js.map +1 -0
- package/dist/{InvalidParamError-BYnLW_9s.native.esm.js → InvalidParamError-CDmVW2DS.native.esm.js} +55 -6
- package/dist/InvalidParamError-CDmVW2DS.native.esm.js.map +1 -0
- package/dist/{InvalidParamError-CEykJlaG.cjs → InvalidParamError-DEmLKJKZ.cjs} +61 -6
- package/dist/InvalidParamError-DEmLKJKZ.cjs.map +1 -0
- package/dist/{NotWaasWalletAccountError-BNdbbGX7.cjs → NotWaasWalletAccountError-BZsBHRQe.cjs} +6 -4
- package/dist/NotWaasWalletAccountError-BZsBHRQe.cjs.map +1 -0
- package/dist/{NotWaasWalletAccountError-DmlwWvy0.esm.js → NotWaasWalletAccountError-Chpne8_Q.native.esm.js} +6 -4
- package/dist/NotWaasWalletAccountError-Chpne8_Q.native.esm.js.map +1 -0
- package/dist/{NotWaasWalletAccountError-33QOxTKa.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 +4 -0
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-CS1GXEp6.esm.js → getNetworkProviderFromNetworkId-CEeFL-gV.esm.js} +72 -16
- package/dist/getNetworkProviderFromNetworkId-CEeFL-gV.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-a0atbFHU.native.esm.js → getNetworkProviderFromNetworkId-JGrKwBj7.native.esm.js} +72 -16
- package/dist/getNetworkProviderFromNetworkId-JGrKwBj7.native.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-BOCwNNMm.cjs → getNetworkProviderFromNetworkId-szJOsbQN.cjs} +77 -15
- package/dist/getNetworkProviderFromNetworkId-szJOsbQN.cjs.map +1 -0
- package/dist/{getSignedSessionId-zHtJOVpY.native.esm.js → getSignedSessionId-B5DikCap.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-zHtJOVpY.native.esm.js.map → getSignedSessionId-B5DikCap.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-D1Oh4604.esm.js → getSignedSessionId-BOx1nFt_.esm.js} +3 -3
- package/dist/{getSignedSessionId-D1Oh4604.esm.js.map → getSignedSessionId-BOx1nFt_.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-B42gT4xk.cjs → getSignedSessionId-BxOK-Tdo.cjs} +3 -3
- package/dist/{getSignedSessionId-B42gT4xk.cjs.map → getSignedSessionId-BxOK-Tdo.cjs.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-B-IhZJuM.cjs → getVerifiedCredentialForWalletAccount-B46O0B48.cjs} +4 -3
- package/dist/getVerifiedCredentialForWalletAccount-B46O0B48.cjs.map +1 -0
- package/dist/{getVerifiedCredentialForWalletAccount-CEvtJ3xW.native.esm.js → getVerifiedCredentialForWalletAccount-CyykSi-M.native.esm.js} +3 -2
- package/dist/getVerifiedCredentialForWalletAccount-CyykSi-M.native.esm.js.map +1 -0
- package/dist/{getVerifiedCredentialForWalletAccount-BkaECPL_.esm.js → getVerifiedCredentialForWalletAccount-DzwIoeHm.esm.js} +3 -2
- package/dist/getVerifiedCredentialForWalletAccount-DzwIoeHm.esm.js.map +1 -0
- package/dist/index.cjs +1028 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +1027 -86
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +1027 -86
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-CJvFP4oN.cjs → isMfaRequiredForAction-6N6JB7wa.cjs} +5 -3
- package/dist/isMfaRequiredForAction-6N6JB7wa.cjs.map +1 -0
- package/dist/{isMfaRequiredForAction-G7SXCZ5L.esm.js → isMfaRequiredForAction-D9p_du8C.esm.js} +5 -3
- package/dist/isMfaRequiredForAction-D9p_du8C.esm.js.map +1 -0
- package/dist/{isMfaRequiredForAction-BfabCDxI.native.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/balances/getBalances/getBalances.d.ts +22 -10
- package/dist/modules/balances/getBalances/getBalances.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 +6 -2
- 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/legacyWalletBook/getWalletConnectCatalog/shouldFilterWalletForWalletConnect/index.d.ts +2 -0
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/{shouldFilterWallet → shouldFilterWalletForWalletConnect}/index.d.ts.map +1 -1
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/shouldFilterWalletForWalletConnect/shouldFilterWalletForWalletConnect.d.ts +13 -0
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/shouldFilterWalletForWalletConnect/shouldFilterWalletForWalletConnect.d.ts.map +1 -0
- package/dist/modules/legacyWalletBook/priorityWalletKeys/priorityWalletKeys.d.ts +10 -0
- package/dist/modules/legacyWalletBook/priorityWalletKeys/priorityWalletKeys.d.ts.map +1 -0
- package/dist/modules/legacyWalletBook/shouldFilterWallet/index.d.ts +3 -0
- package/dist/modules/legacyWalletBook/shouldFilterWallet/index.d.ts.map +1 -0
- package/dist/modules/legacyWalletBook/shouldFilterWallet/shouldFilterWallet.d.ts +34 -0
- package/dist/modules/legacyWalletBook/shouldFilterWallet/shouldFilterWallet.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/buildInAppBrowserOptions/buildInAppBrowserOptions.d.ts +22 -0
- package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/buildInAppBrowserOptions.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/getInAppBrowserUrl/getInAppBrowserUrl.d.ts +18 -0
- package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/getInAppBrowserUrl/getInAppBrowserUrl.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/getInAppBrowserUrl/index.d.ts +2 -0
- package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/getInAppBrowserUrl/index.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/index.d.ts +2 -0
- package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/index.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildInstallationUrls/buildInstallationUrls.d.ts +21 -0
- package/dist/modules/walletOptionsCatalogue/buildInstallationUrls/buildInstallationUrls.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildInstallationUrlsByWalletOptionKey/buildInstallationUrlsByWalletOptionKey.d.ts +27 -0
- package/dist/modules/walletOptionsCatalogue/buildInstallationUrlsByWalletOptionKey/buildInstallationUrlsByWalletOptionKey.d.ts.map +1 -0
- 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/buildWalletOption/buildWalletOption.d.ts +39 -0
- package/dist/modules/walletOptionsCatalogue/buildWalletOption/buildWalletOption.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildWithWalletProviderOptions/buildWithWalletProviderOptions.d.ts +54 -0
- package/dist/modules/walletOptionsCatalogue/buildWithWalletProviderOptions/buildWithWalletProviderOptions.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/classifyWithWalletProviderSource/classifyWithWalletProviderSource.d.ts +31 -0
- package/dist/modules/walletOptionsCatalogue/classifyWithWalletProviderSource/classifyWithWalletProviderSource.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/compareByRelevance/compareByRelevance.d.ts +18 -0
- package/dist/modules/walletOptionsCatalogue/compareByRelevance/compareByRelevance.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/excludedWalletOptionKeys/excludedWalletOptionKeys.d.ts +15 -0
- package/dist/modules/walletOptionsCatalogue/excludedWalletOptionKeys/excludedWalletOptionKeys.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/findByNameMatch/findByNameMatch.d.ts +21 -0
- package/dist/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/findByNameMatch/findByNameMatch.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/findWalletOptionKeyForProviderKey.d.ts +44 -0
- package/dist/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/findWalletOptionKeyForProviderKey.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/resolveWalletOptionKey/resolveWalletOptionKey.d.ts +20 -0
- package/dist/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/resolveWalletOptionKey/resolveWalletOptionKey.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/getConnectionOptionPriority/getConnectionOptionPriority.d.ts +15 -0
- package/dist/modules/walletOptionsCatalogue/getConnectionOptionPriority/getConnectionOptionPriority.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/getPriorityIndex/getPriorityIndex.d.ts +16 -0
- package/dist/modules/walletOptionsCatalogue/getPriorityIndex/getPriorityIndex.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts +14 -0
- package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/groupOptionsByWalletOption/groupOptionsByWalletOption.d.ts +49 -0
- package/dist/modules/walletOptionsCatalogue/groupOptionsByWalletOption/groupOptionsByWalletOption.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/hasAnyConnectionOption/hasAnyConnectionOption.d.ts +18 -0
- package/dist/modules/walletOptionsCatalogue/hasAnyConnectionOption/hasAnyConnectionOption.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/hasInstalledProvider/hasInstalledProvider.d.ts +18 -0
- package/dist/modules/walletOptionsCatalogue/hasInstalledProvider/hasInstalledProvider.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/normalizeWalletDisplayName/normalizeWalletDisplayName.d.ts +23 -0
- package/dist/modules/walletOptionsCatalogue/normalizeWalletDisplayName/normalizeWalletDisplayName.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/resolveWalletBookWalletOptionKey/resolveWalletBookWalletOptionKey.d.ts +22 -0
- package/dist/modules/walletOptionsCatalogue/resolveWalletBookWalletOptionKey/resolveWalletBookWalletOptionKey.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/sortConnectionOptions/sortConnectionOptions.d.ts +20 -0
- package/dist/modules/walletOptionsCatalogue/sortConnectionOptions/sortConnectionOptions.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/sortWalletOptions/sortWalletOptions.d.ts +34 -0
- package/dist/modules/walletOptionsCatalogue/sortWalletOptions/sortWalletOptions.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts +152 -0
- package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts.map +1 -0
- 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/modules/wallets/utils/stripChainSuffix/stripChainSuffix.d.ts +20 -0
- package/dist/modules/wallets/utils/stripChainSuffix/stripChainSuffix.d.ts.map +1 -0
- package/dist/modules/wallets/walletProviderRegistry/createWalletProviderRegistry/createWalletProviderRegistry.d.ts.map +1 -1
- package/dist/modules/wallets/walletProviderRegistry/index.d.ts +1 -1
- package/dist/modules/wallets/walletProviderRegistry/index.d.ts.map +1 -1
- package/dist/modules/wallets/walletProviderRegistry/walletProviderRegistry.types.d.ts +19 -0
- package/dist/modules/wallets/walletProviderRegistry/walletProviderRegistry.types.d.ts.map +1 -1
- package/dist/modules/wallets/walletProviderUriConnection.types.d.ts +23 -0
- package/dist/modules/wallets/walletProviderUriConnection.types.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 +6 -5
- package/dist/waas.cjs.map +1 -1
- package/dist/waas.esm.js +5 -4
- package/dist/waas.esm.js.map +1 -1
- package/dist/waas.native.esm.js +5 -4
- package/dist/waas.native.esm.js.map +1 -1
- package/dist/waasCore.cjs +4 -4
- package/dist/waasCore.esm.js +3 -3
- package/dist/waasCore.native.esm.js +3 -3
- package/package.json +3 -3
- package/dist/InvalidParamError-BYnLW_9s.native.esm.js.map +0 -1
- package/dist/InvalidParamError-CEykJlaG.cjs.map +0 -1
- package/dist/InvalidParamError-uluG140m.esm.js.map +0 -1
- package/dist/NotWaasWalletAccountError-33QOxTKa.native.esm.js.map +0 -1
- package/dist/NotWaasWalletAccountError-BNdbbGX7.cjs.map +0 -1
- package/dist/NotWaasWalletAccountError-DmlwWvy0.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-BOCwNNMm.cjs.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-CS1GXEp6.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-a0atbFHU.native.esm.js.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-B-IhZJuM.cjs.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-BkaECPL_.esm.js.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-CEvtJ3xW.native.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-BfabCDxI.native.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-CJvFP4oN.cjs.map +0 -1
- package/dist/isMfaRequiredForAction-G7SXCZ5L.esm.js.map +0 -1
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/shouldFilterWallet/index.d.ts +0 -2
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/shouldFilterWallet/shouldFilterWallet.d.ts +0 -21
- package/dist/modules/legacyWalletBook/getWalletConnectCatalog/shouldFilterWallet/shouldFilterWallet.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, a as parseElevatedAccessToken, b as getWalletAccounts, d as isUserMissingMfaAuth, f as checkAndRaiseWalletAccountsChangedEvent, 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
|
|
@@ -2288,10 +2329,10 @@ const __unlinkSocialAccount_wrapped = instrumentFunction({
|
|
|
2288
2329
|
* @returns A promise that resolves to an array of token balances.
|
|
2289
2330
|
* @not-instrumented
|
|
2290
2331
|
*/
|
|
2291
|
-
const getBalances = async ({ walletAccount, networkId, includePrices, includeNative, filterSpamTokens, whitelistedContracts, forceRefresh }, client = getDefaultClient()) => {
|
|
2332
|
+
const getBalances = async ({ walletAccount, networkId, networkIds, includePrices, includeNative, filterSpamTokens, whitelistedContracts, forceRefresh }, client = getDefaultClient()) => {
|
|
2292
2333
|
const core = getCore(client);
|
|
2293
2334
|
const apiClient = createApiClient({}, client);
|
|
2294
|
-
if (!networkId) {
|
|
2335
|
+
if (!networkId && !networkIds) {
|
|
2295
2336
|
const activeNetworkId = await getWalletProviderFromWalletAccount({ walletAccount }, client).getActiveNetworkId();
|
|
2296
2337
|
networkId = Number(activeNetworkId.networkId);
|
|
2297
2338
|
}
|
|
@@ -2304,6 +2345,7 @@ const getBalances = async ({ walletAccount, networkId, includePrices, includeNat
|
|
|
2304
2345
|
includeNative,
|
|
2305
2346
|
includePrices,
|
|
2306
2347
|
networkId,
|
|
2348
|
+
networkIds,
|
|
2307
2349
|
whitelistedContracts
|
|
2308
2350
|
});
|
|
2309
2351
|
};
|
|
@@ -2354,6 +2396,52 @@ const createCheckoutApiClient = async ({ transactionId }, client) => {
|
|
|
2354
2396
|
};
|
|
2355
2397
|
};
|
|
2356
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
|
+
|
|
2357
2445
|
//#endregion
|
|
2358
2446
|
//#region src/modules/checkout/attachCheckoutTransactionSource/attachCheckoutTransactionSource.ts
|
|
2359
2447
|
/**
|
|
@@ -2378,12 +2466,15 @@ const attachCheckoutTransactionSource = async (params, client = getDefaultClient
|
|
|
2378
2466
|
attachSourceRequest.fromChainId = params.fromChainId;
|
|
2379
2467
|
attachSourceRequest.fromChainName = params.fromChainName;
|
|
2380
2468
|
}
|
|
2381
|
-
return
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2469
|
+
return withCheckoutSessionTokenCleanupOn401({
|
|
2470
|
+
call: () => apiClient.attachSource({
|
|
2471
|
+
attachSourceRequest,
|
|
2472
|
+
environmentId,
|
|
2473
|
+
transactionId,
|
|
2474
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
2475
|
+
}),
|
|
2476
|
+
transactionId
|
|
2477
|
+
}, client);
|
|
2387
2478
|
};
|
|
2388
2479
|
const __attachCheckoutTransactionSource_impl = attachCheckoutTransactionSource;
|
|
2389
2480
|
const __attachCheckoutTransactionSource_wrapped = instrumentFunction({
|
|
@@ -2414,12 +2505,15 @@ const __attachCheckoutTransactionSource_wrapped = instrumentFunction({
|
|
|
2414
2505
|
*/
|
|
2415
2506
|
const broadcastCheckoutTransaction = async ({ transactionId, txHash }, client = getDefaultClient()) => {
|
|
2416
2507
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
2417
|
-
return
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2508
|
+
return withCheckoutSessionTokenCleanupOn401({
|
|
2509
|
+
call: () => apiClient.recordCheckoutBroadcast({
|
|
2510
|
+
environmentId,
|
|
2511
|
+
recordBroadcastRequest: { txHash },
|
|
2512
|
+
transactionId,
|
|
2513
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
2514
|
+
}),
|
|
2515
|
+
transactionId
|
|
2516
|
+
}, client);
|
|
2423
2517
|
};
|
|
2424
2518
|
const __broadcastCheckoutTransaction_impl = broadcastCheckoutTransaction;
|
|
2425
2519
|
const __broadcastCheckoutTransaction_wrapped = instrumentFunction({
|
|
@@ -2446,12 +2540,15 @@ const __broadcastCheckoutTransaction_wrapped = instrumentFunction({
|
|
|
2446
2540
|
*/
|
|
2447
2541
|
const cancelCheckoutTransaction = async ({ transactionId }, client = getDefaultClient()) => {
|
|
2448
2542
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
2449
|
-
const result = await
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
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);
|
|
2455
2552
|
return result;
|
|
2456
2553
|
};
|
|
2457
2554
|
const __cancelCheckoutTransaction_impl = cancelCheckoutTransaction;
|
|
@@ -2552,16 +2649,19 @@ const getCheckoutTransaction = async ({ transactionId }, client = getDefaultClie
|
|
|
2552
2649
|
*/
|
|
2553
2650
|
const getCheckoutTransactionQuote = async ({ fromChainId, fromTokenAddress, slippage, transactionId }, client = getDefaultClient()) => {
|
|
2554
2651
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
2555
|
-
return
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
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);
|
|
2565
2665
|
};
|
|
2566
2666
|
|
|
2567
2667
|
//#endregion
|
|
@@ -2578,15 +2678,18 @@ const getCheckoutTransactionQuote = async ({ fromChainId, fromTokenAddress, slip
|
|
|
2578
2678
|
*/
|
|
2579
2679
|
const prepareCheckoutTransaction = async ({ assertBalanceForGasCost, assertBalanceForTransferAmount, transactionId }, client = getDefaultClient()) => {
|
|
2580
2680
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
2581
|
-
return
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
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);
|
|
2590
2693
|
};
|
|
2591
2694
|
const __prepareCheckoutTransaction_impl = prepareCheckoutTransaction;
|
|
2592
2695
|
const __prepareCheckoutTransaction_wrapped = instrumentFunction({
|
|
@@ -3373,10 +3476,12 @@ const fetchLegacyWalletBook = async (client) => {
|
|
|
3373
3476
|
};
|
|
3374
3477
|
|
|
3375
3478
|
//#endregion
|
|
3376
|
-
//#region src/modules/legacyWalletBook/
|
|
3479
|
+
//#region src/modules/legacyWalletBook/shouldFilterWallet/shouldFilterWallet.ts
|
|
3377
3480
|
/**
|
|
3378
|
-
* Embedded wallet keys that should be filtered out from
|
|
3379
|
-
* These wallets are not
|
|
3481
|
+
* Embedded wallet keys that should be filtered out from any external-wallet
|
|
3482
|
+
* catalogue. These wallets are not products the user "connects" to from the
|
|
3483
|
+
* wallet selection list — they are embedded sign-in methods that live behind
|
|
3484
|
+
* different SDK entry points.
|
|
3380
3485
|
* @not-instrumented
|
|
3381
3486
|
*/
|
|
3382
3487
|
const EMBEDDED_WALLET_KEYS = [
|
|
@@ -3392,19 +3497,48 @@ const EMBEDDED_WALLET_KEYS = [
|
|
|
3392
3497
|
"mpcwallet"
|
|
3393
3498
|
];
|
|
3394
3499
|
/**
|
|
3395
|
-
*
|
|
3500
|
+
* Generic "is this wallet eligible for an external-wallet catalogue" check.
|
|
3501
|
+
* Filters out:
|
|
3502
|
+
*
|
|
3503
|
+
* 1. Embedded sign-in methods (see {@link EMBEDDED_WALLET_KEYS}).
|
|
3504
|
+
* 2. Wallets that only ship a browser-extension injection (`injectedConfig`)
|
|
3505
|
+
* with no mobile or desktop links — these have no surface a customer
|
|
3506
|
+
* catalogue UI can drive to.
|
|
3507
|
+
*
|
|
3508
|
+
* Channel-specific eligibility (WalletConnect support, in-app browser URL,
|
|
3509
|
+
* installation links, …) is the caller's responsibility — wrap this helper
|
|
3510
|
+
* with an additional check, e.g.
|
|
3511
|
+
* {@link shouldFilterWalletForWalletConnect}.
|
|
3396
3512
|
*
|
|
3397
3513
|
* @returns True if the wallet should be filtered out, false otherwise.
|
|
3398
3514
|
* @not-instrumented
|
|
3399
3515
|
*/
|
|
3400
3516
|
const shouldFilterWallet = ({ wallet, walletKey }) => {
|
|
3401
3517
|
if (EMBEDDED_WALLET_KEYS.includes(walletKey)) return true;
|
|
3402
|
-
if (!wallet.walletConnect || !wallet.walletConnect.sdks.includes("sign_v2")) return true;
|
|
3403
3518
|
const hasInjectedConfig = wallet.injectedConfig && wallet.injectedConfig.length > 0;
|
|
3404
3519
|
const hasMobileLinks = Boolean(wallet.mobile?.androidId || wallet.mobile?.iosId || wallet.mobile?.native || wallet.mobile?.universal);
|
|
3405
3520
|
const hasDesktopLinks = Boolean(wallet.desktop?.chromeId || wallet.desktop?.edgeId || wallet.desktop?.firefoxId || wallet.desktop?.operaId || wallet.desktop?.safariId || wallet.desktop?.universal);
|
|
3406
|
-
|
|
3407
|
-
|
|
3521
|
+
return Boolean(hasInjectedConfig && !hasMobileLinks && !hasDesktopLinks);
|
|
3522
|
+
};
|
|
3523
|
+
|
|
3524
|
+
//#endregion
|
|
3525
|
+
//#region src/modules/legacyWalletBook/getWalletConnectCatalog/shouldFilterWalletForWalletConnect/shouldFilterWalletForWalletConnect.ts
|
|
3526
|
+
/**
|
|
3527
|
+
* WalletConnect-specific filter. Applies the generic
|
|
3528
|
+
* {@link shouldFilterWallet} eligibility rules and additionally drops
|
|
3529
|
+
* wallets that do not advertise WalletConnect `sign_v2` support — the
|
|
3530
|
+
* protocol version Dynamic pairs against.
|
|
3531
|
+
*
|
|
3532
|
+
* @returns True if the wallet should be excluded from the WalletConnect
|
|
3533
|
+
* catalog, false otherwise.
|
|
3534
|
+
* @not-instrumented
|
|
3535
|
+
*/
|
|
3536
|
+
const shouldFilterWalletForWalletConnect = ({ wallet, walletKey }) => {
|
|
3537
|
+
if (shouldFilterWallet({
|
|
3538
|
+
wallet,
|
|
3539
|
+
walletKey
|
|
3540
|
+
})) return true;
|
|
3541
|
+
return !wallet.walletConnect?.sdks.includes("sign_v2");
|
|
3408
3542
|
};
|
|
3409
3543
|
|
|
3410
3544
|
//#endregion
|
|
@@ -3612,7 +3746,7 @@ const transformWalletBook = ({ walletBook }) => {
|
|
|
3612
3746
|
for (const [groupKey, group] of Object.entries(walletBook.groups)) groups[groupKey] = transformGroup({ group });
|
|
3613
3747
|
const wallets = {};
|
|
3614
3748
|
for (const [walletKey, wallet] of Object.entries(walletBook.wallets)) {
|
|
3615
|
-
if (
|
|
3749
|
+
if (shouldFilterWalletForWalletConnect({
|
|
3616
3750
|
wallet,
|
|
3617
3751
|
walletKey
|
|
3618
3752
|
})) continue;
|
|
@@ -3646,7 +3780,7 @@ const getWalletConnectCatalog = async (client = getDefaultClient()) => {
|
|
|
3646
3780
|
|
|
3647
3781
|
//#endregion
|
|
3648
3782
|
//#region src/modules/legacyWalletBook/matchWalletProvidersToCatalogGroup/matchWalletProvidersToCatalogGroup.ts
|
|
3649
|
-
const normalize = (value) => value.toLowerCase().replace(/\s+/g, "").replace(/wallet/g, "");
|
|
3783
|
+
const normalize$1 = (value) => value.toLowerCase().replace(/\s+/g, "").replace(/wallet/g, "");
|
|
3650
3784
|
/**
|
|
3651
3785
|
* Returns the wallet providers that belong to the same wallet group as the
|
|
3652
3786
|
* given WalletConnect catalog entry. Useful for de-duplicating "installed"
|
|
@@ -3665,10 +3799,10 @@ const normalize = (value) => value.toLowerCase().replace(/\s+/g, "").replace(/wa
|
|
|
3665
3799
|
* @not-instrumented
|
|
3666
3800
|
*/
|
|
3667
3801
|
const matchWalletProvidersToCatalogGroup = ({ catalogGroupKey, catalogGroupName, walletProviders }) => {
|
|
3668
|
-
const targets = new Set([normalize(catalogGroupKey)]);
|
|
3669
|
-
if (catalogGroupName) targets.add(normalize(catalogGroupName));
|
|
3802
|
+
const targets = new Set([normalize$1(catalogGroupKey)]);
|
|
3803
|
+
if (catalogGroupName) targets.add(normalize$1(catalogGroupName));
|
|
3670
3804
|
return walletProviders.filter((provider) => {
|
|
3671
|
-
return [normalize(provider.groupKey), normalize(provider.metadata.displayName)].some((candidate) => targets.has(candidate));
|
|
3805
|
+
return [normalize$1(provider.groupKey), normalize$1(provider.metadata.displayName)].some((candidate) => targets.has(candidate));
|
|
3672
3806
|
});
|
|
3673
3807
|
};
|
|
3674
3808
|
|
|
@@ -3802,6 +3936,812 @@ const getWalletConnectCatalogWalletByWalletProviderKey = async ({ walletProvider
|
|
|
3802
3936
|
}
|
|
3803
3937
|
};
|
|
3804
3938
|
|
|
3939
|
+
//#endregion
|
|
3940
|
+
//#region src/modules/walletOptionsCatalogue/resolveWalletBookWalletOptionKey/resolveWalletBookWalletOptionKey.ts
|
|
3941
|
+
/**
|
|
3942
|
+
* Resolves which wallet option (group) a wallet book entry belongs to. Used
|
|
3943
|
+
* by the catalogue's wallet-book-driven transformers (URI deeplink,
|
|
3944
|
+
* `inAppBrowser`, `installation`) to bucket their emitted options.
|
|
3945
|
+
*
|
|
3946
|
+
* Wallet book entries inconsistently use `group` / `chainGroup` /
|
|
3947
|
+
* `walletGroup` for the same idea. The wallet key itself acts as the wallet
|
|
3948
|
+
* option key when no group field is set.
|
|
3949
|
+
*
|
|
3950
|
+
* @param params.wallet - The wallet entry.
|
|
3951
|
+
* @param params.walletKey - The wallet's key in `walletBook.wallets`.
|
|
3952
|
+
* @returns The wallet option key.
|
|
3953
|
+
* @not-instrumented
|
|
3954
|
+
*/
|
|
3955
|
+
const resolveWalletBookWalletOptionKey = ({ wallet, walletKey }) => wallet.group ?? wallet.chainGroup ?? wallet.walletGroup ?? walletKey;
|
|
3956
|
+
|
|
3957
|
+
//#endregion
|
|
3958
|
+
//#region src/modules/walletOptionsCatalogue/buildInAppBrowserOptions/getInAppBrowserUrl/getInAppBrowserUrl.ts
|
|
3959
|
+
/**
|
|
3960
|
+
* Returns the wallet's in-app browser URL template, preferring the v2
|
|
3961
|
+
* field. `inAppBrowser` is deprecated but some wallet book entries
|
|
3962
|
+
* still carry only the v1 value, so it acts as a fallback. Trailing
|
|
3963
|
+
* `?? undefined` collapses the schema's `string | null` typing down to
|
|
3964
|
+
* the `string | undefined` return contract.
|
|
3965
|
+
*
|
|
3966
|
+
* @param params.wallet - The wallet book wallet entry.
|
|
3967
|
+
* @returns The in-app browser URL, or `undefined` if neither field is set.
|
|
3968
|
+
* @not-instrumented
|
|
3969
|
+
*/
|
|
3970
|
+
const getInAppBrowserUrl = ({ wallet }) => wallet.mobile?.inAppBrowserV2 ?? wallet.mobile?.inAppBrowser ?? void 0;
|
|
3971
|
+
|
|
3972
|
+
//#endregion
|
|
3973
|
+
//#region src/modules/walletOptionsCatalogue/buildInAppBrowserOptions/buildInAppBrowserOptions.ts
|
|
3974
|
+
/**
|
|
3975
|
+
* Builds the `inAppBrowser` catalogue options from the wallet book. A wallet
|
|
3976
|
+
* qualifies when it exposes a mobile in-app-browser URL — typically a
|
|
3977
|
+
* `cb_url={{encodedDappURI}}`-style template the customer fills in with the
|
|
3978
|
+
* current page URL before opening.
|
|
3979
|
+
*
|
|
3980
|
+
* Reuses the generic `shouldFilterWallet` rules — embedded sign-in methods
|
|
3981
|
+
* and injected-only wallets are dropped — so the catalogue's notion of
|
|
3982
|
+
* "external wallet" stays consistent across option types.
|
|
3983
|
+
*
|
|
3984
|
+
* @param params.walletBook - The fetched wallet book.
|
|
3985
|
+
* @returns Tagged `inAppBrowser` options paired with their wallet option keys.
|
|
3986
|
+
* @not-instrumented
|
|
3987
|
+
*/
|
|
3988
|
+
const buildInAppBrowserOptions = ({ walletBook }) => {
|
|
3989
|
+
const result = [];
|
|
3990
|
+
for (const [walletKey, wallet] of Object.entries(walletBook.wallets)) {
|
|
3991
|
+
if (shouldFilterWallet({
|
|
3992
|
+
wallet,
|
|
3993
|
+
walletKey
|
|
3994
|
+
})) continue;
|
|
3995
|
+
const url = getInAppBrowserUrl({ wallet });
|
|
3996
|
+
if (!url) continue;
|
|
3997
|
+
result.push({
|
|
3998
|
+
option: {
|
|
3999
|
+
chain: getChainFromWalletSchema({
|
|
4000
|
+
wallet,
|
|
4001
|
+
walletKey
|
|
4002
|
+
}),
|
|
4003
|
+
type: "inAppBrowser",
|
|
4004
|
+
url
|
|
4005
|
+
},
|
|
4006
|
+
walletOptionKey: resolveWalletBookWalletOptionKey({
|
|
4007
|
+
wallet,
|
|
4008
|
+
walletKey
|
|
4009
|
+
})
|
|
4010
|
+
});
|
|
4011
|
+
}
|
|
4012
|
+
return result;
|
|
4013
|
+
};
|
|
4014
|
+
|
|
4015
|
+
//#endregion
|
|
4016
|
+
//#region src/modules/walletOptionsCatalogue/buildInstallationUrls/buildInstallationUrls.ts
|
|
4017
|
+
const PLAY_STORE_URL_TEMPLATE = "https://play.google.com/store/apps/details?id=";
|
|
4018
|
+
const APP_STORE_URL_TEMPLATE = "https://apps.apple.com/app/";
|
|
4019
|
+
const CHROME_WEB_STORE_URL_TEMPLATE = "https://chrome.google.com/webstore/detail/";
|
|
4020
|
+
const FIREFOX_ADDONS_URL_TEMPLATE = "https://addons.mozilla.org/firefox/addon/";
|
|
4021
|
+
const EDGE_ADDONS_URL_TEMPLATE = "https://microsoftedge.microsoft.com/addons/detail/";
|
|
4022
|
+
/**
|
|
4023
|
+
* Builds the install/download URL bag for a wallet book entry. Returns the
|
|
4024
|
+
* concrete URLs assembled from each store's ID field — Play Store, App
|
|
4025
|
+
* Store, Chrome Web Store, Firefox Add-ons, Edge Add-ons — plus the wallet's
|
|
4026
|
+
* own `desktop.universal` / `desktop.native` URLs when set.
|
|
4027
|
+
*
|
|
4028
|
+
* Fields the wallet book does not carry are left undefined; callers should
|
|
4029
|
+
* skip emitting an installation option for a wallet whose URL bag is empty.
|
|
4030
|
+
*
|
|
4031
|
+
* @param params.wallet - The wallet book entry.
|
|
4032
|
+
* @returns The URL bag, omitting fields the wallet does not provide.
|
|
4033
|
+
* @not-instrumented
|
|
4034
|
+
*/
|
|
4035
|
+
const buildInstallationUrls = ({ wallet }) => {
|
|
4036
|
+
const androidId = wallet.mobile?.androidId;
|
|
4037
|
+
const iosId = wallet.mobile?.iosId;
|
|
4038
|
+
const chromeId = wallet.desktop?.chromeId;
|
|
4039
|
+
const firefoxId = wallet.desktop?.firefoxId;
|
|
4040
|
+
const edgeId = wallet.desktop?.edgeId;
|
|
4041
|
+
const native = wallet.desktop?.universal ?? wallet.desktop?.native;
|
|
4042
|
+
return {
|
|
4043
|
+
android: androidId ? `${PLAY_STORE_URL_TEMPLATE}${androidId}` : void 0,
|
|
4044
|
+
chrome: chromeId ? `${CHROME_WEB_STORE_URL_TEMPLATE}${chromeId}` : void 0,
|
|
4045
|
+
edge: edgeId ? `${EDGE_ADDONS_URL_TEMPLATE}${edgeId}` : void 0,
|
|
4046
|
+
firefox: firefoxId ? `${FIREFOX_ADDONS_URL_TEMPLATE}${firefoxId}` : void 0,
|
|
4047
|
+
ios: iosId ? `${APP_STORE_URL_TEMPLATE}${iosId}` : void 0,
|
|
4048
|
+
native: native || void 0
|
|
4049
|
+
};
|
|
4050
|
+
};
|
|
4051
|
+
|
|
4052
|
+
//#endregion
|
|
4053
|
+
//#region src/modules/walletOptionsCatalogue/buildInstallationUrlsByWalletOptionKey/buildInstallationUrlsByWalletOptionKey.ts
|
|
4054
|
+
/**
|
|
4055
|
+
* `buildInstallationUrls` always returns an object, but it can be fully
|
|
4056
|
+
* `undefined`-valued when the wallet book entry has no installable surface.
|
|
4057
|
+
* Skip those wallets — emitting an empty URL bag helps nobody.
|
|
4058
|
+
*/
|
|
4059
|
+
const hasAnyInstallationUrl = ({ urls }) => Object.values(urls).some(Boolean);
|
|
4060
|
+
/**
|
|
4061
|
+
* Collects install / download URLs for every wallet book entry that has
|
|
4062
|
+
* at least one installable surface, keyed by the wallet option key the
|
|
4063
|
+
* wallet groups under. The catalogue assembly step merges this map into
|
|
4064
|
+
* the per-key wallet option shell so `WalletOption.installationUrls` is
|
|
4065
|
+
* populated alongside (or instead of) `connectionOptions`.
|
|
4066
|
+
*
|
|
4067
|
+
* First-seen URLs win when multiple wallet book entries resolve to the
|
|
4068
|
+
* same wallet option key — wallet book authors put the most accurate
|
|
4069
|
+
* install links on the canonical entry, so the first-seen one is the
|
|
4070
|
+
* right pick.
|
|
4071
|
+
*
|
|
4072
|
+
* Reuses the generic `shouldFilterWallet` rules so embedded wallets do
|
|
4073
|
+
* not appear here either — they're not user-installable products.
|
|
4074
|
+
*
|
|
4075
|
+
* @param params.walletBook - The fetched wallet book.
|
|
4076
|
+
* @returns A map from wallet option key to its install URL bag.
|
|
4077
|
+
* @not-instrumented
|
|
4078
|
+
*/
|
|
4079
|
+
const buildInstallationUrlsByWalletOptionKey = ({ walletBook }) => {
|
|
4080
|
+
const map = /* @__PURE__ */ new Map();
|
|
4081
|
+
for (const [walletKey, wallet] of Object.entries(walletBook.wallets)) {
|
|
4082
|
+
if (shouldFilterWallet({
|
|
4083
|
+
wallet,
|
|
4084
|
+
walletKey
|
|
4085
|
+
})) continue;
|
|
4086
|
+
const urls = buildInstallationUrls({ wallet });
|
|
4087
|
+
if (!hasAnyInstallationUrl({ urls })) continue;
|
|
4088
|
+
const walletOptionKey = resolveWalletBookWalletOptionKey({
|
|
4089
|
+
wallet,
|
|
4090
|
+
walletKey
|
|
4091
|
+
});
|
|
4092
|
+
if (!map.has(walletOptionKey)) map.set(walletOptionKey, urls);
|
|
4093
|
+
}
|
|
4094
|
+
return map;
|
|
4095
|
+
};
|
|
4096
|
+
|
|
4097
|
+
//#endregion
|
|
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
|
|
4114
|
+
/**
|
|
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.
|
|
4119
|
+
*/
|
|
4120
|
+
const hasUsableDeeplink = ({ wallet }) => Boolean(wallet.mobile?.native || wallet.mobile?.universal);
|
|
4121
|
+
/**
|
|
4122
|
+
* Builds the URI-deeplink catalogue options from a fetched wallet book.
|
|
4123
|
+
* Applies the WalletConnect-specific eligibility filter
|
|
4124
|
+
* (`shouldFilterWalletForWalletConnect`) so embedded wallets and entries
|
|
4125
|
+
* without `sign_v2` support are excluded — same surface as
|
|
4126
|
+
* `getWalletConnectCatalog`.
|
|
4127
|
+
*
|
|
4128
|
+
* Each emitted option carries the wallet's mobile deeplinks. Customers
|
|
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`.
|
|
4136
|
+
*
|
|
4137
|
+
* @param params.walletBook - The fetched wallet book.
|
|
4138
|
+
* @returns Tagged options paired with their wallet option keys.
|
|
4139
|
+
* @not-instrumented
|
|
4140
|
+
*/
|
|
4141
|
+
const buildUriDeeplinkOptions = ({ walletBook }) => {
|
|
4142
|
+
const result = [];
|
|
4143
|
+
for (const [walletKey, wallet] of Object.entries(walletBook.wallets)) {
|
|
4144
|
+
if (shouldFilterWalletForWalletConnect({
|
|
4145
|
+
wallet,
|
|
4146
|
+
walletKey
|
|
4147
|
+
})) continue;
|
|
4148
|
+
if (!hasUsableDeeplink({ wallet })) continue;
|
|
4149
|
+
const walletOptionKey = resolveWalletBookWalletOptionKey({
|
|
4150
|
+
wallet,
|
|
4151
|
+
walletKey
|
|
4152
|
+
});
|
|
4153
|
+
const chain = getChainFromWalletSchema({
|
|
4154
|
+
wallet,
|
|
4155
|
+
walletKey
|
|
4156
|
+
});
|
|
4157
|
+
result.push({
|
|
4158
|
+
option: {
|
|
4159
|
+
chain,
|
|
4160
|
+
deeplinks: {
|
|
4161
|
+
native: wallet.mobile?.native,
|
|
4162
|
+
universal: wallet.mobile?.universal
|
|
4163
|
+
},
|
|
4164
|
+
type: resolveUriConnectionType({ walletOptionKey })
|
|
4165
|
+
},
|
|
4166
|
+
walletOptionKey
|
|
4167
|
+
});
|
|
4168
|
+
}
|
|
4169
|
+
return result;
|
|
4170
|
+
};
|
|
4171
|
+
|
|
4172
|
+
//#endregion
|
|
4173
|
+
//#region src/modules/walletOptionsCatalogue/buildWalletOption/buildWalletOption.ts
|
|
4174
|
+
/**
|
|
4175
|
+
* Assembles a `WalletOption` for a resolved wallet option key, populated
|
|
4176
|
+
* with the connection options the transformers produced for it plus an
|
|
4177
|
+
* optional install / download URL bag.
|
|
4178
|
+
*
|
|
4179
|
+
* Display merge rules (provider self-announced metadata wins where set):
|
|
4180
|
+
*
|
|
4181
|
+
* - `name`: `displayOverride.name` ?? wallet book group name ?? bare key.
|
|
4182
|
+
* - `iconUrl`: `displayOverride.iconUrl` ?? wallet book group sprite URL ?? `''`.
|
|
4183
|
+
* - `primaryColor`: wallet book group brand color only (providers do not
|
|
4184
|
+
* ship a primary color in their announcement metadata).
|
|
4185
|
+
* - `installationUrls`: copied through if present.
|
|
4186
|
+
*
|
|
4187
|
+
* Why provider precedence: a registered wallet provider knows its own
|
|
4188
|
+
* brand best (EIP-6963 / Wallet Standard / vendor SDK announcement is the
|
|
4189
|
+
* wallet authoring its own identity). The wallet book fills in fields the
|
|
4190
|
+
* announcement does not carry — currently only `primaryColor`.
|
|
4191
|
+
*
|
|
4192
|
+
* @param params.connectionOptions - The connections to attach to this wallet option.
|
|
4193
|
+
* @param [params.displayOverride] - Provider-announced display info that overrides the wallet book's name and iconUrl.
|
|
4194
|
+
* @param [params.installationUrls] - Install/download URL bag for this wallet.
|
|
4195
|
+
* @param params.walletBook - The fetched wallet book.
|
|
4196
|
+
* @param params.walletOptionKey - The wallet option key.
|
|
4197
|
+
* @returns The constructed wallet option.
|
|
4198
|
+
* @not-instrumented
|
|
4199
|
+
*/
|
|
4200
|
+
const buildWalletOption = ({ connectionOptions, displayOverride, installationUrls, walletBook, walletOptionKey }) => {
|
|
4201
|
+
const group = walletBook.groups[walletOptionKey];
|
|
4202
|
+
const groupSpriteId = group?.brand?.spriteId;
|
|
4203
|
+
const groupIconUrl = groupSpriteId ? getSpriteUrl({ spriteId: groupSpriteId }) : void 0;
|
|
4204
|
+
return {
|
|
4205
|
+
connectionOptions,
|
|
4206
|
+
iconUrl: displayOverride?.iconUrl ?? groupIconUrl ?? "",
|
|
4207
|
+
installationUrls,
|
|
4208
|
+
key: walletOptionKey,
|
|
4209
|
+
name: displayOverride?.name ?? group?.name ?? walletOptionKey,
|
|
4210
|
+
primaryColor: group?.brand?.primaryColor
|
|
4211
|
+
};
|
|
4212
|
+
};
|
|
4213
|
+
|
|
4214
|
+
//#endregion
|
|
4215
|
+
//#region src/modules/walletOptionsCatalogue/classifyWithWalletProviderSource/classifyWithWalletProviderSource.ts
|
|
4216
|
+
/**
|
|
4217
|
+
* Maps a registered wallet provider's registration priority to the
|
|
4218
|
+
* `WithWalletProviderSource` value that should appear on its catalogue option.
|
|
4219
|
+
*
|
|
4220
|
+
* Priority mapping (set by each chain extension when it calls
|
|
4221
|
+
* `registry.register`):
|
|
4222
|
+
*
|
|
4223
|
+
* - `WALLET_SDK` → `'sdk'` — branded SDKs wrapped by chain extensions
|
|
4224
|
+
* (Base Account via `@base-org/account`, MetaMask Connect, …).
|
|
4225
|
+
* - `WALLET_SELF_ANNOUNCEMENT_STANDARD` → `'selfAnnounced'` — in-page
|
|
4226
|
+
* self-announcement standards (EIP-6963 on EVM, Wallet Standard on
|
|
4227
|
+
* Solana / Sui / …).
|
|
4228
|
+
* - `WINDOW_INJECT` → `'windowInjected'` — legacy `window.*` injection.
|
|
4229
|
+
*
|
|
4230
|
+
* Returns `undefined` for providers whose registration priority does not
|
|
4231
|
+
* correspond to a connectable external-wallet source — callers filter these
|
|
4232
|
+
* out before emitting catalogue options.
|
|
4233
|
+
*
|
|
4234
|
+
* @param params.entry - The registry entry to classify.
|
|
4235
|
+
* @returns The matching source, or `undefined` if this entry should not
|
|
4236
|
+
* surface a `withWalletProvider` option.
|
|
4237
|
+
* @not-instrumented
|
|
4238
|
+
*/
|
|
4239
|
+
const classifyWithWalletProviderSource = ({ entry }) => {
|
|
4240
|
+
const { priority } = entry;
|
|
4241
|
+
if (priority === WalletProviderPriority.WALLET_SDK) return "sdk";
|
|
4242
|
+
if (priority === WalletProviderPriority.WALLET_SELF_ANNOUNCEMENT_STANDARD) return "selfAnnounced";
|
|
4243
|
+
if (priority === WalletProviderPriority.WINDOW_INJECT) return "windowInjected";
|
|
4244
|
+
};
|
|
4245
|
+
|
|
4246
|
+
//#endregion
|
|
4247
|
+
//#region src/modules/wallets/utils/stripChainSuffix/stripChainSuffix.ts
|
|
4248
|
+
/**
|
|
4249
|
+
* Removes the lowercased chain suffix that `normalizeWalletNameWithChain`
|
|
4250
|
+
* appends. Used by `findWalletOptionKeyForProviderKey` to recover the wallet
|
|
4251
|
+
* book wallet key candidate from a `walletProviderKey`. If the suffix is
|
|
4252
|
+
* not present (some chain extensions already bake the chain into the
|
|
4253
|
+
* display name), the input is returned unchanged.
|
|
4254
|
+
*
|
|
4255
|
+
* @param params.chain - The chain whose suffix should be stripped.
|
|
4256
|
+
* @param params.normalizedName - The normalized wallet-name-with-chain string.
|
|
4257
|
+
* @returns The name with the chain suffix removed, or the input unchanged.
|
|
4258
|
+
* @not-instrumented
|
|
4259
|
+
*/
|
|
4260
|
+
const stripChainSuffix = ({ chain, normalizedName }) => {
|
|
4261
|
+
const suffix = chain.toLowerCase();
|
|
4262
|
+
if (normalizedName.endsWith(suffix)) return normalizedName.slice(0, -suffix.length);
|
|
4263
|
+
return normalizedName;
|
|
4264
|
+
};
|
|
4265
|
+
|
|
4266
|
+
//#endregion
|
|
4267
|
+
//#region src/modules/walletOptionsCatalogue/normalizeWalletDisplayName/normalizeWalletDisplayName.ts
|
|
4268
|
+
/**
|
|
4269
|
+
* Normalizes a wallet's self-announced `displayName` into a stable wallet
|
|
4270
|
+
* option key. Used by `findWalletOptionKeyForProviderKey` as the off-book
|
|
4271
|
+
* fallback — registered providers whose `walletProviderKey` does not
|
|
4272
|
+
* resolve to any wallet book entry still surface in the catalogue under a
|
|
4273
|
+
* key derived from the name they ship in their metadata.
|
|
4274
|
+
*
|
|
4275
|
+
* The normalization (lowercase + whitespace-strip) intentionally matches
|
|
4276
|
+
* how the legacy wallet book composes its `wallets.<key>` keys, so a
|
|
4277
|
+
* self-described provider's option will merge cleanly with its book entry
|
|
4278
|
+
* if one ever lands later.
|
|
4279
|
+
*
|
|
4280
|
+
* Multi-chain registrations of the same wallet (e.g. Phantom announced via
|
|
4281
|
+
* EIP-6963 on EVM and via Wallet Standard on Solana) collapse onto the
|
|
4282
|
+
* same wallet option through this normalization, since each registration
|
|
4283
|
+
* announces the same `displayName`.
|
|
4284
|
+
*
|
|
4285
|
+
* @param displayName - The provider's `metadata.displayName`.
|
|
4286
|
+
* @returns The normalized wallet option key (lowercased, no whitespace).
|
|
4287
|
+
* @not-instrumented
|
|
4288
|
+
*/
|
|
4289
|
+
const normalizeWalletDisplayName = (displayName) => displayName.toLowerCase().replace(/\s+/g, "");
|
|
4290
|
+
|
|
4291
|
+
//#endregion
|
|
4292
|
+
//#region src/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/findByNameMatch/findByNameMatch.ts
|
|
4293
|
+
const normalize = (value) => value.toLowerCase().replace(/\s+/g, "");
|
|
4294
|
+
/**
|
|
4295
|
+
* Looks for a wallet book entry whose `name` or `shortName` normalizes to
|
|
4296
|
+
* the same string as `candidate`. Used as a fallback by
|
|
4297
|
+
* `findWalletOptionKeyForProviderKey` for providers whose
|
|
4298
|
+
* `walletProviderKey` strips down to a value that does not match any
|
|
4299
|
+
* `walletBook.wallets` key directly (e.g. an extension whose display name
|
|
4300
|
+
* happens to match the wallet's `shortName` instead of its book key).
|
|
4301
|
+
*
|
|
4302
|
+
* @param params.candidate - The lowercased, chain-suffix-stripped candidate.
|
|
4303
|
+
* @param params.walletBook - The fetched wallet book.
|
|
4304
|
+
* @returns The matching wallet book wallet key, or `undefined`.
|
|
4305
|
+
* @not-instrumented
|
|
4306
|
+
*/
|
|
4307
|
+
const findByNameMatch = ({ candidate, walletBook }) => {
|
|
4308
|
+
for (const [walletKey, wallet] of Object.entries(walletBook.wallets)) if (normalize(wallet.name) === candidate || normalize(wallet.shortName) === candidate) return walletKey;
|
|
4309
|
+
};
|
|
4310
|
+
|
|
4311
|
+
//#endregion
|
|
4312
|
+
//#region src/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/resolveWalletOptionKey/resolveWalletOptionKey.ts
|
|
4313
|
+
/**
|
|
4314
|
+
* Picks the wallet option (group) key for a wallet book wallet. The wallet
|
|
4315
|
+
* book carries the group association under a few different field names
|
|
4316
|
+
* (`group`, `chainGroup`, `walletGroup`) depending on the wallet's
|
|
4317
|
+
* provenance — this helper centralises the lookup. When none of those
|
|
4318
|
+
* fields are set, the wallet key itself acts as its own wallet option key.
|
|
4319
|
+
*
|
|
4320
|
+
* @param params.fallback - Wallet key to return if no group field is set.
|
|
4321
|
+
* @param params.wallet - The wallet book wallet entry.
|
|
4322
|
+
* @returns The resolved wallet option key.
|
|
4323
|
+
* @not-instrumented
|
|
4324
|
+
*/
|
|
4325
|
+
const resolveWalletOptionKey = ({ fallback, wallet }) => wallet.group ?? wallet.chainGroup ?? wallet.walletGroup ?? fallback;
|
|
4326
|
+
|
|
4327
|
+
//#endregion
|
|
4328
|
+
//#region src/modules/walletOptionsCatalogue/findWalletOptionKeyForProviderKey/findWalletOptionKeyForProviderKey.ts
|
|
4329
|
+
/**
|
|
4330
|
+
* Resolves a registered wallet provider to the wallet option key it should
|
|
4331
|
+
* be bucketed under. Always returns a key — providers with no wallet book
|
|
4332
|
+
* match fall back to their self-announced `metadata.displayName`, so the
|
|
4333
|
+
* catalogue surfaces them as self-described tiles instead of silently
|
|
4334
|
+
* dropping them.
|
|
4335
|
+
*
|
|
4336
|
+
* Resolution order (each step short-circuits on first hit):
|
|
4337
|
+
*
|
|
4338
|
+
* 1. **Direct wallet book lookup with chain suffix** — try
|
|
4339
|
+
* `walletBook.wallets[normalizedWalletNameWithChain]` as-is. Wallet
|
|
4340
|
+
* book entries are inconsistent about whether they keep the chain
|
|
4341
|
+
* suffix (e.g. `metamaskevm`) or strip it (e.g. `metamask`), so try
|
|
4342
|
+
* the suffixed form first.
|
|
4343
|
+
* 2. **Direct wallet book lookup without chain suffix** — strip the
|
|
4344
|
+
* suffix and retry.
|
|
4345
|
+
* 3. **Name match heuristic with chain suffix** — scan
|
|
4346
|
+
* `walletBook.wallets` for an entry whose normalized `name` or
|
|
4347
|
+
* `shortName` equals the suffixed candidate.
|
|
4348
|
+
* 4. **Name match heuristic without chain suffix** — same scan on the
|
|
4349
|
+
* stripped candidate.
|
|
4350
|
+
* 5. **Display-name fallback** — derive a stable key from
|
|
4351
|
+
* `walletProvider.metadata.displayName` via
|
|
4352
|
+
* {@link normalizeWalletDisplayName}. Multi-chain registrations of the
|
|
4353
|
+
* same self-described wallet (e.g. Phantom on EVM and Solana) collapse
|
|
4354
|
+
* onto the same tile because each announces the same display name.
|
|
4355
|
+
*
|
|
4356
|
+
* @param params.chain - The provider's chain (used to strip the suffix).
|
|
4357
|
+
* @param params.walletBook - The fetched wallet book.
|
|
4358
|
+
* @param params.walletProvider - The registered wallet provider.
|
|
4359
|
+
* @returns The wallet option key for this provider.
|
|
4360
|
+
* @not-instrumented
|
|
4361
|
+
*/
|
|
4362
|
+
const findWalletOptionKeyForProviderKey = ({ chain, walletBook, walletProvider }) => {
|
|
4363
|
+
const { normalizedWalletNameWithChain } = splitWalletProviderKey(walletProvider.key);
|
|
4364
|
+
const candidates = [normalizedWalletNameWithChain, stripChainSuffix({
|
|
4365
|
+
chain,
|
|
4366
|
+
normalizedName: normalizedWalletNameWithChain
|
|
4367
|
+
})];
|
|
4368
|
+
for (const candidate of candidates) {
|
|
4369
|
+
const directHit = walletBook.wallets[candidate];
|
|
4370
|
+
if (directHit) return resolveWalletOptionKey({
|
|
4371
|
+
fallback: candidate,
|
|
4372
|
+
wallet: directHit
|
|
4373
|
+
});
|
|
4374
|
+
}
|
|
4375
|
+
for (const candidate of candidates) {
|
|
4376
|
+
const nameMatchKey = findByNameMatch({
|
|
4377
|
+
candidate,
|
|
4378
|
+
walletBook
|
|
4379
|
+
});
|
|
4380
|
+
if (nameMatchKey) return resolveWalletOptionKey({
|
|
4381
|
+
fallback: nameMatchKey,
|
|
4382
|
+
wallet: walletBook.wallets[nameMatchKey]
|
|
4383
|
+
});
|
|
4384
|
+
}
|
|
4385
|
+
return normalizeWalletDisplayName(walletProvider.metadata.displayName);
|
|
4386
|
+
};
|
|
4387
|
+
|
|
4388
|
+
//#endregion
|
|
4389
|
+
//#region src/modules/walletOptionsCatalogue/buildWithWalletProviderOptions/buildWithWalletProviderOptions.ts
|
|
4390
|
+
/**
|
|
4391
|
+
* Converts each registered wallet provider entry into a
|
|
4392
|
+
* `WithWalletProviderConnectionOption` paired with its target wallet
|
|
4393
|
+
* option key and the provider's display override. Every classifiable
|
|
4394
|
+
* entry surfaces in the catalogue; the outer transformer uses the
|
|
4395
|
+
* carried `displayOverride` to override any wallet book branding for
|
|
4396
|
+
* that key (provider self-announcement wins over book).
|
|
4397
|
+
*
|
|
4398
|
+
* Entries whose registration priority is not recognised by
|
|
4399
|
+
* `classifyWithWalletProviderSource` are dropped from the catalogue and
|
|
4400
|
+
* an error is logged so Datadog surfaces the unknown registration path —
|
|
4401
|
+
* in production this should never happen, every chain extension is
|
|
4402
|
+
* expected to register with one of the documented priorities.
|
|
4403
|
+
*
|
|
4404
|
+
* @param params.entries - Snapshot of the registry's entries.
|
|
4405
|
+
* @param params.walletBook - The fetched wallet book.
|
|
4406
|
+
* @param client - The Dynamic client (used for logging unclassifiable entries).
|
|
4407
|
+
* @returns An array of tagged options, in input order.
|
|
4408
|
+
* @not-instrumented
|
|
4409
|
+
*/
|
|
4410
|
+
const buildWithWalletProviderOptions = ({ entries, walletBook }, client) => {
|
|
4411
|
+
const result = [];
|
|
4412
|
+
for (const entry of entries) {
|
|
4413
|
+
const source = classifyWithWalletProviderSource({ entry });
|
|
4414
|
+
if (!source) {
|
|
4415
|
+
getCore(client).logger.error("buildWithWalletProviderOptions: registered wallet provider has an unrecognised priority — unable to identify how this wallet was registered", {
|
|
4416
|
+
chain: entry.walletProvider.chain,
|
|
4417
|
+
displayName: entry.walletProvider.metadata.displayName,
|
|
4418
|
+
priority: entry.priority,
|
|
4419
|
+
walletProviderKey: entry.walletProvider.key,
|
|
4420
|
+
walletProviderType: entry.walletProvider.walletProviderType
|
|
4421
|
+
});
|
|
4422
|
+
continue;
|
|
4423
|
+
}
|
|
4424
|
+
const walletOptionKey = findWalletOptionKeyForProviderKey({
|
|
4425
|
+
chain: entry.walletProvider.chain,
|
|
4426
|
+
walletBook,
|
|
4427
|
+
walletProvider: entry.walletProvider
|
|
4428
|
+
});
|
|
4429
|
+
result.push({
|
|
4430
|
+
displayOverride: {
|
|
4431
|
+
iconUrl: entry.walletProvider.metadata.icon,
|
|
4432
|
+
name: entry.walletProvider.metadata.displayName
|
|
4433
|
+
},
|
|
4434
|
+
option: {
|
|
4435
|
+
chain: entry.walletProvider.chain,
|
|
4436
|
+
source,
|
|
4437
|
+
type: "withWalletProvider",
|
|
4438
|
+
walletProviderKey: entry.walletProvider.key
|
|
4439
|
+
},
|
|
4440
|
+
walletOptionKey
|
|
4441
|
+
});
|
|
4442
|
+
}
|
|
4443
|
+
return result;
|
|
4444
|
+
};
|
|
4445
|
+
|
|
4446
|
+
//#endregion
|
|
4447
|
+
//#region src/modules/walletOptionsCatalogue/excludedWalletOptionKeys/excludedWalletOptionKeys.ts
|
|
4448
|
+
/**
|
|
4449
|
+
* Wallet option keys `getWalletOptionsCatalogue` drops before returning.
|
|
4450
|
+
* Curated, product-level suppression.
|
|
4451
|
+
*
|
|
4452
|
+
* Example: Base Account SDK is the recommended entry point for
|
|
4453
|
+
* Coinbase-managed users, so the legacy Coinbase Wallet entries are
|
|
4454
|
+
* suppressed in favor of the SDK-backed `baseaccount` tile. Both the
|
|
4455
|
+
* wallet book group key (`coinbase`) and the normalized display-name
|
|
4456
|
+
* key (`coinbasewallet`) are listed so suppression holds regardless of
|
|
4457
|
+
* how the resolver lands on a key.
|
|
4458
|
+
*
|
|
4459
|
+
* Used in: `getWalletOptionsCatalogue`.
|
|
4460
|
+
*/
|
|
4461
|
+
const EXCLUDED_WALLET_OPTION_KEYS = new Set(["coinbase", "coinbasewallet"]);
|
|
4462
|
+
|
|
4463
|
+
//#endregion
|
|
4464
|
+
//#region src/modules/walletOptionsCatalogue/groupOptionsByWalletOption/groupOptionsByWalletOption.ts
|
|
4465
|
+
/**
|
|
4466
|
+
* Buckets tagged connection options by their wallet option key. Preserves
|
|
4467
|
+
* first-seen order so that the caller's choice of
|
|
4468
|
+
* `walletOptionOrdering: 'relevance'` naturally inherits the upstream input
|
|
4469
|
+
* order (wallet book order for walletConnect/inAppBrowser/installation,
|
|
4470
|
+
* registry order for withWalletProvider).
|
|
4471
|
+
*
|
|
4472
|
+
* Carries through the first-seen `displayOverride` per wallet option
|
|
4473
|
+
* key, so the shell builder can apply provider-announced metadata on
|
|
4474
|
+
* top of any wallet book entry.
|
|
4475
|
+
*
|
|
4476
|
+
* @param params.options - The tagged options to group.
|
|
4477
|
+
* @returns A map from wallet option key to its grouped option bucket,
|
|
4478
|
+
* iterable in first-seen order.
|
|
4479
|
+
* @not-instrumented
|
|
4480
|
+
*/
|
|
4481
|
+
const groupOptionsByWalletOption = ({ options }) => {
|
|
4482
|
+
const map = /* @__PURE__ */ new Map();
|
|
4483
|
+
for (const { displayOverride, option, walletOptionKey } of options) {
|
|
4484
|
+
const existing = map.get(walletOptionKey);
|
|
4485
|
+
if (existing) {
|
|
4486
|
+
existing.connectionOptions.push(option);
|
|
4487
|
+
if (!existing.displayOverride && displayOverride) existing.displayOverride = displayOverride;
|
|
4488
|
+
} else map.set(walletOptionKey, {
|
|
4489
|
+
connectionOptions: [option],
|
|
4490
|
+
displayOverride
|
|
4491
|
+
});
|
|
4492
|
+
}
|
|
4493
|
+
return map;
|
|
4494
|
+
};
|
|
4495
|
+
|
|
4496
|
+
//#endregion
|
|
4497
|
+
//#region src/modules/walletOptionsCatalogue/getConnectionOptionPriority/getConnectionOptionPriority.ts
|
|
4498
|
+
/**
|
|
4499
|
+
* Numeric priority for each `WalletConnectionOption` type. Lower values rank
|
|
4500
|
+
* first. Used to sort each wallet option's `connectionOptions` array so the
|
|
4501
|
+
* best connection path lands at index 0. Has no bearing on how the outer
|
|
4502
|
+
* wallet-option list is ordered — that's controlled by
|
|
4503
|
+
* `WalletOptionOrdering`.
|
|
4504
|
+
*
|
|
4505
|
+
* `withWalletProvider > walletConnect / metamaskSdkUri > inAppBrowser`
|
|
4506
|
+
*/
|
|
4507
|
+
const CONNECTION_OPTION_PRIORITY = {
|
|
4508
|
+
inAppBrowser: 2,
|
|
4509
|
+
metamaskSdkUri: 1,
|
|
4510
|
+
walletConnect: 1,
|
|
4511
|
+
withWalletProvider: 0
|
|
4512
|
+
};
|
|
4513
|
+
/**
|
|
4514
|
+
* Returns the numeric priority of a `WalletConnectionOption` for sorting.
|
|
4515
|
+
* Lower numbers rank first.
|
|
4516
|
+
*
|
|
4517
|
+
* @param params.option - The connection option to inspect.
|
|
4518
|
+
* @returns The numeric priority — lower is better.
|
|
4519
|
+
* @not-instrumented
|
|
4520
|
+
*/
|
|
4521
|
+
const getConnectionOptionPriority = ({ option }) => CONNECTION_OPTION_PRIORITY[option.type];
|
|
4522
|
+
|
|
4523
|
+
//#endregion
|
|
4524
|
+
//#region src/modules/walletOptionsCatalogue/sortConnectionOptions/sortConnectionOptions.ts
|
|
4525
|
+
/**
|
|
4526
|
+
* Sorts a wallet option's `connectionOptions` so the most preferred option lands at
|
|
4527
|
+
* index 0. Primary sort is by option-type priority
|
|
4528
|
+
* (`withWalletProvider` > URI deeplink > `inAppBrowser`);
|
|
4529
|
+
* within a type, ties break alphabetically by `chain` for deterministic
|
|
4530
|
+
* output across calls.
|
|
4531
|
+
*
|
|
4532
|
+
* Returns a new array — the input is not mutated.
|
|
4533
|
+
*
|
|
4534
|
+
* @param params.options - The options to sort.
|
|
4535
|
+
* @returns A new array in priority order.
|
|
4536
|
+
* @not-instrumented
|
|
4537
|
+
*/
|
|
4538
|
+
const sortConnectionOptions = ({ options }) => [...options].sort((a, b) => {
|
|
4539
|
+
const priorityDelta = getConnectionOptionPriority({ option: a }) - getConnectionOptionPriority({ option: b });
|
|
4540
|
+
if (priorityDelta !== 0) return priorityDelta;
|
|
4541
|
+
return a.chain.localeCompare(b.chain);
|
|
4542
|
+
});
|
|
4543
|
+
|
|
4544
|
+
//#endregion
|
|
4545
|
+
//#region src/modules/legacyWalletBook/priorityWalletKeys/priorityWalletKeys.ts
|
|
4546
|
+
/**
|
|
4547
|
+
* Hand-curated list of wallet book group keys that should surface at the top
|
|
4548
|
+
* of catalogue listings. Lower index = higher priority. Anything not in this
|
|
4549
|
+
* list falls through to the secondary sort (alphabetical by name).
|
|
4550
|
+
*
|
|
4551
|
+
* Used by `sortWalletOptions` (relevance mode) and by the react-demo's
|
|
4552
|
+
* WalletConnect picker. Keep both in sync when adding entries.
|
|
4553
|
+
*/
|
|
4554
|
+
const PRIORITY_WALLET_KEYS = [
|
|
4555
|
+
"metamask",
|
|
4556
|
+
"coinbase",
|
|
4557
|
+
"baseaccount",
|
|
4558
|
+
"phantom",
|
|
4559
|
+
"magiceden",
|
|
4560
|
+
"trust",
|
|
4561
|
+
"okxwallet",
|
|
4562
|
+
"rainbow",
|
|
4563
|
+
"argentx",
|
|
4564
|
+
"backpack",
|
|
4565
|
+
"xverse",
|
|
4566
|
+
"onekey",
|
|
4567
|
+
"solflare",
|
|
4568
|
+
"braavos",
|
|
4569
|
+
"brave",
|
|
4570
|
+
"unisat",
|
|
4571
|
+
"bitgetwallet",
|
|
4572
|
+
"coin98"
|
|
4573
|
+
];
|
|
4574
|
+
|
|
4575
|
+
//#endregion
|
|
4576
|
+
//#region src/modules/walletOptionsCatalogue/getPriorityIndex/getPriorityIndex.ts
|
|
4577
|
+
/**
|
|
4578
|
+
* Returns the index of a wallet option in `PRIORITY_WALLET_KEYS`, or
|
|
4579
|
+
* `Number.POSITIVE_INFINITY` when the wallet is not in the hand-curated
|
|
4580
|
+
* priority list. Lower index = higher priority.
|
|
4581
|
+
*
|
|
4582
|
+
* @param params.walletOption - The wallet option to inspect.
|
|
4583
|
+
* @returns Numeric priority index — lower is better.
|
|
4584
|
+
* @not-instrumented
|
|
4585
|
+
*/
|
|
4586
|
+
const getPriorityIndex = ({ walletOption }) => {
|
|
4587
|
+
const index = PRIORITY_WALLET_KEYS.indexOf(walletOption.key);
|
|
4588
|
+
return index === -1 ? Number.POSITIVE_INFINITY : index;
|
|
4589
|
+
};
|
|
4590
|
+
|
|
4591
|
+
//#endregion
|
|
4592
|
+
//#region src/modules/walletOptionsCatalogue/compareByRelevance/compareByRelevance.ts
|
|
4593
|
+
/**
|
|
4594
|
+
* Compares two wallet options for relevance ordering: priority-list index
|
|
4595
|
+
* first, then alphabetical-by-name as the tie-break. Suitable for passing
|
|
4596
|
+
* straight to `Array.prototype.sort`.
|
|
4597
|
+
*
|
|
4598
|
+
* @param params.a - First wallet option.
|
|
4599
|
+
* @param params.b - Second wallet option.
|
|
4600
|
+
* @returns Negative when `a` ranks first, positive when `b` ranks first.
|
|
4601
|
+
* @not-instrumented
|
|
4602
|
+
*/
|
|
4603
|
+
const compareByRelevance = ({ a, b }) => {
|
|
4604
|
+
const aIndex = getPriorityIndex({ walletOption: a });
|
|
4605
|
+
const bIndex = getPriorityIndex({ walletOption: b });
|
|
4606
|
+
if (aIndex !== bIndex) return aIndex - bIndex;
|
|
4607
|
+
return a.name.localeCompare(b.name, void 0, { sensitivity: "base" });
|
|
4608
|
+
};
|
|
4609
|
+
|
|
4610
|
+
//#endregion
|
|
4611
|
+
//#region src/modules/walletOptionsCatalogue/hasAnyConnectionOption/hasAnyConnectionOption.ts
|
|
4612
|
+
/**
|
|
4613
|
+
* True when the wallet option has at least one connection — i.e. the user
|
|
4614
|
+
* can sign in right now. Install-only wallet options surface in the
|
|
4615
|
+
* catalogue too (they carry `installationUrls`) but have an empty
|
|
4616
|
+
* `connectionOptions` array; this predicate distinguishes them from
|
|
4617
|
+
* actually connectable wallets in the relevance sort.
|
|
4618
|
+
*
|
|
4619
|
+
* @param params.walletOption - The wallet option to inspect.
|
|
4620
|
+
* @returns True when `connectionOptions` is non-empty.
|
|
4621
|
+
* @not-instrumented
|
|
4622
|
+
*/
|
|
4623
|
+
const hasAnyConnectionOption = ({ walletOption }) => walletOption.connectionOptions.length > 0;
|
|
4624
|
+
|
|
4625
|
+
//#endregion
|
|
4626
|
+
//#region src/modules/walletOptionsCatalogue/hasInstalledProvider/hasInstalledProvider.ts
|
|
4627
|
+
/**
|
|
4628
|
+
* True when the wallet option has a `withWalletProvider` connection — i.e.
|
|
4629
|
+
* the user already has the wallet available in the page (browser extension,
|
|
4630
|
+
* Wallet Standard announcement, window injection, or an SDK-backed provider
|
|
4631
|
+
* one of our chain extensions registered). `connectionOptions` is
|
|
4632
|
+
* pre-sorted, so a registered provider always sits at index 0 when present.
|
|
4633
|
+
*
|
|
4634
|
+
* @param params.walletOption - The wallet option to inspect.
|
|
4635
|
+
* @returns True when an installed provider is available.
|
|
4636
|
+
* @not-instrumented
|
|
4637
|
+
*/
|
|
4638
|
+
const hasInstalledProvider = ({ walletOption }) => walletOption.connectionOptions[0]?.type === "withWalletProvider";
|
|
4639
|
+
|
|
4640
|
+
//#endregion
|
|
4641
|
+
//#region src/modules/walletOptionsCatalogue/sortWalletOptions/sortWalletOptions.ts
|
|
4642
|
+
/**
|
|
4643
|
+
* Sorts the outer wallet-option list. This is the only ordering controlled
|
|
4644
|
+
* by the customer; the inner `connectionOptions` array of each wallet
|
|
4645
|
+
* option is ordered separately by `sortConnectionOptions` using a fixed
|
|
4646
|
+
* option-type priority.
|
|
4647
|
+
*
|
|
4648
|
+
* - `'relevance'` (default): bucket wallet options into three tiers, in
|
|
4649
|
+
* this order:
|
|
4650
|
+
* 1. **Installed provider** — user already has the wallet available
|
|
4651
|
+
* (`withWalletProvider` at index 0).
|
|
4652
|
+
* 2. **Connectable** — has at least one connection (URI deeplink
|
|
4653
|
+
* or `inAppBrowser`) but no installed provider.
|
|
4654
|
+
* 3. **Install-only** — no connection at all; only `installationUrls`.
|
|
4655
|
+
* Within each tier, rank by the hand-curated {@link PRIORITY_WALLET_KEYS}
|
|
4656
|
+
* list (MetaMask, Coinbase, Phantom, …); unknown wallets fall through to
|
|
4657
|
+
* alphabetical-by-name order at the tail of their tier.
|
|
4658
|
+
* - `'alphabetical'`: case-insensitive sort by wallet option `name`,
|
|
4659
|
+
* without bucketing.
|
|
4660
|
+
*
|
|
4661
|
+
* Returns a new array — the input is not mutated.
|
|
4662
|
+
*
|
|
4663
|
+
* @param params.walletOptions - The wallet options to sort.
|
|
4664
|
+
* @param params.ordering - The requested ordering.
|
|
4665
|
+
* @returns A new array in the requested order.
|
|
4666
|
+
* @not-instrumented
|
|
4667
|
+
*/
|
|
4668
|
+
const sortWalletOptions = ({ walletOptions, ordering }) => {
|
|
4669
|
+
if (ordering === "alphabetical") return [...walletOptions].sort((a, b) => a.name.localeCompare(b.name, void 0, { sensitivity: "base" }));
|
|
4670
|
+
const installed = [];
|
|
4671
|
+
const connectable = [];
|
|
4672
|
+
const installOnly = [];
|
|
4673
|
+
for (const walletOption of walletOptions) if (hasInstalledProvider({ walletOption })) installed.push(walletOption);
|
|
4674
|
+
else if (hasAnyConnectionOption({ walletOption })) connectable.push(walletOption);
|
|
4675
|
+
else installOnly.push(walletOption);
|
|
4676
|
+
installed.sort((a, b) => compareByRelevance({
|
|
4677
|
+
a,
|
|
4678
|
+
b
|
|
4679
|
+
}));
|
|
4680
|
+
connectable.sort((a, b) => compareByRelevance({
|
|
4681
|
+
a,
|
|
4682
|
+
b
|
|
4683
|
+
}));
|
|
4684
|
+
installOnly.sort((a, b) => compareByRelevance({
|
|
4685
|
+
a,
|
|
4686
|
+
b
|
|
4687
|
+
}));
|
|
4688
|
+
return [
|
|
4689
|
+
...installed,
|
|
4690
|
+
...connectable,
|
|
4691
|
+
...installOnly
|
|
4692
|
+
];
|
|
4693
|
+
};
|
|
4694
|
+
|
|
4695
|
+
//#endregion
|
|
4696
|
+
//#region src/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.ts
|
|
4697
|
+
const EMPTY_WALLET_BOOK = {
|
|
4698
|
+
groups: {},
|
|
4699
|
+
wallets: {}
|
|
4700
|
+
};
|
|
4701
|
+
/**
|
|
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.
|
|
4706
|
+
*
|
|
4707
|
+
* @param [params] - Inclusion flag + ordering preference.
|
|
4708
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4709
|
+
* @returns A promise that resolves to the wallet options catalogue.
|
|
4710
|
+
* @not-instrumented
|
|
4711
|
+
*/
|
|
4712
|
+
const getWalletOptionsCatalogue = async (params = {}, client = getDefaultClient()) => {
|
|
4713
|
+
const includeMobileOptions = params.includeMobileOptions ?? false;
|
|
4714
|
+
const walletOptionOrdering = params.walletOptionOrdering ?? "relevance";
|
|
4715
|
+
const walletBook = includeMobileOptions ? await fetchLegacyWalletBook(client) : EMPTY_WALLET_BOOK;
|
|
4716
|
+
const allConnectionOptions = [];
|
|
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();
|
|
4724
|
+
const grouped = groupOptionsByWalletOption({ options: allConnectionOptions });
|
|
4725
|
+
const allWalletOptionKeys = new Set([...grouped.keys(), ...installationUrlsByKey.keys()]);
|
|
4726
|
+
const walletOptions = [];
|
|
4727
|
+
for (const walletOptionKey of allWalletOptionKeys) {
|
|
4728
|
+
if (EXCLUDED_WALLET_OPTION_KEYS.has(walletOptionKey)) continue;
|
|
4729
|
+
const groupedEntry = grouped.get(walletOptionKey);
|
|
4730
|
+
const connectionOptions = groupedEntry ? sortConnectionOptions({ options: groupedEntry.connectionOptions }) : [];
|
|
4731
|
+
walletOptions.push(buildWalletOption({
|
|
4732
|
+
connectionOptions,
|
|
4733
|
+
displayOverride: groupedEntry?.displayOverride,
|
|
4734
|
+
installationUrls: installationUrlsByKey.get(walletOptionKey),
|
|
4735
|
+
walletBook,
|
|
4736
|
+
walletOptionKey
|
|
4737
|
+
}));
|
|
4738
|
+
}
|
|
4739
|
+
return sortWalletOptions({
|
|
4740
|
+
ordering: walletOptionOrdering,
|
|
4741
|
+
walletOptions
|
|
4742
|
+
});
|
|
4743
|
+
};
|
|
4744
|
+
|
|
3805
4745
|
//#endregion
|
|
3806
4746
|
//#region src/modules/user/updateUser/updateUser.ts
|
|
3807
4747
|
/**
|
|
@@ -4060,6 +5000,7 @@ const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions
|
|
|
4060
5000
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4061
5001
|
* @returns A promise that resolves to the newly generated recovery codes.
|
|
4062
5002
|
* @instrumented
|
|
5003
|
+
* @redact-params
|
|
4063
5004
|
*/
|
|
4064
5005
|
const createNewMfaRecoveryCodes = async (client = getDefaultClient()) => {
|
|
4065
5006
|
const core = getCore(client);
|
|
@@ -4075,7 +5016,8 @@ const __createNewMfaRecoveryCodes_wrapped = instrumentFunction({
|
|
|
4075
5016
|
} catch {
|
|
4076
5017
|
return;
|
|
4077
5018
|
}
|
|
4078
|
-
}
|
|
5019
|
+
},
|
|
5020
|
+
redactAll: true
|
|
4079
5021
|
});
|
|
4080
5022
|
|
|
4081
5023
|
//#endregion
|
|
@@ -5302,6 +6244,7 @@ const verifyOTPForUserUpdate = async ({ otpVerification, verificationToken, requ
|
|
|
5302
6244
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
5303
6245
|
* @returns A promise that resolves to the verify response object upon successful verification.
|
|
5304
6246
|
* @instrumented
|
|
6247
|
+
* @redact-params
|
|
5305
6248
|
*/
|
|
5306
6249
|
const verifyOTP = async ({ otpVerification, verificationToken, requestedScopes }, client = getDefaultClient()) => {
|
|
5307
6250
|
let response;
|
|
@@ -5327,7 +6270,8 @@ const __verifyOTP_wrapped = instrumentFunction({
|
|
|
5327
6270
|
} catch {
|
|
5328
6271
|
return;
|
|
5329
6272
|
}
|
|
5330
|
-
}
|
|
6273
|
+
},
|
|
6274
|
+
redactAll: true
|
|
5331
6275
|
});
|
|
5332
6276
|
|
|
5333
6277
|
//#endregion
|
|
@@ -5751,13 +6695,12 @@ const getAddressesWithTypesFromConnectionResult = (connectionResult) => {
|
|
|
5751
6695
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
5752
6696
|
* @returns A promise that resolves to the connected wallet account.
|
|
5753
6697
|
* @throws NoAddressFoundError If the request to connect was successful but no address is connected to your app.
|
|
5754
|
-
*
|
|
6698
|
+
* @instrumented
|
|
5755
6699
|
*/
|
|
5756
6700
|
const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWalletAccounts = true, hardwareWalletVendor }, client = getDefaultClient()) => {
|
|
5757
6701
|
const walletProvider = getWalletProviderByKey({ walletProviderKey }, client);
|
|
5758
6702
|
assertWalletProviderMethodDefined(walletProvider, "connect");
|
|
5759
6703
|
const { addresses } = await walletProvider.connect();
|
|
5760
|
-
const currentAddresses = getWalletAccounts(client).map(({ address }) => address);
|
|
5761
6704
|
const mainAddress = addresses?.length ? addresses[0].address : null;
|
|
5762
6705
|
/**
|
|
5763
6706
|
* This error is thrown in case the wallet has no addresses connected
|
|
@@ -5765,27 +6708,25 @@ const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWallet
|
|
|
5765
6708
|
* user on the next steps.
|
|
5766
6709
|
*/
|
|
5767
6710
|
if (!mainAddress) throw new NoAddressFoundError();
|
|
5768
|
-
const
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
chain: walletProvider.chain,
|
|
5772
|
-
hardwareWalletVendor,
|
|
5773
|
-
id: formatWalletAccountId({
|
|
6711
|
+
const [reconciledWalletAccount] = reconcileWalletAccountsAgainstClient({
|
|
6712
|
+
addToDynamicWalletAccounts,
|
|
6713
|
+
walletAccounts: [{
|
|
5774
6714
|
address: mainAddress,
|
|
6715
|
+
addressesWithTypes: getAddressesWithTypesFromConnectionResult({ addresses }),
|
|
5775
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,
|
|
5776
6725
|
walletProviderKey
|
|
5777
|
-
}
|
|
5778
|
-
lastSelectedAt: null,
|
|
5779
|
-
verifiedCredentialId: null,
|
|
6726
|
+
}],
|
|
5780
6727
|
walletProviderKey
|
|
5781
|
-
};
|
|
5782
|
-
|
|
5783
|
-
if (addToDynamicWalletAccounts) {
|
|
5784
|
-
setUnverifiedWalletAccounts({ unverifiedWalletAccountsToUpdate: [walletAccount] }, client);
|
|
5785
|
-
emitWalletAccountsChangedEvent(client);
|
|
5786
|
-
createVisit({ walletAccount }, client);
|
|
5787
|
-
}
|
|
5788
|
-
return walletAccount;
|
|
6728
|
+
}, client);
|
|
6729
|
+
return reconciledWalletAccount;
|
|
5789
6730
|
};
|
|
5790
6731
|
const __connectWithWalletProvider_impl = connectWithWalletProvider;
|
|
5791
6732
|
const __connectWithWalletProvider_wrapped = instrumentFunction({
|
|
@@ -6716,5 +7657,5 @@ const parseUserAgent = ({ userAgent }) => {
|
|
|
6716
7657
|
assertPackageVersion(name, version);
|
|
6717
7658
|
|
|
6718
7659
|
//#endregion
|
|
6719
|
-
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, 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 };
|
|
6720
7661
|
//# sourceMappingURL=index.esm.js.map
|