@dynamic-labs-sdk/client 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{InvalidParamError-Za4cvW7K.esm.js → InvalidParamError-BPMi0iWC.esm.js} +55 -6
- package/dist/InvalidParamError-BPMi0iWC.esm.js.map +1 -0
- package/dist/{InvalidParamError-9kQBK3sP.native.esm.js → InvalidParamError-CDmVW2DS.native.esm.js} +55 -6
- package/dist/InvalidParamError-CDmVW2DS.native.esm.js.map +1 -0
- package/dist/{InvalidParamError-DQvZQdQ9.cjs → InvalidParamError-DEmLKJKZ.cjs} +61 -6
- package/dist/InvalidParamError-DEmLKJKZ.cjs.map +1 -0
- package/dist/{NotWaasWalletAccountError-Ciq7b-Y6.cjs → NotWaasWalletAccountError-BZsBHRQe.cjs} +6 -4
- package/dist/NotWaasWalletAccountError-BZsBHRQe.cjs.map +1 -0
- package/dist/{NotWaasWalletAccountError-By3Y4taq.esm.js → NotWaasWalletAccountError-Chpne8_Q.native.esm.js} +6 -4
- package/dist/NotWaasWalletAccountError-Chpne8_Q.native.esm.js.map +1 -0
- package/dist/{NotWaasWalletAccountError-BTMvHTA8.native.esm.js → NotWaasWalletAccountError-Cntietge.esm.js} +6 -4
- package/dist/NotWaasWalletAccountError-Cntietge.esm.js.map +1 -0
- package/dist/core.cjs +6 -5
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +6 -6
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +6 -6
- package/dist/core.native.esm.js.map +1 -1
- package/dist/exports/core.d.ts +2 -0
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/exports/index.d.ts +2 -1
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-RWcIZDgC.esm.js → getNetworkProviderFromNetworkId-CEeFL-gV.esm.js} +72 -16
- package/dist/getNetworkProviderFromNetworkId-CEeFL-gV.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-COptFPwJ.native.esm.js → getNetworkProviderFromNetworkId-JGrKwBj7.native.esm.js} +72 -16
- package/dist/getNetworkProviderFromNetworkId-JGrKwBj7.native.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-BA0CHZzu.cjs → getNetworkProviderFromNetworkId-szJOsbQN.cjs} +77 -15
- package/dist/getNetworkProviderFromNetworkId-szJOsbQN.cjs.map +1 -0
- package/dist/{getSignedSessionId-DzNCj6g_.native.esm.js → getSignedSessionId-B5DikCap.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-DzNCj6g_.native.esm.js.map → getSignedSessionId-B5DikCap.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-la6RXITX.esm.js → getSignedSessionId-BOx1nFt_.esm.js} +3 -3
- package/dist/{getSignedSessionId-la6RXITX.esm.js.map → getSignedSessionId-BOx1nFt_.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-BCU987hO.cjs → getSignedSessionId-BxOK-Tdo.cjs} +3 -3
- package/dist/{getSignedSessionId-BCU987hO.cjs.map → getSignedSessionId-BxOK-Tdo.cjs.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-DSSDwOyq.cjs → getVerifiedCredentialForWalletAccount-B46O0B48.cjs} +3 -3
- package/dist/{getVerifiedCredentialForWalletAccount-DSSDwOyq.cjs.map → getVerifiedCredentialForWalletAccount-B46O0B48.cjs.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-DKJcLLHq.native.esm.js → getVerifiedCredentialForWalletAccount-CyykSi-M.native.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-DKJcLLHq.native.esm.js.map → getVerifiedCredentialForWalletAccount-CyykSi-M.native.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-Ozctwnyv.esm.js → getVerifiedCredentialForWalletAccount-DzwIoeHm.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-Ozctwnyv.esm.js.map → getVerifiedCredentialForWalletAccount-DzwIoeHm.esm.js.map} +1 -1
- package/dist/index.cjs +225 -117
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +225 -118
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +225 -118
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-CMClgbT0.cjs → isMfaRequiredForAction-6N6JB7wa.cjs} +5 -3
- package/dist/isMfaRequiredForAction-6N6JB7wa.cjs.map +1 -0
- package/dist/{isMfaRequiredForAction-DSX-TV2z.native.esm.js → isMfaRequiredForAction-D9p_du8C.esm.js} +5 -3
- package/dist/isMfaRequiredForAction-D9p_du8C.esm.js.map +1 -0
- package/dist/{isMfaRequiredForAction-C1u4Z__n.esm.js → isMfaRequiredForAction-DUvZEpjA.native.esm.js} +5 -3
- package/dist/isMfaRequiredForAction-DUvZEpjA.native.esm.js.map +1 -0
- package/dist/modules/auth/externalAuth/requestExternalAuthElevatedToken/requestExternalAuthElevatedToken.d.ts +1 -0
- package/dist/modules/auth/externalAuth/requestExternalAuthElevatedToken/requestExternalAuthElevatedToken.d.ts.map +1 -1
- package/dist/modules/auth/passkeys/registerPasskey/registerPasskey.d.ts +2 -1
- package/dist/modules/auth/passkeys/registerPasskey/registerPasskey.d.ts.map +1 -1
- package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts +1 -0
- package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/unlinkSocialAccount/unlinkSocialAccount.d.ts +2 -1
- package/dist/modules/auth/social/oauth/unlinkSocialAccount/unlinkSocialAccount.d.ts.map +1 -1
- package/dist/modules/captcha/setCaptchaToken/setCaptchaToken.d.ts +2 -1
- package/dist/modules/captcha/setCaptchaToken/setCaptchaToken.d.ts.map +1 -1
- package/dist/modules/checkout/attachCheckoutTransactionSource/attachCheckoutTransactionSource.d.ts.map +1 -1
- package/dist/modules/checkout/broadcastCheckoutTransaction/broadcastCheckoutTransaction.d.ts +1 -1
- package/dist/modules/checkout/broadcastCheckoutTransaction/broadcastCheckoutTransaction.d.ts.map +1 -1
- package/dist/modules/checkout/cancelCheckoutTransaction/cancelCheckoutTransaction.d.ts +1 -1
- package/dist/modules/checkout/cancelCheckoutTransaction/cancelCheckoutTransaction.d.ts.map +1 -1
- package/dist/modules/checkout/getCheckoutTransactionQuote/getCheckoutTransactionQuote.d.ts.map +1 -1
- package/dist/modules/checkout/prepareCheckoutTransaction/prepareCheckoutTransaction.d.ts.map +1 -1
- package/dist/modules/checkout/utils/clearCheckoutSessionToken/clearCheckoutSessionToken.d.ts +22 -0
- package/dist/modules/checkout/utils/clearCheckoutSessionToken/clearCheckoutSessionToken.d.ts.map +1 -0
- package/dist/modules/checkout/utils/clearCheckoutSessionToken/index.d.ts +3 -0
- package/dist/modules/checkout/utils/clearCheckoutSessionToken/index.d.ts.map +1 -0
- package/dist/modules/checkout/utils/subscribeToCheckoutTransaction/subscribeToCheckoutTransaction.d.ts.map +1 -1
- package/dist/modules/checkout/utils/withCheckoutSessionTokenCleanupOn401/index.d.ts +3 -0
- package/dist/modules/checkout/utils/withCheckoutSessionTokenCleanupOn401/index.d.ts.map +1 -0
- package/dist/modules/checkout/utils/withCheckoutSessionTokenCleanupOn401/withCheckoutSessionTokenCleanupOn401.d.ts +16 -0
- package/dist/modules/checkout/utils/withCheckoutSessionTokenCleanupOn401/withCheckoutSessionTokenCleanupOn401.d.ts.map +1 -0
- package/dist/modules/mfa/consumeMfaToken/consumeMfaToken.d.ts +2 -1
- package/dist/modules/mfa/consumeMfaToken/consumeMfaToken.d.ts.map +1 -1
- package/dist/modules/mfa/createNewMfaRecoveryCodes/createNewMfaRecoveryCodes.d.ts +2 -1
- package/dist/modules/mfa/createNewMfaRecoveryCodes/createNewMfaRecoveryCodes.d.ts.map +1 -1
- package/dist/modules/otp/verifyOTP/verifyOTP.d.ts +2 -1
- package/dist/modules/otp/verifyOTP/verifyOTP.d.ts.map +1 -1
- package/dist/modules/user/refreshAuth/refreshAuth.d.ts +2 -1
- package/dist/modules/user/refreshAuth/refreshAuth.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/buildUriDeeplinkOptions.d.ts +28 -0
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/buildUriDeeplinkOptions.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/index.d.ts +2 -0
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/index.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/index.d.ts +2 -0
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/index.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/resolveUriConnectionType.d.ts +17 -0
- package/dist/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/resolveUriConnectionType.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/getConnectionOptionPriority/getConnectionOptionPriority.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts +5 -15
- package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/resolveWalletBookWalletOptionKey/resolveWalletBookWalletOptionKey.d.ts +1 -1
- package/dist/modules/walletOptionsCatalogue/sortConnectionOptions/sortConnectionOptions.d.ts +1 -1
- package/dist/modules/walletOptionsCatalogue/sortWalletOptions/sortWalletOptions.d.ts +1 -1
- package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts +25 -37
- package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts.map +1 -1
- package/dist/modules/wallets/connectWithWalletProvider/connectWithWalletProvider.d.ts +1 -1
- package/dist/modules/wallets/connectWithWalletProvider/connectWithWalletProvider.d.ts.map +1 -1
- package/dist/modules/wallets/reconcileWalletAccountsAgainstClient/index.d.ts +2 -0
- package/dist/modules/wallets/reconcileWalletAccountsAgainstClient/index.d.ts.map +1 -0
- package/dist/modules/wallets/reconcileWalletAccountsAgainstClient/reconcileWalletAccountsAgainstClient.d.ts +25 -0
- package/dist/modules/wallets/reconcileWalletAccountsAgainstClient/reconcileWalletAccountsAgainstClient.d.ts.map +1 -0
- package/dist/services/instrumentation/connectLoggerToInstrumentation/connectLoggerToInstrumentation.d.ts.map +1 -1
- package/dist/services/instrumentation/constants.d.ts +22 -0
- package/dist/services/instrumentation/constants.d.ts.map +1 -1
- package/dist/services/instrumentation/scrubParameters/scrubParameters.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/appendConnectionUriToDeeplink/appendConnectionUriToDeeplink.d.ts +29 -0
- package/dist/utils/appendConnectionUriToDeeplink/appendConnectionUriToDeeplink.d.ts.map +1 -0
- package/dist/utils/appendConnectionUriToDeeplink/index.d.ts +2 -0
- package/dist/utils/appendConnectionUriToDeeplink/index.d.ts.map +1 -0
- package/dist/waas.cjs +4 -4
- package/dist/waas.esm.js +3 -3
- package/dist/waas.native.esm.js +3 -3
- package/dist/waasCore.cjs +4 -4
- package/dist/waasCore.esm.js +3 -3
- package/dist/waasCore.native.esm.js +3 -3
- package/package.json +2 -2
- package/dist/InvalidParamError-9kQBK3sP.native.esm.js.map +0 -1
- package/dist/InvalidParamError-DQvZQdQ9.cjs.map +0 -1
- package/dist/InvalidParamError-Za4cvW7K.esm.js.map +0 -1
- package/dist/NotWaasWalletAccountError-BTMvHTA8.native.esm.js.map +0 -1
- package/dist/NotWaasWalletAccountError-By3Y4taq.esm.js.map +0 -1
- package/dist/NotWaasWalletAccountError-Ciq7b-Y6.cjs.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-BA0CHZzu.cjs.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-COptFPwJ.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-RWcIZDgC.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-C1u4Z__n.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-CMClgbT0.cjs.map +0 -1
- package/dist/isMfaRequiredForAction-DSX-TV2z.native.esm.js.map +0 -1
- package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts +0 -23
- package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts.map +0 -1
package/dist/index.native.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { A as
|
|
3
|
-
import { A as onceEvent, C as formatWalletAccountId, D as emitEvent, O as offEvent, T as splitWalletProviderKey, _ as getWalletProviderRegistry, a as parseElevatedAccessToken, b as getWalletAccounts, d as isUserMissingMfaAuth, f as checkAndRaiseWalletAccountsChangedEvent, g as WalletProviderPriority, h as getWalletProviderFromWalletAccount, i as upsertElevatedAccessToken, k as onEvent, n as getWalletProviderByKey, o as restoreUserSharesForAllWalletAccounts,
|
|
4
|
-
import { n as __refreshAuth_wrapped, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-
|
|
5
|
-
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-
|
|
1
|
+
import { A as getUserAgent, B as getCore, C as isCookieEnabled, D as instrumentFunction, E as __getElevatedAccessToken_wrapped, F as NONCE_POOL_SIZE, H as version, I as getDefaultClient, L as setDefaultClient, M as randomString, O as scrubParameters, T as ValueMustBeDefinedError, V as name, _ as MfaRateLimitedError, a as DYNAMIC_ICONIC_SPRITE_URL, b as InvalidExternalAuthError, c as CHAINS_INFO_MAP, d as UnauthorizedError, g as SandboxMaximumThresholdReachedError, h as getNonce, j as extractSessionId, k as DEFAULT_PII_FIELDS, l as fetchAndStoreNonces, o as SDK_API_CORE_VERSION, s as getChainFromVerifiedCredentialChain, t as InvalidParamError, u as createApiClient, v as MfaInvalidOtpError, w as assertDefined, x as APIError, y as LinkCredentialError, z as BaseError } from "./InvalidParamError-CDmVW2DS.native.esm.js";
|
|
2
|
+
import { A as FETCH_PROJECT_SETTINGS_TRACKER_KEY, B as createStorageKeySchema, C as createKeychainService, E as createCrossTabBroadcast, F as isServerSideRendering, G as retryOnFail, I as getBuffer, K as subscribeWithSelector, L as __logoutWithReason_wrapped, M as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, N as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, O as CannotTrackError, P as REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY, R as generateSessionKeys, S as createRealtimeService, T as createLogger, U as createLocalStorageAdapter, V as createStorage, W as isSignedIn, _ as getAppMetadata, a as verifyMessageSignatureOwnership, b as NoNetworkProvidersError, c as formatSignInMessage, d as setUnverifiedWalletAccounts, f as createVisit, g as isCaptchaRequired, h as consumeCaptchaToken, i as getNetworksData, j as GENERATE_SESSION_KEYS_TRACKER_KEY, k as createDeferredPromise, l as reconcileWalletAccountsAgainstClient, m as __setCaptchaToken_wrapped, o as removeUnverifiedWalletAccount, p as hasExtension, q as isEqualShallow, s as createSignInMessageStatement, t as getNetworkProviderFromNetworkId, u as updateWalletProviderKeysForVerifiedCredentials, v as MethodNotImplementedError, x as getKeychainIndexedDBName, y as WalletAlreadyLinkedToAnotherUserError, z as fetchProjectSettings } from "./getNetworkProviderFromNetworkId-JGrKwBj7.native.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-CyykSi-M.native.esm.js";
|
|
4
|
+
import { n as __refreshAuth_wrapped, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-Chpne8_Q.native.esm.js";
|
|
5
|
+
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-DUvZEpjA.native.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,
|
|
@@ -1615,6 +1648,7 @@ const __checkStepUpAuth_wrapped = instrumentFunction({
|
|
|
1615
1648
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1616
1649
|
* @returns A promise that resolves to the assertion response containing the elevated access token.
|
|
1617
1650
|
* @instrumented
|
|
1651
|
+
* @redact-params
|
|
1618
1652
|
*/
|
|
1619
1653
|
const requestExternalAuthElevatedToken = async ({ externalJwt }, client = getDefaultClient()) => {
|
|
1620
1654
|
const core = getCore(client);
|
|
@@ -1642,7 +1676,8 @@ const __requestExternalAuthElevatedToken_wrapped = instrumentFunction({
|
|
|
1642
1676
|
} catch {
|
|
1643
1677
|
return;
|
|
1644
1678
|
}
|
|
1645
|
-
}
|
|
1679
|
+
},
|
|
1680
|
+
redactAll: true
|
|
1646
1681
|
});
|
|
1647
1682
|
|
|
1648
1683
|
//#endregion
|
|
@@ -1794,6 +1829,7 @@ const serverRegisterPasskey = async ({ registration, createMfaToken }, client) =
|
|
|
1794
1829
|
* @returns A promise that resolves to the registration response.
|
|
1795
1830
|
* @throws NoWebAuthNSupportError If WebAuthn is not supported by the browser.
|
|
1796
1831
|
* @instrumented
|
|
1832
|
+
* @redact-params
|
|
1797
1833
|
*/
|
|
1798
1834
|
const registerPasskey = async ({ createMfaToken } = {}, client = getDefaultClient()) => {
|
|
1799
1835
|
const core = getCore(client);
|
|
@@ -1816,7 +1852,8 @@ const __registerPasskey_wrapped = instrumentFunction({
|
|
|
1816
1852
|
} catch {
|
|
1817
1853
|
return;
|
|
1818
1854
|
}
|
|
1819
|
-
}
|
|
1855
|
+
},
|
|
1856
|
+
redactAll: true
|
|
1820
1857
|
});
|
|
1821
1858
|
|
|
1822
1859
|
//#endregion
|
|
@@ -1861,6 +1898,7 @@ const serverSigninPasskey = async ({ authentication, createMfaToken }, client) =
|
|
|
1861
1898
|
* @returns A promise that resolves to the authentication response.
|
|
1862
1899
|
* @throws NoWebAuthNSupportError If WebAuthn is not supported by the browser.
|
|
1863
1900
|
* @instrumented
|
|
1901
|
+
* @redact-params
|
|
1864
1902
|
*/
|
|
1865
1903
|
const signInWithPasskey = async ({ relatedOriginRpId } = {}, client = getDefaultClient()) => {
|
|
1866
1904
|
const core = getCore(client);
|
|
@@ -1880,7 +1918,8 @@ const __signInWithPasskey_wrapped = instrumentFunction({
|
|
|
1880
1918
|
} catch {
|
|
1881
1919
|
return;
|
|
1882
1920
|
}
|
|
1883
|
-
}
|
|
1921
|
+
},
|
|
1922
|
+
redactAll: true
|
|
1884
1923
|
});
|
|
1885
1924
|
|
|
1886
1925
|
//#endregion
|
|
@@ -2337,6 +2376,7 @@ const getPrimaryWalletAccount = (client = getDefaultClient()) => {
|
|
|
2337
2376
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2338
2377
|
* @returns A promise that resolves to the verify response.
|
|
2339
2378
|
* @instrumented
|
|
2379
|
+
* @redact-params
|
|
2340
2380
|
*/
|
|
2341
2381
|
const unlinkSocialAccount = async ({ verifiedCredentialId }, client = getDefaultClient()) => {
|
|
2342
2382
|
const core = getCore(client);
|
|
@@ -2362,7 +2402,8 @@ const __unlinkSocialAccount_wrapped = instrumentFunction({
|
|
|
2362
2402
|
} catch {
|
|
2363
2403
|
return;
|
|
2364
2404
|
}
|
|
2365
|
-
}
|
|
2405
|
+
},
|
|
2406
|
+
redactAll: true
|
|
2366
2407
|
});
|
|
2367
2408
|
|
|
2368
2409
|
//#endregion
|
|
@@ -2444,6 +2485,52 @@ const createCheckoutApiClient = async ({ transactionId }, client) => {
|
|
|
2444
2485
|
};
|
|
2445
2486
|
};
|
|
2446
2487
|
|
|
2488
|
+
//#endregion
|
|
2489
|
+
//#region src/modules/checkout/utils/clearCheckoutSessionToken/clearCheckoutSessionToken.ts
|
|
2490
|
+
/**
|
|
2491
|
+
* Removes the locally stored checkout session token for the given transaction.
|
|
2492
|
+
*
|
|
2493
|
+
* The checkout session token is the anonymous credential that authorizes
|
|
2494
|
+
* mutations to a single in-flight checkout transaction. Once the transaction
|
|
2495
|
+
* has reached a terminal state (cancelled, expired, failed, completed) it can
|
|
2496
|
+
* no longer be advanced, and the token is dead weight that should not be
|
|
2497
|
+
* persisted in browser storage — leaving it around lets a later XSS payload
|
|
2498
|
+
* exfiltrate a credential with no further use, and it can also confuse the
|
|
2499
|
+
* SDK on subsequent loads into believing an active session exists.
|
|
2500
|
+
*
|
|
2501
|
+
* The server-side revocation lives in dashboard-api; this is the SDK-side
|
|
2502
|
+
* defense-in-depth.
|
|
2503
|
+
*
|
|
2504
|
+
* @not-instrumented
|
|
2505
|
+
*/
|
|
2506
|
+
const clearCheckoutSessionToken = async ({ transactionId }, client) => {
|
|
2507
|
+
await getCore(client).storage.removeItem(createCheckoutSessionTokenStorageKey(transactionId));
|
|
2508
|
+
};
|
|
2509
|
+
|
|
2510
|
+
//#endregion
|
|
2511
|
+
//#region src/modules/checkout/utils/withCheckoutSessionTokenCleanupOn401/withCheckoutSessionTokenCleanupOn401.ts
|
|
2512
|
+
/**
|
|
2513
|
+
* Checkout mutation routes are guarded server-side only by session-token
|
|
2514
|
+
* validation, so a 401 means the token is dead (revoked, expired, deleted,
|
|
2515
|
+
* or invalid). Leaving a dead token in `localStorage` widens the XSS
|
|
2516
|
+
* exfiltration surface for no benefit and makes the next SDK load attempt
|
|
2517
|
+
* requests that are guaranteed to fail.
|
|
2518
|
+
*
|
|
2519
|
+
* @not-instrumented
|
|
2520
|
+
*/
|
|
2521
|
+
const withCheckoutSessionTokenCleanupOn401 = async ({ call, transactionId }, client) => {
|
|
2522
|
+
try {
|
|
2523
|
+
return await call();
|
|
2524
|
+
} catch (error) {
|
|
2525
|
+
if (error instanceof APIError && error.status === 401) try {
|
|
2526
|
+
await clearCheckoutSessionToken({ transactionId }, client);
|
|
2527
|
+
} catch (cleanupError) {
|
|
2528
|
+
getCore(client).logger.error("Failed to clear checkout session token after 401", cleanupError);
|
|
2529
|
+
}
|
|
2530
|
+
throw error;
|
|
2531
|
+
}
|
|
2532
|
+
};
|
|
2533
|
+
|
|
2447
2534
|
//#endregion
|
|
2448
2535
|
//#region src/modules/checkout/attachCheckoutTransactionSource/attachCheckoutTransactionSource.ts
|
|
2449
2536
|
/**
|
|
@@ -2468,12 +2555,15 @@ const attachCheckoutTransactionSource = async (params, client = getDefaultClient
|
|
|
2468
2555
|
attachSourceRequest.fromChainId = params.fromChainId;
|
|
2469
2556
|
attachSourceRequest.fromChainName = params.fromChainName;
|
|
2470
2557
|
}
|
|
2471
|
-
return
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2558
|
+
return withCheckoutSessionTokenCleanupOn401({
|
|
2559
|
+
call: () => apiClient.attachSource({
|
|
2560
|
+
attachSourceRequest,
|
|
2561
|
+
environmentId,
|
|
2562
|
+
transactionId,
|
|
2563
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
2564
|
+
}),
|
|
2565
|
+
transactionId
|
|
2566
|
+
}, client);
|
|
2477
2567
|
};
|
|
2478
2568
|
const __attachCheckoutTransactionSource_impl = attachCheckoutTransactionSource;
|
|
2479
2569
|
const __attachCheckoutTransactionSource_wrapped = instrumentFunction({
|
|
@@ -2504,12 +2594,15 @@ const __attachCheckoutTransactionSource_wrapped = instrumentFunction({
|
|
|
2504
2594
|
*/
|
|
2505
2595
|
const broadcastCheckoutTransaction = async ({ transactionId, txHash }, client = getDefaultClient()) => {
|
|
2506
2596
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
2507
|
-
return
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2597
|
+
return withCheckoutSessionTokenCleanupOn401({
|
|
2598
|
+
call: () => apiClient.recordCheckoutBroadcast({
|
|
2599
|
+
environmentId,
|
|
2600
|
+
recordBroadcastRequest: { txHash },
|
|
2601
|
+
transactionId,
|
|
2602
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
2603
|
+
}),
|
|
2604
|
+
transactionId
|
|
2605
|
+
}, client);
|
|
2513
2606
|
};
|
|
2514
2607
|
const __broadcastCheckoutTransaction_impl = broadcastCheckoutTransaction;
|
|
2515
2608
|
const __broadcastCheckoutTransaction_wrapped = instrumentFunction({
|
|
@@ -2536,12 +2629,15 @@ const __broadcastCheckoutTransaction_wrapped = instrumentFunction({
|
|
|
2536
2629
|
*/
|
|
2537
2630
|
const cancelCheckoutTransaction = async ({ transactionId }, client = getDefaultClient()) => {
|
|
2538
2631
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
2539
|
-
const result = await
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2632
|
+
const result = await withCheckoutSessionTokenCleanupOn401({
|
|
2633
|
+
call: () => apiClient.cancelCheckoutTransaction({
|
|
2634
|
+
environmentId,
|
|
2635
|
+
transactionId,
|
|
2636
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
2637
|
+
}),
|
|
2638
|
+
transactionId
|
|
2639
|
+
}, client);
|
|
2640
|
+
await clearCheckoutSessionToken({ transactionId }, client);
|
|
2545
2641
|
return result;
|
|
2546
2642
|
};
|
|
2547
2643
|
const __cancelCheckoutTransaction_impl = cancelCheckoutTransaction;
|
|
@@ -2642,16 +2738,19 @@ const getCheckoutTransaction = async ({ transactionId }, client = getDefaultClie
|
|
|
2642
2738
|
*/
|
|
2643
2739
|
const getCheckoutTransactionQuote = async ({ fromChainId, fromTokenAddress, slippage, transactionId }, client = getDefaultClient()) => {
|
|
2644
2740
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
2645
|
-
return
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2741
|
+
return withCheckoutSessionTokenCleanupOn401({
|
|
2742
|
+
call: () => apiClient.quoteCheckoutTransaction({
|
|
2743
|
+
environmentId,
|
|
2744
|
+
quoteRequest: {
|
|
2745
|
+
fromChainId,
|
|
2746
|
+
fromTokenAddress,
|
|
2747
|
+
slippage
|
|
2748
|
+
},
|
|
2749
|
+
transactionId,
|
|
2750
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
2751
|
+
}),
|
|
2752
|
+
transactionId
|
|
2753
|
+
}, client);
|
|
2655
2754
|
};
|
|
2656
2755
|
|
|
2657
2756
|
//#endregion
|
|
@@ -2668,15 +2767,18 @@ const getCheckoutTransactionQuote = async ({ fromChainId, fromTokenAddress, slip
|
|
|
2668
2767
|
*/
|
|
2669
2768
|
const prepareCheckoutTransaction = async ({ assertBalanceForGasCost, assertBalanceForTransferAmount, transactionId }, client = getDefaultClient()) => {
|
|
2670
2769
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
2671
|
-
return
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2770
|
+
return withCheckoutSessionTokenCleanupOn401({
|
|
2771
|
+
call: () => apiClient.prepareCheckoutTransaction({
|
|
2772
|
+
environmentId,
|
|
2773
|
+
prepareSigningRequest: {
|
|
2774
|
+
assertBalanceForGasCost: assertBalanceForGasCost ?? false,
|
|
2775
|
+
assertBalanceForTransferAmount: assertBalanceForTransferAmount ?? false
|
|
2776
|
+
},
|
|
2777
|
+
transactionId,
|
|
2778
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
2779
|
+
}),
|
|
2780
|
+
transactionId
|
|
2781
|
+
}, client);
|
|
2680
2782
|
};
|
|
2681
2783
|
const __prepareCheckoutTransaction_impl = prepareCheckoutTransaction;
|
|
2682
2784
|
const __prepareCheckoutTransaction_wrapped = instrumentFunction({
|
|
@@ -3927,7 +4029,7 @@ const getWalletConnectCatalogWalletByWalletProviderKey = async ({ walletProvider
|
|
|
3927
4029
|
//#region src/modules/walletOptionsCatalogue/resolveWalletBookWalletOptionKey/resolveWalletBookWalletOptionKey.ts
|
|
3928
4030
|
/**
|
|
3929
4031
|
* Resolves which wallet option (group) a wallet book entry belongs to. Used
|
|
3930
|
-
* by the catalogue's wallet-book-driven transformers (
|
|
4032
|
+
* by the catalogue's wallet-book-driven transformers (URI deeplink,
|
|
3931
4033
|
* `inAppBrowser`, `installation`) to bucket their emitted options.
|
|
3932
4034
|
*
|
|
3933
4035
|
* Wallet book entries inconsistently use `group` / `chainGroup` /
|
|
@@ -4082,30 +4184,50 @@ const buildInstallationUrlsByWalletOptionKey = ({ walletBook }) => {
|
|
|
4082
4184
|
};
|
|
4083
4185
|
|
|
4084
4186
|
//#endregion
|
|
4085
|
-
//#region src/modules/walletOptionsCatalogue/
|
|
4187
|
+
//#region src/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/resolveUriConnectionType/resolveUriConnectionType.ts
|
|
4188
|
+
/**
|
|
4189
|
+
* Picks the connection-option `type` discriminator for a wallet-book-
|
|
4190
|
+
* derived URI deeplink option. MetaMask is steered toward its own
|
|
4191
|
+
* MetaMask SDK URI connection extension (`metamaskSdkUri`) so we route
|
|
4192
|
+
* customers off generic WalletConnect for that wallet; every other
|
|
4193
|
+
* wallet uses the standard `walletConnect` discriminator.
|
|
4194
|
+
*
|
|
4195
|
+
* @param params.walletOptionKey - The resolved wallet option key.
|
|
4196
|
+
* @returns The connection-option discriminator to emit.
|
|
4197
|
+
* @not-instrumented
|
|
4198
|
+
*/
|
|
4199
|
+
const resolveUriConnectionType = ({ walletOptionKey }) => walletOptionKey === "metamask" ? "metamaskSdkUri" : "walletConnect";
|
|
4200
|
+
|
|
4201
|
+
//#endregion
|
|
4202
|
+
//#region src/modules/walletOptionsCatalogue/buildUriDeeplinkOptions/buildUriDeeplinkOptions.ts
|
|
4086
4203
|
/**
|
|
4087
|
-
* A wallet only deserves a
|
|
4088
|
-
* least one mobile deeplink — that's the value-add the option provides
|
|
4089
|
-
* the bare
|
|
4090
|
-
* expose a deeplink (rare, but present) are silently skipped.
|
|
4204
|
+
* A wallet only deserves a URI-deeplink catalogue option if it has at
|
|
4205
|
+
* least one mobile deeplink — that's the value-add the option provides
|
|
4206
|
+
* over the bare pairing URI. Wallets that exist in the wallet book but
|
|
4207
|
+
* don't expose a deeplink (rare, but present) are silently skipped.
|
|
4091
4208
|
*/
|
|
4092
4209
|
const hasUsableDeeplink = ({ wallet }) => Boolean(wallet.mobile?.native || wallet.mobile?.universal);
|
|
4093
4210
|
/**
|
|
4094
|
-
* Builds the
|
|
4211
|
+
* Builds the URI-deeplink catalogue options from a fetched wallet book.
|
|
4095
4212
|
* Applies the WalletConnect-specific eligibility filter
|
|
4096
4213
|
* (`shouldFilterWalletForWalletConnect`) so embedded wallets and entries
|
|
4097
4214
|
* without `sign_v2` support are excluded — same surface as
|
|
4098
4215
|
* `getWalletConnectCatalog`.
|
|
4099
4216
|
*
|
|
4100
4217
|
* Each emitted option carries the wallet's mobile deeplinks. Customers
|
|
4101
|
-
* combine these with their chain's
|
|
4102
|
-
* `
|
|
4218
|
+
* combine these with their chain's connection URI via
|
|
4219
|
+
* `appendConnectionUriToDeeplink` to open the wallet's app:
|
|
4220
|
+
*
|
|
4221
|
+
* - `'walletConnect'`: mint via `connectWithWalletConnect<Chain>`.
|
|
4222
|
+
* - `'metamaskSdkUri'`: mint via `connectWithMetaMaskUriEvm` or
|
|
4223
|
+
* `connectWithMetaMaskUriSolana`. Emitted only for the MetaMask
|
|
4224
|
+
* wallet entry — see `resolveUriConnectionType`.
|
|
4103
4225
|
*
|
|
4104
4226
|
* @param params.walletBook - The fetched wallet book.
|
|
4105
|
-
* @returns Tagged
|
|
4227
|
+
* @returns Tagged options paired with their wallet option keys.
|
|
4106
4228
|
* @not-instrumented
|
|
4107
4229
|
*/
|
|
4108
|
-
const
|
|
4230
|
+
const buildUriDeeplinkOptions = ({ walletBook }) => {
|
|
4109
4231
|
const result = [];
|
|
4110
4232
|
for (const [walletKey, wallet] of Object.entries(walletBook.wallets)) {
|
|
4111
4233
|
if (shouldFilterWalletForWalletConnect({
|
|
@@ -4128,7 +4250,7 @@ const buildWalletConnectOptions = ({ walletBook }) => {
|
|
|
4128
4250
|
native: wallet.mobile?.native,
|
|
4129
4251
|
universal: wallet.mobile?.universal
|
|
4130
4252
|
},
|
|
4131
|
-
type:
|
|
4253
|
+
type: resolveUriConnectionType({ walletOptionKey })
|
|
4132
4254
|
},
|
|
4133
4255
|
walletOptionKey
|
|
4134
4256
|
});
|
|
@@ -4469,10 +4591,11 @@ const groupOptionsByWalletOption = ({ options }) => {
|
|
|
4469
4591
|
* wallet-option list is ordered — that's controlled by
|
|
4470
4592
|
* `WalletOptionOrdering`.
|
|
4471
4593
|
*
|
|
4472
|
-
* `withWalletProvider > walletConnect > inAppBrowser`
|
|
4594
|
+
* `withWalletProvider > walletConnect / metamaskSdkUri > inAppBrowser`
|
|
4473
4595
|
*/
|
|
4474
4596
|
const CONNECTION_OPTION_PRIORITY = {
|
|
4475
4597
|
inAppBrowser: 2,
|
|
4598
|
+
metamaskSdkUri: 1,
|
|
4476
4599
|
walletConnect: 1,
|
|
4477
4600
|
withWalletProvider: 0
|
|
4478
4601
|
};
|
|
@@ -4491,7 +4614,7 @@ const getConnectionOptionPriority = ({ option }) => CONNECTION_OPTION_PRIORITY[o
|
|
|
4491
4614
|
/**
|
|
4492
4615
|
* Sorts a wallet option's `connectionOptions` so the most preferred option lands at
|
|
4493
4616
|
* index 0. Primary sort is by option-type priority
|
|
4494
|
-
* (`withWalletProvider` >
|
|
4617
|
+
* (`withWalletProvider` > URI deeplink > `inAppBrowser`);
|
|
4495
4618
|
* within a type, ties break alphabetically by `chain` for deterministic
|
|
4496
4619
|
* output across calls.
|
|
4497
4620
|
*
|
|
@@ -4615,7 +4738,7 @@ const hasInstalledProvider = ({ walletOption }) => walletOption.connectionOption
|
|
|
4615
4738
|
* this order:
|
|
4616
4739
|
* 1. **Installed provider** — user already has the wallet available
|
|
4617
4740
|
* (`withWalletProvider` at index 0).
|
|
4618
|
-
* 2. **Connectable** — has at least one connection (
|
|
4741
|
+
* 2. **Connectable** — has at least one connection (URI deeplink
|
|
4619
4742
|
* or `inAppBrowser`) but no installed provider.
|
|
4620
4743
|
* 3. **Install-only** — no connection at all; only `installationUrls`.
|
|
4621
4744
|
* Within each tier, rank by the hand-curated {@link PRIORITY_WALLET_KEYS}
|
|
@@ -4665,45 +4788,28 @@ const EMPTY_WALLET_BOOK = {
|
|
|
4665
4788
|
wallets: {}
|
|
4666
4789
|
};
|
|
4667
4790
|
/**
|
|
4668
|
-
* Returns
|
|
4669
|
-
* with through this client.
|
|
4670
|
-
* `
|
|
4671
|
-
*
|
|
4672
|
-
* any matching connections are omitted.
|
|
4673
|
-
*
|
|
4674
|
-
* `includeWithWalletProvider` defaults to `true`; all other inclusion flags
|
|
4675
|
-
* are opt-in. `walletOptionOrdering` defaults to `'relevance'` (Dynamic's
|
|
4676
|
-
* recommended order); pass `'alphabetical'` to sort by wallet option name
|
|
4677
|
-
* within each option-priority tier.
|
|
4791
|
+
* Returns the catalogue of external wallet options a user can sign in
|
|
4792
|
+
* with through this client. Always includes installed wallet providers;
|
|
4793
|
+
* pass `includeMobileOptions: true` to additionally surface
|
|
4794
|
+
* WalletConnect, in-app-browser, and install links.
|
|
4678
4795
|
*
|
|
4679
|
-
*
|
|
4680
|
-
* (`includeWalletConnect`, `includeInAppBrowser`). Calls that only need
|
|
4681
|
-
* `includeWithWalletProvider` skip the fetch entirely.
|
|
4682
|
-
*
|
|
4683
|
-
* @param [params] - Inclusion flags + ordering preference.
|
|
4796
|
+
* @param [params] - Inclusion flag + ordering preference.
|
|
4684
4797
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4685
4798
|
* @returns A promise that resolves to the wallet options catalogue.
|
|
4686
4799
|
* @not-instrumented
|
|
4687
4800
|
*/
|
|
4688
4801
|
const getWalletOptionsCatalogue = async (params = {}, client = getDefaultClient()) => {
|
|
4689
|
-
const
|
|
4690
|
-
const includeWalletConnect = params.includeWalletConnect ?? false;
|
|
4691
|
-
const includeInAppBrowser = params.includeInAppBrowser ?? false;
|
|
4692
|
-
const includeInstallation = params.includeInstallation ?? false;
|
|
4802
|
+
const includeMobileOptions = params.includeMobileOptions ?? false;
|
|
4693
4803
|
const walletOptionOrdering = params.walletOptionOrdering ?? "relevance";
|
|
4694
|
-
|
|
4695
|
-
const walletBook = includeWalletConnect || includeInAppBrowser || includeInstallation ? await fetchLegacyWalletBook(client) : EMPTY_WALLET_BOOK;
|
|
4804
|
+
const walletBook = includeMobileOptions ? await fetchLegacyWalletBook(client) : EMPTY_WALLET_BOOK;
|
|
4696
4805
|
const allConnectionOptions = [];
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
}
|
|
4704
|
-
if (includeWalletConnect) allConnectionOptions.push(...buildWalletConnectOptions({ walletBook }));
|
|
4705
|
-
if (includeInAppBrowser) allConnectionOptions.push(...buildInAppBrowserOptions({ walletBook }));
|
|
4706
|
-
const installationUrlsByKey = includeInstallation ? buildInstallationUrlsByWalletOptionKey({ walletBook }) : /* @__PURE__ */ new Map();
|
|
4806
|
+
const entries = getWalletProviderRegistry(client).listProviderEntries();
|
|
4807
|
+
allConnectionOptions.push(...buildWithWalletProviderOptions({
|
|
4808
|
+
entries,
|
|
4809
|
+
walletBook
|
|
4810
|
+
}, client));
|
|
4811
|
+
if (includeMobileOptions) allConnectionOptions.push(...buildUriDeeplinkOptions({ walletBook }), ...buildInAppBrowserOptions({ walletBook }));
|
|
4812
|
+
const installationUrlsByKey = includeMobileOptions ? buildInstallationUrlsByWalletOptionKey({ walletBook }) : /* @__PURE__ */ new Map();
|
|
4707
4813
|
const grouped = groupOptionsByWalletOption({ options: allConnectionOptions });
|
|
4708
4814
|
const allWalletOptionKeys = new Set([...grouped.keys(), ...installationUrlsByKey.keys()]);
|
|
4709
4815
|
const walletOptions = [];
|
|
@@ -4983,6 +5089,7 @@ const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions
|
|
|
4983
5089
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4984
5090
|
* @returns A promise that resolves to the newly generated recovery codes.
|
|
4985
5091
|
* @instrumented
|
|
5092
|
+
* @redact-params
|
|
4986
5093
|
*/
|
|
4987
5094
|
const createNewMfaRecoveryCodes = async (client = getDefaultClient()) => {
|
|
4988
5095
|
const core = getCore(client);
|
|
@@ -4998,7 +5105,8 @@ const __createNewMfaRecoveryCodes_wrapped = instrumentFunction({
|
|
|
4998
5105
|
} catch {
|
|
4999
5106
|
return;
|
|
5000
5107
|
}
|
|
5001
|
-
}
|
|
5108
|
+
},
|
|
5109
|
+
redactAll: true
|
|
5002
5110
|
});
|
|
5003
5111
|
|
|
5004
5112
|
//#endregion
|
|
@@ -6225,6 +6333,7 @@ const verifyOTPForUserUpdate = async ({ otpVerification, verificationToken, requ
|
|
|
6225
6333
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6226
6334
|
* @returns A promise that resolves to the verify response object upon successful verification.
|
|
6227
6335
|
* @instrumented
|
|
6336
|
+
* @redact-params
|
|
6228
6337
|
*/
|
|
6229
6338
|
const verifyOTP = async ({ otpVerification, verificationToken, requestedScopes }, client = getDefaultClient()) => {
|
|
6230
6339
|
let response;
|
|
@@ -6250,7 +6359,8 @@ const __verifyOTP_wrapped = instrumentFunction({
|
|
|
6250
6359
|
} catch {
|
|
6251
6360
|
return;
|
|
6252
6361
|
}
|
|
6253
|
-
}
|
|
6362
|
+
},
|
|
6363
|
+
redactAll: true
|
|
6254
6364
|
});
|
|
6255
6365
|
|
|
6256
6366
|
//#endregion
|
|
@@ -6674,13 +6784,12 @@ const getAddressesWithTypesFromConnectionResult = (connectionResult) => {
|
|
|
6674
6784
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
6675
6785
|
* @returns A promise that resolves to the connected wallet account.
|
|
6676
6786
|
* @throws NoAddressFoundError If the request to connect was successful but no address is connected to your app.
|
|
6677
|
-
*
|
|
6787
|
+
* @instrumented
|
|
6678
6788
|
*/
|
|
6679
6789
|
const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWalletAccounts = true, hardwareWalletVendor }, client = getDefaultClient()) => {
|
|
6680
6790
|
const walletProvider = getWalletProviderByKey({ walletProviderKey }, client);
|
|
6681
6791
|
assertWalletProviderMethodDefined(walletProvider, "connect");
|
|
6682
6792
|
const { addresses } = await walletProvider.connect();
|
|
6683
|
-
const currentAddresses = getWalletAccounts(client).map(({ address }) => address);
|
|
6684
6793
|
const mainAddress = addresses?.length ? addresses[0].address : null;
|
|
6685
6794
|
/**
|
|
6686
6795
|
* This error is thrown in case the wallet has no addresses connected
|
|
@@ -6688,27 +6797,25 @@ const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWallet
|
|
|
6688
6797
|
* user on the next steps.
|
|
6689
6798
|
*/
|
|
6690
6799
|
if (!mainAddress) throw new NoAddressFoundError();
|
|
6691
|
-
const
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
chain: walletProvider.chain,
|
|
6695
|
-
hardwareWalletVendor,
|
|
6696
|
-
id: formatWalletAccountId({
|
|
6800
|
+
const [reconciledWalletAccount] = reconcileWalletAccountsAgainstClient({
|
|
6801
|
+
addToDynamicWalletAccounts,
|
|
6802
|
+
walletAccounts: [{
|
|
6697
6803
|
address: mainAddress,
|
|
6804
|
+
addressesWithTypes: getAddressesWithTypesFromConnectionResult({ addresses }),
|
|
6698
6805
|
chain: walletProvider.chain,
|
|
6806
|
+
hardwareWalletVendor,
|
|
6807
|
+
id: formatWalletAccountId({
|
|
6808
|
+
address: mainAddress,
|
|
6809
|
+
chain: walletProvider.chain,
|
|
6810
|
+
walletProviderKey
|
|
6811
|
+
}),
|
|
6812
|
+
lastSelectedAt: null,
|
|
6813
|
+
verifiedCredentialId: null,
|
|
6699
6814
|
walletProviderKey
|
|
6700
|
-
}
|
|
6701
|
-
lastSelectedAt: null,
|
|
6702
|
-
verifiedCredentialId: null,
|
|
6815
|
+
}],
|
|
6703
6816
|
walletProviderKey
|
|
6704
|
-
};
|
|
6705
|
-
|
|
6706
|
-
if (addToDynamicWalletAccounts) {
|
|
6707
|
-
setUnverifiedWalletAccounts({ unverifiedWalletAccountsToUpdate: [walletAccount] }, client);
|
|
6708
|
-
emitWalletAccountsChangedEvent(client);
|
|
6709
|
-
createVisit({ walletAccount }, client);
|
|
6710
|
-
}
|
|
6711
|
-
return walletAccount;
|
|
6817
|
+
}, client);
|
|
6818
|
+
return reconciledWalletAccount;
|
|
6712
6819
|
};
|
|
6713
6820
|
const __connectWithWalletProvider_impl = connectWithWalletProvider;
|
|
6714
6821
|
const __connectWithWalletProvider_wrapped = instrumentFunction({
|
|
@@ -7639,5 +7746,5 @@ const parseUserAgent = ({ userAgent }) => {
|
|
|
7639
7746
|
assertPackageVersion(name, version);
|
|
7640
7747
|
|
|
7641
7748
|
//#endregion
|
|
7642
|
-
export { BaseError, CheckoutSessionTokenMissingError, ClientAlreadyInitializedError, DeeplinkConnectAndVerifyUnsupportedError, FeeEstimationFailedError, GOOGLE_DRIVE_BACKUP_REQUIRED_SCOPES, InvalidDeviceRegistrationRedirectError, InvalidExternalAuthError, InvalidParamError, InvalidRedirectStorageStateError, InvalidSocialCallbackOriginError, LinkCredentialError, MFAAction, MfaInvalidOtpError, MfaRateLimitedError, MissingRedirectStorageStateError, MissingSocialUrlParamError, MissingUserVerificationError, NetworkAddingUnavailableError, NetworkNotAddedError, NetworkSwitchingUnavailableError, NoAddressFoundError, NoNetworkProvidersError, NoPasskeyCredentialsFoundError, NoSmartWalletAccountSignerFoundError, NoWebAuthNSupportError, NotWaasWalletAccountError, SandboxMaximumThresholdReachedError, SimulationFailedError, TokenSwapError, UnauthorizedError, UnavailableInServerSideError, UnrecognizedNetworkError, UserCancelledSocialPopUpError, UserNotAuthenticatedError, UserRejectedError, WalletAccountAlreadyVerifiedError, WalletAccountNotSelectedError, WalletAlreadyLinkedToAnotherUserError, WalletProviderMethodUnavailableError, __acknowledgeRecoveryCodes_wrapped as acknowledgeRecoveryCodes, addCoinbaseOnrampOrderEventListener, __addNetwork_wrapped as addNetwork, assertWalletAccountSigningAvailability, assertWalletProviderMethodDefined, __attachCheckoutTransactionSource_wrapped as attachCheckoutTransactionSource, authenticateMfaRecoveryCode, authenticatePasskeyMFA, authenticateTotpMfaDevice, __authenticateWithSocial_wrapped as authenticateWithSocial, __broadcastCheckoutTransaction_wrapped as broadcastCheckoutTransaction, canConnectWithHardwareWallet, __cancelCheckoutTransaction_wrapped as cancelCheckoutTransaction, __checkStepUpAuth_wrapped as checkStepUpAuth, __completeDeviceRegistration_wrapped as completeDeviceRegistration, __completeSocialAuthentication_wrapped as completeSocialAuthentication, __completeSocialRedirect_wrapped as completeSocialRedirect, __confirmTransaction_wrapped as confirmTransaction, __connectAndVerifyWithWalletProvider_wrapped as connectAndVerifyWithWalletProvider, __connectWithWalletProvider_wrapped as connectWithWalletProvider, __consumeMfaToken_wrapped as consumeMfaToken, __createCheckoutTransaction_wrapped as createCheckoutTransaction, __createCoinbaseOnrampOrder_wrapped as createCoinbaseOnrampOrder, __createCryptoDotComPayment_wrapped as createCryptoDotComPayment, __createDynamicClient_wrapped as createDynamicClient, __createKrakenExchangeTransfer_wrapped as createKrakenExchangeTransfer, __createNewMfaRecoveryCodes_wrapped as createNewMfaRecoveryCodes, __deleteMfaDevice_wrapped as deleteMfaDevice, __deletePasskey_wrapped as deletePasskey, __deleteUser_wrapped as deleteUser, detectDeviceRegistrationRedirect, detectOAuthRedirect, detectSocialRedirectUrl, excludeInstalledFromCatalog, __executeSwapTransaction_wrapped as executeSwapTransaction, fetchProjectSettings, findMissingGoogleDriveBackupScopes, getActiveNetworkData, getActiveNetworkId, getAvailableWalletProvidersData, getBalance, getBalanceForAddress, getBalances, getCheckoutTransaction, getCheckoutTransactionQuote, getCoinbaseBuyUrl, getConnectedAddresses, getDefaultClient, getDeviceRegistrationTokenFromUrl, __getElevatedAccessToken_wrapped as getElevatedAccessToken, __getGoogleDriveBackupReadiness_wrapped as getGoogleDriveBackupReadiness, getKrakenAccounts, getKrakenWhitelistedAddresses, getMfaDevices, getMfaMethods, getMfaRecoveryCodes, getMissingVerificationForCoinbaseOnrampOrder, getMultichainBalances, getNetworksData, getOwnerWalletAccountForSmartWalletAccount, getPasskeys, getPrimaryWalletAccount, getRegisteredDevices, getSwapQuote, getSwapStatus, getTransactionHistory, getUserSocialAccounts, getWalletAccountAddressByType, getWalletAccountFromAddress, getWalletAccounts, getWalletConnectCatalog, getWalletConnectCatalogWalletByWalletProviderKey, getWalletOptionsCatalogue, getWalletProviderDataByKey, hasAllGoogleDriveBackupScopes, hasExtension, __initializeClient_wrapped as initializeClient, isCaptchaRequired, isDeeplinkWalletProvider, isDeviceRegistrationRequired, isHardwareWalletAccount, isInsufficientGoogleDriveScopesError, isMfaRequiredForAction, isMobile, isPendingRecoveryCodesAcknowledgment, isProgrammaticNetworkSwitchAvailable, isSignedIn, isUserMissingMfaAuth, isUserOnboardingComplete, isWalletAccountVerified, logout, matchWalletProvidersToCatalogGroup, offEvent, offWalletProviderEvent, onEvent, onWalletProviderEvent, onceEvent, parseUserAgent, __prepareCheckoutTransaction_wrapped as prepareCheckoutTransaction, __proveWalletAccountOwnership_wrapped as proveWalletAccountOwnership, __refreshAuth_wrapped as refreshAuth, __refreshUser_wrapped as refreshUser, __registerPasskey_wrapped as registerPasskey, __registerTotpMfaDevice_wrapped as registerTotpMfaDevice, __removeWalletAccount_wrapped as removeWalletAccount, __requestExternalAuthElevatedToken_wrapped as requestExternalAuthElevatedToken, requiresConversion, __revokeAllRegisteredDevices_wrapped as revokeAllRegisteredDevices, __revokeRegisteredDevice_wrapped as revokeRegisteredDevice, __selectPrimaryWalletAccount_wrapped as selectPrimaryWalletAccount, __sendEmailOTP_wrapped as sendEmailOTP, __sendSmsOTP_wrapped as sendSmsOTP, __setCaptchaToken_wrapped as setCaptchaToken, __setDefaultMfaDevice_wrapped as setDefaultMfaDevice, __setInstrumentationEnabled_wrapped as setInstrumentationEnabled, __signInWithExternalJwt_wrapped as signInWithExternalJwt, __signInWithPasskey_wrapped as signInWithPasskey, __signInWithSocialPopUp_wrapped as signInWithSocialPopUp, __signInWithSocialRedirect_wrapped as signInWithSocialRedirect, __signMessage_wrapped as signMessage, __submitCheckoutTransaction_wrapped as submitCheckoutTransaction, supportedCountries, __switchActiveNetwork_wrapped as switchActiveNetwork, trackCheckoutTransaction, __transferAmount_wrapped as transferAmount, __transferWalletAccount_wrapped as transferWalletAccount, __unlinkSocialAccount_wrapped as unlinkSocialAccount, __updateUser_wrapped as updateUser, __verifyOTP_wrapped as verifyOTP, __verifyWalletAccount_wrapped as verifyWalletAccount, waitForClientInitialized };
|
|
7749
|
+
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 };
|
|
7643
7750
|
//# sourceMappingURL=index.native.esm.js.map
|