@dynamic-labs-sdk/client 0.13.0 → 0.15.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-BZPD1J5U.esm.js → InvalidParamError-Dyk0GfyN.esm.js} +262 -6
- package/dist/InvalidParamError-Dyk0GfyN.esm.js.map +1 -0
- package/dist/{InvalidParamError-CH8qePiW.cjs.js → InvalidParamError-DzSZbHE5.cjs.js} +348 -5
- package/dist/InvalidParamError-DzSZbHE5.cjs.js.map +1 -0
- package/dist/{NotWaasWalletAccountError-Bb8-O3Q9.cjs.js → NotWaasWalletAccountError-DFTloI8C.cjs.js} +3 -3
- package/dist/{NotWaasWalletAccountError-Bb8-O3Q9.cjs.js.map → NotWaasWalletAccountError-DFTloI8C.cjs.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-kP6g-sx9.esm.js → NotWaasWalletAccountError-kNpOqccC.esm.js} +3 -3
- package/dist/{NotWaasWalletAccountError-kP6g-sx9.esm.js.map → NotWaasWalletAccountError-kNpOqccC.esm.js.map} +1 -1
- package/dist/client/core/createCore/getInitialState.d.ts.map +1 -1
- package/dist/core.cjs.js +33 -65
- package/dist/core.cjs.js.map +1 -1
- package/dist/core.esm.js +24 -60
- package/dist/core.esm.js.map +1 -1
- package/dist/errors/CheckoutSessionTokenMissingError.d.ts +7 -0
- package/dist/errors/CheckoutSessionTokenMissingError.d.ts.map +1 -0
- package/dist/errors/DeeplinkConnectAndVerifyUnsupportedError.d.ts +9 -0
- package/dist/errors/DeeplinkConnectAndVerifyUnsupportedError.d.ts.map +1 -0
- package/dist/errors/UnauthorizedError.d.ts +5 -0
- package/dist/errors/UnauthorizedError.d.ts.map +1 -0
- package/dist/exports/core.d.ts +9 -1
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/exports/index.d.ts +30 -3
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-gEnLk01L.cjs.js → getNetworkProviderFromNetworkId-BD1iGcEg.cjs.js} +77 -153
- package/dist/getNetworkProviderFromNetworkId-BD1iGcEg.cjs.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-mlU2KYAn.esm.js → getNetworkProviderFromNetworkId-ySZUpmOr.esm.js} +70 -101
- package/dist/getNetworkProviderFromNetworkId-ySZUpmOr.esm.js.map +1 -0
- package/dist/{getSignedSessionId-B2kd9qrw.esm.js → getSignedSessionId-BxhxGkA4.esm.js} +4 -17
- package/dist/getSignedSessionId-BxhxGkA4.esm.js.map +1 -0
- package/dist/{getSignedSessionId-BYF0o0nI.cjs.js → getSignedSessionId-s45HpP3W.cjs.js} +5 -24
- package/dist/getSignedSessionId-s45HpP3W.cjs.js.map +1 -0
- package/dist/{getVerifiedCredentialForWalletAccount-DZMPlNXZ.cjs.js → getVerifiedCredentialForWalletAccount-BxrgouFz.cjs.js} +2 -3
- package/dist/{getVerifiedCredentialForWalletAccount-DZMPlNXZ.cjs.js.map → getVerifiedCredentialForWalletAccount-BxrgouFz.cjs.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-DupRN2qF.esm.js → getVerifiedCredentialForWalletAccount-Ch8h_J_W.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-DupRN2qF.esm.js.map → getVerifiedCredentialForWalletAccount-Ch8h_J_W.esm.js.map} +1 -1
- package/dist/index.cjs.js +500 -88
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +475 -80
- package/dist/index.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-CBENhE_c.esm.js → isMfaRequiredForAction-D1sFhYH1.esm.js} +3 -10
- package/dist/isMfaRequiredForAction-D1sFhYH1.esm.js.map +1 -0
- package/dist/{isMfaRequiredForAction-KnGLJETO.cjs.js → isMfaRequiredForAction-DaJSsq8Z.cjs.js} +2 -15
- package/dist/isMfaRequiredForAction-DaJSsq8Z.cjs.js.map +1 -0
- package/dist/modules/apiClient/createApiClient.d.ts.map +1 -1
- package/dist/modules/apiClient/utils/deviceSignatureHeadersMiddleware/createDeviceSignatureHeadersMiddleware.d.ts +4 -0
- package/dist/modules/apiClient/utils/deviceSignatureHeadersMiddleware/createDeviceSignatureHeadersMiddleware.d.ts.map +1 -0
- package/dist/modules/apiClient/utils/deviceSignatureHeadersMiddleware/index.d.ts +2 -0
- package/dist/modules/apiClient/utils/deviceSignatureHeadersMiddleware/index.d.ts.map +1 -0
- package/dist/modules/apiClient/utils/unauthorizedMiddleware/createUnauthorizedMiddleware.d.ts +3 -0
- package/dist/modules/apiClient/utils/unauthorizedMiddleware/createUnauthorizedMiddleware.d.ts.map +1 -0
- package/dist/modules/auth/passkeys/serverAuthenticatePasskey/serverAuthenticatePasskey.d.ts +4 -2
- package/dist/modules/auth/passkeys/serverAuthenticatePasskey/serverAuthenticatePasskey.d.ts.map +1 -1
- package/dist/modules/checkout/attachCheckoutTransactionSource/attachCheckoutTransactionSource.d.ts +15 -0
- package/dist/modules/checkout/attachCheckoutTransactionSource/attachCheckoutTransactionSource.d.ts.map +1 -0
- package/dist/modules/checkout/attachCheckoutTransactionSource/index.d.ts +3 -0
- package/dist/modules/checkout/attachCheckoutTransactionSource/index.d.ts.map +1 -0
- package/dist/modules/checkout/broadcastCheckoutTransaction/broadcastCheckoutTransaction.d.ts +15 -0
- package/dist/modules/checkout/broadcastCheckoutTransaction/broadcastCheckoutTransaction.d.ts.map +1 -0
- package/dist/modules/checkout/broadcastCheckoutTransaction/index.d.ts +3 -0
- package/dist/modules/checkout/broadcastCheckoutTransaction/index.d.ts.map +1 -0
- package/dist/modules/checkout/cancelCheckoutTransaction/cancelCheckoutTransaction.d.ts +13 -0
- package/dist/modules/checkout/cancelCheckoutTransaction/cancelCheckoutTransaction.d.ts.map +1 -0
- package/dist/modules/checkout/cancelCheckoutTransaction/index.d.ts +3 -0
- package/dist/modules/checkout/cancelCheckoutTransaction/index.d.ts.map +1 -0
- package/dist/modules/checkout/checkout.types.d.ts +7 -0
- package/dist/modules/checkout/checkout.types.d.ts.map +1 -0
- package/dist/modules/checkout/createCheckoutTransaction/createCheckoutTransaction.d.ts +18 -0
- package/dist/modules/checkout/createCheckoutTransaction/createCheckoutTransaction.d.ts.map +1 -0
- package/dist/modules/checkout/createCheckoutTransaction/index.d.ts +3 -0
- package/dist/modules/checkout/createCheckoutTransaction/index.d.ts.map +1 -0
- package/dist/modules/checkout/getCheckoutTransaction/getCheckoutTransaction.d.ts +14 -0
- package/dist/modules/checkout/getCheckoutTransaction/getCheckoutTransaction.d.ts.map +1 -0
- package/dist/modules/checkout/getCheckoutTransaction/index.d.ts +3 -0
- package/dist/modules/checkout/getCheckoutTransaction/index.d.ts.map +1 -0
- package/dist/modules/checkout/getCheckoutTransactionQuote/getCheckoutTransactionQuote.d.ts +16 -0
- package/dist/modules/checkout/getCheckoutTransactionQuote/getCheckoutTransactionQuote.d.ts.map +1 -0
- package/dist/modules/checkout/getCheckoutTransactionQuote/index.d.ts +3 -0
- package/dist/modules/checkout/getCheckoutTransactionQuote/index.d.ts.map +1 -0
- package/dist/modules/checkout/prepareCheckoutTransaction/index.d.ts +3 -0
- package/dist/modules/checkout/prepareCheckoutTransaction/index.d.ts.map +1 -0
- package/dist/modules/checkout/prepareCheckoutTransaction/prepareCheckoutTransaction.d.ts +15 -0
- package/dist/modules/checkout/prepareCheckoutTransaction/prepareCheckoutTransaction.d.ts.map +1 -0
- package/dist/modules/checkout/submitCheckoutTransaction/index.d.ts +3 -0
- package/dist/modules/checkout/submitCheckoutTransaction/index.d.ts.map +1 -0
- package/dist/modules/checkout/submitCheckoutTransaction/submitCheckoutTransaction.d.ts +22 -0
- package/dist/modules/checkout/submitCheckoutTransaction/submitCheckoutTransaction.d.ts.map +1 -0
- package/dist/modules/checkout/utils/createCheckoutApiClient/createCheckoutApiClient.d.ts +13 -0
- package/dist/modules/checkout/utils/createCheckoutApiClient/createCheckoutApiClient.d.ts.map +1 -0
- package/dist/modules/checkout/utils/createCheckoutApiClient/index.d.ts +2 -0
- package/dist/modules/checkout/utils/createCheckoutApiClient/index.d.ts.map +1 -0
- package/dist/modules/checkout/utils/createCheckoutSessionTokenStorageKey/createCheckoutSessionTokenStorageKey.d.ts +2 -0
- package/dist/modules/checkout/utils/createCheckoutSessionTokenStorageKey/createCheckoutSessionTokenStorageKey.d.ts.map +1 -0
- package/dist/modules/checkout/utils/createCheckoutSessionTokenStorageKey/index.d.ts +2 -0
- package/dist/modules/checkout/utils/createCheckoutSessionTokenStorageKey/index.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/getDeviceSigner/getDeviceSigner.d.ts.map +1 -1
- package/dist/modules/deviceRegistration/getDeviceSigner/{getOrCreateUserDeviceSigningKeys/getOrCreateUserDeviceSigningKeys.d.ts → getOrCreateEnvironmentDeviceSigningKeys/getOrCreateEnvironmentDeviceSigningKeys.d.ts} +2 -2
- package/dist/modules/deviceRegistration/getDeviceSigner/getOrCreateEnvironmentDeviceSigningKeys/getOrCreateEnvironmentDeviceSigningKeys.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/getDeviceSigner/getOrCreateEnvironmentDeviceSigningKeys/index.d.ts +2 -0
- package/dist/modules/deviceRegistration/getDeviceSigner/getOrCreateEnvironmentDeviceSigningKeys/index.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/getHeadersForNonceSignedByDeviceSigners/getHeadersForNonceSignedByDeviceSigners.d.ts +3 -0
- package/dist/modules/deviceRegistration/getHeadersForNonceSignedByDeviceSigners/getHeadersForNonceSignedByDeviceSigners.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/getHeadersForNonceSignedByDeviceSigners/index.d.ts +2 -0
- package/dist/modules/deviceRegistration/getHeadersForNonceSignedByDeviceSigners/index.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.d.ts +3 -0
- package/dist/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/getRegisteredDevices/index.d.ts +2 -0
- package/dist/modules/deviceRegistration/getRegisteredDevices/index.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/revokeAllRegisteredDevices/index.d.ts +2 -0
- package/dist/modules/deviceRegistration/revokeAllRegisteredDevices/index.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/revokeAllRegisteredDevices/revokeAllRegisteredDevices.d.ts +2 -0
- package/dist/modules/deviceRegistration/revokeAllRegisteredDevices/revokeAllRegisteredDevices.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/revokeRegisteredDevice/index.d.ts +2 -0
- package/dist/modules/deviceRegistration/revokeRegisteredDevice/index.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/revokeRegisteredDevice/revokeRegisteredDevice.d.ts +6 -0
- package/dist/modules/deviceRegistration/revokeRegisteredDevice/revokeRegisteredDevice.d.ts.map +1 -0
- package/dist/modules/initializeClient/initializeClient.d.ts.map +1 -1
- package/dist/modules/mfa/authenticateMfaRecoveryCode/authenticateMfaRecoveryCode.d.ts +7 -3
- package/dist/modules/mfa/authenticateMfaRecoveryCode/authenticateMfaRecoveryCode.d.ts.map +1 -1
- package/dist/modules/mfa/authenticatePasskeyMFA/authenticatePasskeyMFA.d.ts +6 -3
- package/dist/modules/mfa/authenticatePasskeyMFA/authenticatePasskeyMFA.d.ts.map +1 -1
- package/dist/modules/mfa/authenticateTotpMfaDevice/authenticateTotpMfaDevice.d.ts +6 -3
- package/dist/modules/mfa/authenticateTotpMfaDevice/authenticateTotpMfaDevice.d.ts.map +1 -1
- package/dist/modules/wallets/connectAndVerifyWithWalletProvider/connectAndVerifyWithWalletProvider.d.ts +10 -0
- package/dist/modules/wallets/connectAndVerifyWithWalletProvider/connectAndVerifyWithWalletProvider.d.ts.map +1 -1
- package/dist/modules/wallets/constants.d.ts.map +1 -1
- package/dist/modules/wallets/transferAmount/index.d.ts +2 -0
- package/dist/modules/wallets/transferAmount/index.d.ts.map +1 -0
- package/dist/modules/wallets/transferAmount/transferAmount.d.ts +19 -0
- package/dist/modules/wallets/transferAmount/transferAmount.d.ts.map +1 -0
- package/dist/modules/wallets/walletProvider/index.d.ts +1 -1
- package/dist/modules/wallets/walletProvider/index.d.ts.map +1 -1
- package/dist/modules/wallets/walletProvider/isDeeplinkWalletProvider/index.d.ts +2 -0
- package/dist/modules/wallets/walletProvider/isDeeplinkWalletProvider/index.d.ts.map +1 -0
- package/dist/modules/wallets/walletProvider/isDeeplinkWalletProvider/isDeeplinkWalletProvider.d.ts +10 -0
- package/dist/modules/wallets/walletProvider/isDeeplinkWalletProvider/isDeeplinkWalletProvider.d.ts.map +1 -0
- package/dist/modules/wallets/walletProvider/walletProvider.types.d.ts +32 -0
- package/dist/modules/wallets/walletProvider/walletProvider.types.d.ts.map +1 -1
- package/dist/services/crossTabBroadcast/createCrossTabBroadcast/createCrossTabBroadcast.d.ts.map +1 -1
- package/dist/services/crossTabBroadcast/crossTabBroadcast.schema.d.ts +1 -0
- package/dist/services/crossTabBroadcast/crossTabBroadcast.schema.d.ts.map +1 -1
- package/dist/services/crossTabBroadcast/crossTabBroadcast.types.d.ts +9 -6
- package/dist/services/crossTabBroadcast/crossTabBroadcast.types.d.ts.map +1 -1
- package/dist/services/openDeeplink/createWebDeeplinkOpener/createWebDeeplinkOpener.d.ts +11 -1
- package/dist/services/openDeeplink/createWebDeeplinkOpener/createWebDeeplinkOpener.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/getDeviceNameFromUserAgent/getDeviceNameFromUserAgent.d.ts +6 -0
- package/dist/utils/getDeviceNameFromUserAgent/getDeviceNameFromUserAgent.d.ts.map +1 -0
- package/dist/utils/getDeviceNameFromUserAgent/index.d.ts +2 -0
- package/dist/utils/getDeviceNameFromUserAgent/index.d.ts.map +1 -0
- package/dist/utils/getNonce/constants.d.ts +2 -0
- package/dist/utils/getNonce/constants.d.ts.map +1 -0
- package/dist/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.d.ts +13 -0
- package/dist/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.d.ts.map +1 -0
- package/dist/utils/getNonce/fetchAndStoreNonces/index.d.ts +2 -0
- package/dist/utils/getNonce/fetchAndStoreNonces/index.d.ts.map +1 -0
- package/dist/utils/getNonce/getNonce.d.ts +7 -0
- package/dist/utils/getNonce/getNonce.d.ts.map +1 -1
- package/dist/utils/getNonce/state.d.ts +11 -0
- package/dist/utils/getNonce/state.d.ts.map +1 -0
- package/dist/utils/parseAmountToSmallestUnit/index.d.ts +2 -0
- package/dist/utils/parseAmountToSmallestUnit/index.d.ts.map +1 -0
- package/dist/utils/parseAmountToSmallestUnit/parseAmountToSmallestUnit.d.ts +22 -0
- package/dist/utils/parseAmountToSmallestUnit/parseAmountToSmallestUnit.d.ts.map +1 -0
- package/dist/waas.cjs.js +3 -4
- package/dist/waas.cjs.js.map +1 -1
- package/dist/waas.esm.js +3 -3
- package/dist/waasCore.cjs.js +3 -4
- package/dist/waasCore.cjs.js.map +1 -1
- package/dist/waasCore.esm.js +3 -3
- package/package.json +3 -3
- package/dist/InvalidParamError-BZPD1J5U.esm.js.map +0 -1
- package/dist/InvalidParamError-CH8qePiW.cjs.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-gEnLk01L.cjs.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-mlU2KYAn.esm.js.map +0 -1
- package/dist/getSignedSessionId-B2kd9qrw.esm.js.map +0 -1
- package/dist/getSignedSessionId-BYF0o0nI.cjs.js.map +0 -1
- package/dist/isMfaRequiredForAction-CBENhE_c.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-KnGLJETO.cjs.js.map +0 -1
- package/dist/modules/deviceRegistration/getDeviceSigner/getOrCreateUserDeviceSigningKeys/getOrCreateUserDeviceSigningKeys.d.ts.map +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { A as
|
|
3
|
-
import { D as onceEvent, E as onEvent, O as setCookie, S as splitWalletProviderKey, T as offEvent, _ as getWalletAccounts, b as formatWalletAccountId, c as getWalletProviders, d as DYNAMIC_AUTH_COOKIE_NAME, f as getWalletProviderFromWalletAccount, g as NoWalletProviderFoundError, i as restoreUserSharesForAllWalletAccounts, l as checkAndRaiseWalletAccountsChangedEvent, n as getWalletProviderByKey, r as updateAuthFromVerifyResponse, t as getVerifiedCredentialForWalletAccount, u as emitWalletAccountsChangedEvent, w as emitEvent, x as normalizeAddress } from "./getVerifiedCredentialForWalletAccount-
|
|
4
|
-
import { n as
|
|
5
|
-
import { n as
|
|
1
|
+
import { A as randomString, C as InvalidExternalAuthError, D as isCookieEnabled, I as BaseError, L as getCore, N as getDefaultClient, O as assertDefined, P as setDefaultClient, R as name, S as LinkCredentialError, a as DYNAMIC_ICONIC_SPRITE_URL, b as MfaRateLimitedError, c as CHAINS_INFO_MAP, d as UnauthorizedError, g as createStorageKeySchema, j as CLIENT_SDK_NAME, k as ValueMustBeDefinedError, l as fetchAndStoreNonces, o as SDK_API_CORE_VERSION, s as getChainFromVerifiedCredentialChain, t as InvalidParamError, u as createApiClient, v as getNonce, w as APIError, x as MfaInvalidOtpError, y as SandboxMaximumThresholdReachedError, z as version } from "./InvalidParamError-Dyk0GfyN.esm.js";
|
|
2
|
+
import { A as isEqualShallow, C as isServerSideRendering, D as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, E as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, N as createLocalStorageAdapter, O as generateSessionKeys, S as createDeferredPromise, T as GENERATE_SESSION_KEYS_TRACKER_KEY, _ as NoNetworkProvidersError, a as updateWalletProviderKeysForVerifiedCredentials, c as createSignInMessageStatement, d as createVisit, f as hasExtension, g as WalletAlreadyLinkedToAnotherUserError, h as isCaptchaRequired, i as getNetworksData, j as createStorage, k as subscribeWithSelector, l as formatSignInMessage, m as consumeCaptchaToken, o as verifyMessageSignatureOwnership, p as setCaptchaToken, s as removeUnverifiedWalletAccount, t as getNetworkProviderFromNetworkId, u as setUnverifiedWalletAccounts, v as createLogger, w as FETCH_PROJECT_SETTINGS_TRACKER_KEY, x as CannotTrackError, y as createCrossTabBroadcast } from "./getNetworkProviderFromNetworkId-ySZUpmOr.esm.js";
|
|
3
|
+
import { D as onceEvent, E as onEvent, O as setCookie, S as splitWalletProviderKey, T as offEvent, _ as getWalletAccounts, b as formatWalletAccountId, c as getWalletProviders, d as DYNAMIC_AUTH_COOKIE_NAME, f as getWalletProviderFromWalletAccount, g as NoWalletProviderFoundError, i as restoreUserSharesForAllWalletAccounts, l as checkAndRaiseWalletAccountsChangedEvent, n as getWalletProviderByKey, r as updateAuthFromVerifyResponse, t as getVerifiedCredentialForWalletAccount, u as emitWalletAccountsChangedEvent, w as emitEvent, x as normalizeAddress } from "./getVerifiedCredentialForWalletAccount-Ch8h_J_W.esm.js";
|
|
4
|
+
import { n as refreshAuth, t as NotWaasWalletAccountError } from "./NotWaasWalletAccountError-kNpOqccC.esm.js";
|
|
5
|
+
import { n as getMfaMethods, r as consumeMfaToken, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-D1sFhYH1.esm.js";
|
|
6
6
|
import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
|
|
7
|
-
import { AuthModeEnum, ExchangeKeyEnum, JwtVerifiedCredentialFormatEnum, MFAAction, MfaBackupCodeAcknowledgement, ProviderEnum, WaasBackupOptionsEnum } from "@dynamic-labs/sdk-api-core";
|
|
7
|
+
import { AuthModeEnum, ExchangeKeyEnum, JwtVerifiedCredentialFormatEnum, MFAAction, MfaBackupCodeAcknowledgement, ProviderEnum, WaasBackupOptionsEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
8
8
|
import * as z from "zod/mini";
|
|
9
9
|
import EventEmitter, { EventEmitter as EventEmitter$1 } from "eventemitter3";
|
|
10
10
|
import { browserSupportsWebAuthn, startAuthentication, startRegistration } from "@simplewebauthn/browser";
|
|
@@ -117,26 +117,6 @@ const fetchProjectSettings = async (client = getDefaultClient()) => {
|
|
|
117
117
|
return projectSettings;
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
-
//#endregion
|
|
121
|
-
//#region src/modules/sessionKeys/generateSessionKeys/generateSessionKeys.ts
|
|
122
|
-
const generateSessionKeys = async (client) => {
|
|
123
|
-
const { private: privateKey, public: publicKey, privateJwk: privateKeyJwk } = await p256Keygen();
|
|
124
|
-
const core = getCore(client);
|
|
125
|
-
const stringifiedSessionKeys = JSON.stringify({
|
|
126
|
-
privateKey,
|
|
127
|
-
privateKeyJwk,
|
|
128
|
-
publicKey,
|
|
129
|
-
registered: false
|
|
130
|
-
});
|
|
131
|
-
const encodedSessionKeys = getBuffer().from(stringifiedSessionKeys).toString("base64");
|
|
132
|
-
core.state.set({ sessionKeys: encodedSessionKeys });
|
|
133
|
-
return {
|
|
134
|
-
privateKey,
|
|
135
|
-
privateKeyJwk,
|
|
136
|
-
publicKey
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
|
|
140
120
|
//#endregion
|
|
141
121
|
//#region src/services/runtimeServices/createRuntimeServices/createRuntimeServices.ts
|
|
142
122
|
/**
|
|
@@ -484,6 +464,9 @@ const initializeClient = async (client = getDefaultClient()) => {
|
|
|
484
464
|
const fetchProjectSettingsPromise = initializeStorageSyncPromise.then(async () => {
|
|
485
465
|
if (!core.state.get().projectSettings) await fetchProjectSettings(client);
|
|
486
466
|
});
|
|
467
|
+
fetchProjectSettingsPromise.then(() => fetchAndStoreNonces(client)).catch((error) => {
|
|
468
|
+
core.logger.error("Failed to prefetch nonces:", error);
|
|
469
|
+
});
|
|
487
470
|
/**
|
|
488
471
|
* Generate session keys if they don't exist
|
|
489
472
|
*/
|
|
@@ -642,12 +625,22 @@ const createNavigationHandler = () => {
|
|
|
642
625
|
//#endregion
|
|
643
626
|
//#region src/services/openDeeplink/createWebDeeplinkOpener/createWebDeeplinkOpener.ts
|
|
644
627
|
/**
|
|
645
|
-
* Creates a deeplink opener that
|
|
628
|
+
* Creates a deeplink opener that navigates the current tab to the deeplink URL.
|
|
629
|
+
*
|
|
630
|
+
* Uses `window.location.assign` instead of `window.open` deliberately.
|
|
631
|
+
* This matters for Phantom redirect specifically, which is the only deep link
|
|
632
|
+
* provider that redirects back to the app in a new tab. With `window.open`,
|
|
633
|
+
* the browser first opens an `about:blank` tab before the native wallet app
|
|
634
|
+
* handles the deep link. When Phantom redirects back, it opens yet another
|
|
635
|
+
* tab. The user ends up with three tabs (original, about:blank, redirect) and
|
|
636
|
+
* the browser focuses the lingering about:blank after the redirect tab closes.
|
|
637
|
+
* `window.location.assign` reuses the current tab, avoiding the extra tab
|
|
638
|
+
* entirely.
|
|
646
639
|
*/
|
|
647
640
|
const createWebDeeplinkOpener = () => {
|
|
648
641
|
if (isServerSideRendering()) return () => Promise.reject(new UnavailableInServerSideError("createWebDeeplinkOpener"));
|
|
649
642
|
return async (url) => {
|
|
650
|
-
window.
|
|
643
|
+
window.location.assign(url);
|
|
651
644
|
};
|
|
652
645
|
};
|
|
653
646
|
|
|
@@ -802,6 +795,7 @@ const getInitialState = () => ({
|
|
|
802
795
|
initStatus: "uninitialized",
|
|
803
796
|
legacyToken: null,
|
|
804
797
|
mfaToken: null,
|
|
798
|
+
prefetchedNonces: [],
|
|
805
799
|
projectSettings: null,
|
|
806
800
|
sessionExpiresAt: null,
|
|
807
801
|
sessionKeys: null,
|
|
@@ -909,6 +903,41 @@ const createDynamicClient = (config) => {
|
|
|
909
903
|
return client;
|
|
910
904
|
};
|
|
911
905
|
|
|
906
|
+
//#endregion
|
|
907
|
+
//#region src/errors/CheckoutSessionTokenMissingError.ts
|
|
908
|
+
var CheckoutSessionTokenMissingError = class extends BaseError {
|
|
909
|
+
constructor({ transactionId }) {
|
|
910
|
+
super({
|
|
911
|
+
cause: null,
|
|
912
|
+
code: "checkout_session_token_missing",
|
|
913
|
+
docsUrl: null,
|
|
914
|
+
name: "CheckoutSessionTokenMissingError",
|
|
915
|
+
shortMessage: `No session token found for transaction ${transactionId}. Session tokens are issued once at transaction creation and cannot be recovered.`
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
};
|
|
919
|
+
|
|
920
|
+
//#endregion
|
|
921
|
+
//#region src/errors/DeeplinkConnectAndVerifyUnsupportedError.ts
|
|
922
|
+
var DeeplinkConnectAndVerifyUnsupportedError = class extends BaseError {
|
|
923
|
+
constructor({ walletProviderKey }) {
|
|
924
|
+
super({
|
|
925
|
+
cause: null,
|
|
926
|
+
code: "deeplink_connect_and_verify_unsupported",
|
|
927
|
+
docsUrl: null,
|
|
928
|
+
metaMessages: [
|
|
929
|
+
`Wallet provider key: ${walletProviderKey}`,
|
|
930
|
+
"On mobile, deep link wallet providers (e.g. Phantom redirect) cannot connect and verify in a single step.",
|
|
931
|
+
"iOS does not allow two sequential deep links — the second one is silently ignored because it is no longer tied to a user gesture.",
|
|
932
|
+
"Android may handle sequential deep links differently, but this guard applies to all mobile platforms to ensure a stable experience and prevent production-only errors.",
|
|
933
|
+
"Use connectWithWalletProvider() first, then call verifyWalletAccount() from a separate user action (e.g. a \"Verify Ownership\" button)."
|
|
934
|
+
],
|
|
935
|
+
name: "DeeplinkConnectAndVerifyUnsupportedError",
|
|
936
|
+
shortMessage: "connectAndVerifyWithWalletProvider is not supported for deep link wallet providers on mobile. Use connectWithWalletProvider and verifyWalletAccount separately."
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
};
|
|
940
|
+
|
|
912
941
|
//#endregion
|
|
913
942
|
//#region src/errors/FeeEstimationFailedError.ts
|
|
914
943
|
var FeeEstimationFailedError = class extends BaseError {
|
|
@@ -1721,6 +1750,237 @@ const getMultichainBalances = async ({ balanceRequest }, client = getDefaultClie
|
|
|
1721
1750
|
})).chainBalances;
|
|
1722
1751
|
};
|
|
1723
1752
|
|
|
1753
|
+
//#endregion
|
|
1754
|
+
//#region src/modules/checkout/utils/createCheckoutSessionTokenStorageKey/createCheckoutSessionTokenStorageKey.ts
|
|
1755
|
+
const createCheckoutSessionTokenStorageKey = (transactionId) => {
|
|
1756
|
+
return createStorageKeySchema({
|
|
1757
|
+
key: `checkoutSessionToken:${transactionId}`,
|
|
1758
|
+
schema: z.string()
|
|
1759
|
+
});
|
|
1760
|
+
};
|
|
1761
|
+
|
|
1762
|
+
//#endregion
|
|
1763
|
+
//#region src/modules/checkout/utils/createCheckoutApiClient/createCheckoutApiClient.ts
|
|
1764
|
+
const createCheckoutApiClient = async ({ transactionId }, client) => {
|
|
1765
|
+
const core = getCore(client);
|
|
1766
|
+
const apiClient = createApiClient({}, client);
|
|
1767
|
+
const sessionToken = await core.storage.getItem(createCheckoutSessionTokenStorageKey(transactionId));
|
|
1768
|
+
if (!sessionToken) throw new CheckoutSessionTokenMissingError({ transactionId });
|
|
1769
|
+
return {
|
|
1770
|
+
apiClient,
|
|
1771
|
+
environmentId: core.environmentId,
|
|
1772
|
+
sessionToken
|
|
1773
|
+
};
|
|
1774
|
+
};
|
|
1775
|
+
|
|
1776
|
+
//#endregion
|
|
1777
|
+
//#region src/modules/checkout/attachCheckoutTransactionSource/attachCheckoutTransactionSource.ts
|
|
1778
|
+
/**
|
|
1779
|
+
* Attaches a wallet source to a checkout transaction
|
|
1780
|
+
*
|
|
1781
|
+
* @param params AttachCheckoutTransactionSourceParams - The source details to attach.
|
|
1782
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1783
|
+
* @returns The updated checkout transaction
|
|
1784
|
+
*/
|
|
1785
|
+
const attachCheckoutTransactionSource = async ({ fromAddress, fromChainId, transactionId }, client = getDefaultClient()) => {
|
|
1786
|
+
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
1787
|
+
return apiClient.attachSource({
|
|
1788
|
+
attachSourceRequest: {
|
|
1789
|
+
fromAddress,
|
|
1790
|
+
fromChainId,
|
|
1791
|
+
sourceType: "wallet"
|
|
1792
|
+
},
|
|
1793
|
+
environmentId,
|
|
1794
|
+
transactionId,
|
|
1795
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
1796
|
+
});
|
|
1797
|
+
};
|
|
1798
|
+
|
|
1799
|
+
//#endregion
|
|
1800
|
+
//#region src/modules/checkout/broadcastCheckoutTransaction/broadcastCheckoutTransaction.ts
|
|
1801
|
+
/**
|
|
1802
|
+
* Records the on-chain broadcast of a checkout transaction
|
|
1803
|
+
*
|
|
1804
|
+
* @param params BroadcastCheckoutTransactionParams - The transaction ID and tx hash.
|
|
1805
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1806
|
+
* @returns The updated checkout transaction
|
|
1807
|
+
*/
|
|
1808
|
+
const broadcastCheckoutTransaction = async ({ transactionId, txHash }, client = getDefaultClient()) => {
|
|
1809
|
+
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
1810
|
+
return apiClient.recordCheckoutBroadcast({
|
|
1811
|
+
environmentId,
|
|
1812
|
+
recordBroadcastRequest: { txHash },
|
|
1813
|
+
transactionId,
|
|
1814
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
1815
|
+
});
|
|
1816
|
+
};
|
|
1817
|
+
|
|
1818
|
+
//#endregion
|
|
1819
|
+
//#region src/modules/checkout/cancelCheckoutTransaction/cancelCheckoutTransaction.ts
|
|
1820
|
+
/**
|
|
1821
|
+
* Cancels a checkout transaction before it has been broadcasted
|
|
1822
|
+
*
|
|
1823
|
+
* @param params CancelCheckoutTransactionParams - The transaction to cancel.
|
|
1824
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1825
|
+
* @returns The cancelled checkout transaction
|
|
1826
|
+
*/
|
|
1827
|
+
const cancelCheckoutTransaction = async ({ transactionId }, client = getDefaultClient()) => {
|
|
1828
|
+
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
1829
|
+
const result = await apiClient.cancelCheckoutTransaction({
|
|
1830
|
+
environmentId,
|
|
1831
|
+
transactionId,
|
|
1832
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
1833
|
+
});
|
|
1834
|
+
await getCore(client).storage.removeItem(createCheckoutSessionTokenStorageKey(transactionId));
|
|
1835
|
+
return result;
|
|
1836
|
+
};
|
|
1837
|
+
|
|
1838
|
+
//#endregion
|
|
1839
|
+
//#region src/modules/checkout/createCheckoutTransaction/createCheckoutTransaction.ts
|
|
1840
|
+
/**
|
|
1841
|
+
* Creates a new checkout transaction and stores the session token for subsequent calls
|
|
1842
|
+
*
|
|
1843
|
+
* @param params CreateCheckoutTransactionParams - The parameters for the checkout transaction.
|
|
1844
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1845
|
+
* @returns The created transaction with session token
|
|
1846
|
+
*/
|
|
1847
|
+
const createCheckoutTransaction = async (params, client = getDefaultClient()) => {
|
|
1848
|
+
const core = getCore(client);
|
|
1849
|
+
const result = await createApiClient({}, client).createCheckoutTransaction({
|
|
1850
|
+
checkoutId: params.checkoutId,
|
|
1851
|
+
checkoutTransactionCreateRequest: {
|
|
1852
|
+
amount: params.amount,
|
|
1853
|
+
currency: params.currency,
|
|
1854
|
+
expiresIn: params.expiresIn,
|
|
1855
|
+
externalId: params.externalId
|
|
1856
|
+
},
|
|
1857
|
+
environmentId: core.environmentId
|
|
1858
|
+
});
|
|
1859
|
+
await core.storage.setItem(createCheckoutSessionTokenStorageKey(result.transaction.id), result.sessionToken);
|
|
1860
|
+
return result;
|
|
1861
|
+
};
|
|
1862
|
+
|
|
1863
|
+
//#endregion
|
|
1864
|
+
//#region src/modules/checkout/getCheckoutTransaction/getCheckoutTransaction.ts
|
|
1865
|
+
/**
|
|
1866
|
+
* Fetches the current state of a checkout transaction
|
|
1867
|
+
*
|
|
1868
|
+
* @param params GetCheckoutTransactionParams - The parameters for fetching the transaction.
|
|
1869
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1870
|
+
* @returns The checkout transaction
|
|
1871
|
+
*/
|
|
1872
|
+
const getCheckoutTransaction = async ({ transactionId }, client = getDefaultClient()) => {
|
|
1873
|
+
const core = getCore(client);
|
|
1874
|
+
return createApiClient({}, client).getCheckoutTransaction({
|
|
1875
|
+
environmentId: core.environmentId,
|
|
1876
|
+
transactionId
|
|
1877
|
+
});
|
|
1878
|
+
};
|
|
1879
|
+
|
|
1880
|
+
//#endregion
|
|
1881
|
+
//#region src/modules/checkout/getCheckoutTransactionQuote/getCheckoutTransactionQuote.ts
|
|
1882
|
+
/**
|
|
1883
|
+
* Fetches a quote for a checkout transaction
|
|
1884
|
+
*
|
|
1885
|
+
* @param params GetCheckoutTransactionQuoteParams - The quote parameters.
|
|
1886
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1887
|
+
* @returns The updated checkout transaction with quote data
|
|
1888
|
+
*/
|
|
1889
|
+
const getCheckoutTransactionQuote = async ({ fromTokenAddress, slippage, toTokenAddress, transactionId }, client = getDefaultClient()) => {
|
|
1890
|
+
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
1891
|
+
return apiClient.quoteCheckoutTransaction({
|
|
1892
|
+
environmentId,
|
|
1893
|
+
quoteRequest: {
|
|
1894
|
+
fromTokenAddress,
|
|
1895
|
+
slippage,
|
|
1896
|
+
toTokenAddress
|
|
1897
|
+
},
|
|
1898
|
+
transactionId,
|
|
1899
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
1900
|
+
});
|
|
1901
|
+
};
|
|
1902
|
+
|
|
1903
|
+
//#endregion
|
|
1904
|
+
//#region src/modules/checkout/prepareCheckoutTransaction/prepareCheckoutTransaction.ts
|
|
1905
|
+
/**
|
|
1906
|
+
* Prepares a checkout transaction for signing
|
|
1907
|
+
* This should be called immediately before triggering the transaction signing.
|
|
1908
|
+
* It will confirm the quote is still valid, the risk state is cleared, and the transaction is ready to be signed.
|
|
1909
|
+
*
|
|
1910
|
+
* @param params PrepareCheckoutTransactionParams - The transaction to prepare.
|
|
1911
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1912
|
+
* @returns The updated checkout transaction
|
|
1913
|
+
*/
|
|
1914
|
+
const prepareCheckoutTransaction = async ({ transactionId }, client = getDefaultClient()) => {
|
|
1915
|
+
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
1916
|
+
return apiClient.prepareCheckoutTransaction({
|
|
1917
|
+
environmentId,
|
|
1918
|
+
transactionId,
|
|
1919
|
+
xDynamicCheckoutSessionToken: sessionToken
|
|
1920
|
+
});
|
|
1921
|
+
};
|
|
1922
|
+
|
|
1923
|
+
//#endregion
|
|
1924
|
+
//#region src/modules/wallets/utils/assertWalletProviderMethodDefined/assertWalletProviderMethodDefined.ts
|
|
1925
|
+
/**
|
|
1926
|
+
* Asserts that a specific wallet provider method is defined, throwing an error if it's not.
|
|
1927
|
+
* This function acts as a type guard, narrowing the type to ensure the method exists.
|
|
1928
|
+
*
|
|
1929
|
+
* @template T - The specific wallet provider method key being checked
|
|
1930
|
+
* @param walletProvider - The wallet provider object to check
|
|
1931
|
+
* @param methodName - The name of the method to check for availability
|
|
1932
|
+
* @throws Throws WalletProviderMethodUnavailableError if the method is not defined
|
|
1933
|
+
* @example
|
|
1934
|
+
* ```typescript
|
|
1935
|
+
* const walletProvider: WalletProvider = getWalletProvider();
|
|
1936
|
+
* assertWalletProviderMethodDefined(walletProvider, 'connect');
|
|
1937
|
+
* // walletProvider.connect is now guaranteed to be defined
|
|
1938
|
+
* await walletProvider.connect();
|
|
1939
|
+
* ```
|
|
1940
|
+
*/
|
|
1941
|
+
function assertWalletProviderMethodDefined(walletProvider, methodName) {
|
|
1942
|
+
if (walletProvider[methodName] === void 0) throw new WalletProviderMethodUnavailableError({
|
|
1943
|
+
methodName,
|
|
1944
|
+
walletProviderKey: walletProvider.key
|
|
1945
|
+
});
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
//#endregion
|
|
1949
|
+
//#region src/modules/checkout/submitCheckoutTransaction/submitCheckoutTransaction.ts
|
|
1950
|
+
/**
|
|
1951
|
+
* Prepares, signs, and broadcasts a checkout transaction in one call.
|
|
1952
|
+
*
|
|
1953
|
+
* Orchestrates the full submission flow:
|
|
1954
|
+
* 1. Calls prepareCheckoutTransaction to advance to signing state and lock the quote
|
|
1955
|
+
* 2. Ensures the wallet is on the correct network for the transaction
|
|
1956
|
+
* 3. Delegates on-chain signing to the wallet provider's executeCheckoutTransaction method
|
|
1957
|
+
* 4. Calls broadcastCheckoutTransaction with the resulting txHash
|
|
1958
|
+
*
|
|
1959
|
+
* @param params SubmitCheckoutTransactionParams - The transaction ID, wallet account, and optional step callback.
|
|
1960
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1961
|
+
* @returns The broadcasted checkout transaction
|
|
1962
|
+
*/
|
|
1963
|
+
const submitCheckoutTransaction = async ({ onStepChange, transactionId, walletAccount }, client = getDefaultClient()) => {
|
|
1964
|
+
const prepared = await prepareCheckoutTransaction({ transactionId }, client);
|
|
1965
|
+
assertDefined(prepared.signingPayload, "No signing payload returned from prepare — quote may be missing transaction data");
|
|
1966
|
+
const walletProvider = getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
1967
|
+
assertWalletProviderMethodDefined(walletProvider, "executeCheckoutTransaction");
|
|
1968
|
+
const requiredNetworkId = prepared.signingPayload.chainId;
|
|
1969
|
+
if (requiredNetworkId && walletProvider.switchActiveNetwork) {
|
|
1970
|
+
const { networkId: activeNetworkId } = await walletProvider.getActiveNetworkId();
|
|
1971
|
+
if (activeNetworkId !== requiredNetworkId) await walletProvider.switchActiveNetwork({ networkId: requiredNetworkId });
|
|
1972
|
+
}
|
|
1973
|
+
const { transactionHash } = await walletProvider.executeCheckoutTransaction({
|
|
1974
|
+
onStepChange,
|
|
1975
|
+
signingPayload: prepared.signingPayload,
|
|
1976
|
+
walletAccount
|
|
1977
|
+
});
|
|
1978
|
+
return broadcastCheckoutTransaction({
|
|
1979
|
+
transactionId,
|
|
1980
|
+
txHash: transactionHash
|
|
1981
|
+
}, client);
|
|
1982
|
+
};
|
|
1983
|
+
|
|
1724
1984
|
//#endregion
|
|
1725
1985
|
//#region src/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.ts
|
|
1726
1986
|
const DEVICE_REGISTRATION_TOKEN_HEADER = "x-dynamic-device-registration-token";
|
|
@@ -1775,6 +2035,23 @@ const detectDeviceRegistrationRedirect = ({ url }) => {
|
|
|
1775
2035
|
}
|
|
1776
2036
|
};
|
|
1777
2037
|
|
|
2038
|
+
//#endregion
|
|
2039
|
+
//#region src/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.ts
|
|
2040
|
+
const getRegisteredDevices = async (client = getDefaultClient()) => {
|
|
2041
|
+
const core = getCore(client);
|
|
2042
|
+
const apiClient = createApiClient({}, client);
|
|
2043
|
+
try {
|
|
2044
|
+
return (await apiClient.listDeviceRegistrations({ environmentId: core.environmentId })).deviceRegistrations;
|
|
2045
|
+
} catch (error) {
|
|
2046
|
+
/**
|
|
2047
|
+
* The API will return 401 when no devices are registered when there are no
|
|
2048
|
+
* devices registered. We need to handle this case gracefully.
|
|
2049
|
+
*/
|
|
2050
|
+
if (error instanceof UnauthorizedError) return [];
|
|
2051
|
+
throw error;
|
|
2052
|
+
}
|
|
2053
|
+
};
|
|
2054
|
+
|
|
1778
2055
|
//#endregion
|
|
1779
2056
|
//#region src/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.ts
|
|
1780
2057
|
/**
|
|
@@ -1791,6 +2068,26 @@ const isDeviceRegistrationRequired = (client = getDefaultClient()) => {
|
|
|
1791
2068
|
return Boolean(user.scope?.includes("device:register"));
|
|
1792
2069
|
};
|
|
1793
2070
|
|
|
2071
|
+
//#endregion
|
|
2072
|
+
//#region src/modules/deviceRegistration/revokeAllRegisteredDevices/revokeAllRegisteredDevices.ts
|
|
2073
|
+
const revokeAllRegisteredDevices = async (client = getDefaultClient()) => {
|
|
2074
|
+
const core = getCore(client);
|
|
2075
|
+
await createApiClient({}, client).deleteAllDeviceRegistrations({ environmentId: core.environmentId });
|
|
2076
|
+
await refreshAuth(client);
|
|
2077
|
+
};
|
|
2078
|
+
|
|
2079
|
+
//#endregion
|
|
2080
|
+
//#region src/modules/deviceRegistration/revokeRegisteredDevice/revokeRegisteredDevice.ts
|
|
2081
|
+
const revokeRegisteredDevice = async ({ deviceRegistrationId }, client = getDefaultClient()) => {
|
|
2082
|
+
assertDefined(deviceRegistrationId, "deviceRegistrationId is required");
|
|
2083
|
+
const core = getCore(client);
|
|
2084
|
+
await createApiClient({}, client).deleteDeviceRegistration({
|
|
2085
|
+
deviceRegistrationId,
|
|
2086
|
+
environmentId: core.environmentId
|
|
2087
|
+
});
|
|
2088
|
+
await refreshAuth(client);
|
|
2089
|
+
};
|
|
2090
|
+
|
|
1794
2091
|
//#endregion
|
|
1795
2092
|
//#region src/modules/funding/coinbase/addCoinbaseOnrampOrderEventListener/addCoinbaseOnrampOrderEventListener.ts
|
|
1796
2093
|
/**
|
|
@@ -2505,10 +2802,12 @@ const acknowledgeRecoveryCodes = async (client = getDefaultClient()) => {
|
|
|
2505
2802
|
* one of their backup recovery codes when none of the registered MFA methods are available.
|
|
2506
2803
|
*
|
|
2507
2804
|
* @param params.code - The recovery code to authenticate with.
|
|
2805
|
+
* @param [params.createMfaTokenOptions] - @deprecated Use `requestedScopes` instead. Optional configuration for MFA token creation.
|
|
2806
|
+
* @param [params.requestedScopes] - Optional scopes to request an elevated access token instead of an MFA token.
|
|
2508
2807
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2509
|
-
* @returns A promise that resolves to the MFA authentication response
|
|
2808
|
+
* @returns A promise that resolves to the MFA authentication response.
|
|
2510
2809
|
*/
|
|
2511
|
-
const authenticateMfaRecoveryCode = async ({ code, createMfaTokenOptions }, client = getDefaultClient()) => {
|
|
2810
|
+
const authenticateMfaRecoveryCode = async ({ code, createMfaTokenOptions, requestedScopes }, client = getDefaultClient()) => {
|
|
2512
2811
|
const core = getCore(client);
|
|
2513
2812
|
const apiClient = createApiClient({}, client);
|
|
2514
2813
|
try {
|
|
@@ -2516,7 +2815,8 @@ const authenticateMfaRecoveryCode = async ({ code, createMfaTokenOptions }, clie
|
|
|
2516
2815
|
environmentId: core.environmentId,
|
|
2517
2816
|
mFAAuthRecoveryDevicePostRequest: {
|
|
2518
2817
|
code,
|
|
2519
|
-
createMfaToken: createMfaTokenOptions
|
|
2818
|
+
createMfaToken: createMfaTokenOptions,
|
|
2819
|
+
requestedScopes
|
|
2520
2820
|
}
|
|
2521
2821
|
});
|
|
2522
2822
|
updateAuthFromVerifyResponse({ response }, client);
|
|
@@ -2546,13 +2846,14 @@ const getPasskeyAuthenticationOptions = async ({ relatedOriginRpId } = {}, clien
|
|
|
2546
2846
|
|
|
2547
2847
|
//#endregion
|
|
2548
2848
|
//#region src/modules/auth/passkeys/serverAuthenticatePasskey/serverAuthenticatePasskey.ts
|
|
2549
|
-
const serverAuthenticatePasskey = async ({ authentication, createMfaToken }, client) => {
|
|
2849
|
+
const serverAuthenticatePasskey = async ({ authentication, createMfaToken, requestedScopes }, client) => {
|
|
2550
2850
|
const core = getCore(client);
|
|
2551
2851
|
return await createApiClient({}, client).authenticateMfaPasskeyDevice({
|
|
2552
2852
|
environmentId: core.environmentId,
|
|
2553
2853
|
passkeyAuthRequest: {
|
|
2554
2854
|
...authentication,
|
|
2555
2855
|
createMfaToken,
|
|
2856
|
+
requestedScopes,
|
|
2556
2857
|
response: {
|
|
2557
2858
|
...authentication.response,
|
|
2558
2859
|
clientDataJson: authentication.response.clientDataJSON
|
|
@@ -2569,13 +2870,14 @@ const serverAuthenticatePasskey = async ({ authentication, createMfaToken }, cli
|
|
|
2569
2870
|
* This function prompts the user to authenticate with their registered
|
|
2570
2871
|
* passkey to complete an MFA challenge and obtain an MFA token.
|
|
2571
2872
|
*
|
|
2572
|
-
* @param [params.createMfaToken] - Optional configuration for MFA token creation.
|
|
2873
|
+
* @param [params.createMfaToken] - @deprecated Use `requestedScopes` instead. Optional configuration for MFA token creation.
|
|
2874
|
+
* @param [params.requestedScopes] - Optional scopes to request an elevated access token instead of an MFA token.
|
|
2573
2875
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2574
2876
|
* @returns A promise that resolves to the MFA authentication response.
|
|
2575
2877
|
* @throws NoWebAuthNSupportError If WebAuthn is not supported by the browser.
|
|
2576
2878
|
* @throws NoPasskeyCredentialsFoundError If no passkey credentials are found.
|
|
2577
2879
|
*/
|
|
2578
|
-
const authenticatePasskeyMFA = async ({ createMfaToken, relatedOriginRpId } = {}, client = getDefaultClient()) => {
|
|
2880
|
+
const authenticatePasskeyMFA = async ({ createMfaToken, relatedOriginRpId, requestedScopes } = {}, client = getDefaultClient()) => {
|
|
2579
2881
|
const core = getCore(client);
|
|
2580
2882
|
try {
|
|
2581
2883
|
if (!core.passkey.isSupported()) throw new NoWebAuthNSupportError();
|
|
@@ -2591,7 +2893,8 @@ const authenticatePasskeyMFA = async ({ createMfaToken, relatedOriginRpId } = {}
|
|
|
2591
2893
|
};
|
|
2592
2894
|
const response = await serverAuthenticatePasskey({
|
|
2593
2895
|
authentication: await core.passkey.authenticate({ optionsJSON: formattedOptions }),
|
|
2594
|
-
createMfaToken
|
|
2896
|
+
createMfaToken,
|
|
2897
|
+
requestedScopes
|
|
2595
2898
|
}, client);
|
|
2596
2899
|
updateAuthFromVerifyResponse({ response }, client);
|
|
2597
2900
|
emitEvent({
|
|
@@ -2618,11 +2921,12 @@ const authenticatePasskeyMFA = async ({ createMfaToken, relatedOriginRpId } = {}
|
|
|
2618
2921
|
*
|
|
2619
2922
|
* @param params.code - The 6-digit TOTP code from the authenticator app.
|
|
2620
2923
|
* @param [params.deviceId] - The ID of the specific TOTP device to authenticate with.
|
|
2621
|
-
* @param [params.createMfaTokenOptions] - Optional configuration for MFA token creation.
|
|
2924
|
+
* @param [params.createMfaTokenOptions] - @deprecated Use `requestedScopes` instead. Optional configuration for MFA token creation.
|
|
2925
|
+
* @param [params.requestedScopes] - Optional scopes to request an elevated access token instead of an MFA token.
|
|
2622
2926
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2623
2927
|
* @returns A promise that resolves to the MFA authentication response.
|
|
2624
2928
|
*/
|
|
2625
|
-
const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions }, client = getDefaultClient()) => {
|
|
2929
|
+
const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions, requestedScopes }, client = getDefaultClient()) => {
|
|
2626
2930
|
const core = getCore(client);
|
|
2627
2931
|
const apiClient = createApiClient({}, client);
|
|
2628
2932
|
try {
|
|
@@ -2631,7 +2935,8 @@ const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions
|
|
|
2631
2935
|
mFAAuthTotpDevicePostRequest: {
|
|
2632
2936
|
code,
|
|
2633
2937
|
createMfaToken: createMfaTokenOptions,
|
|
2634
|
-
id: deviceId
|
|
2938
|
+
id: deviceId,
|
|
2939
|
+
requestedScopes
|
|
2635
2940
|
}
|
|
2636
2941
|
});
|
|
2637
2942
|
updateAuthFromVerifyResponse({ response }, client);
|
|
@@ -3933,29 +4238,27 @@ const assertWalletAccountSigningAvailability = async ({ walletAccount }, client
|
|
|
3933
4238
|
};
|
|
3934
4239
|
|
|
3935
4240
|
//#endregion
|
|
3936
|
-
//#region src/
|
|
4241
|
+
//#region src/utils/isMobile/isMobile.ts
|
|
3937
4242
|
/**
|
|
3938
|
-
*
|
|
3939
|
-
* This function acts as a type guard, narrowing the type to ensure the method exists.
|
|
3940
|
-
*
|
|
3941
|
-
* @template T - The specific wallet provider method key being checked
|
|
3942
|
-
* @param walletProvider - The wallet provider object to check
|
|
3943
|
-
* @param methodName - The name of the method to check for availability
|
|
3944
|
-
* @throws Throws WalletProviderMethodUnavailableError if the method is not defined
|
|
3945
|
-
* @example
|
|
3946
|
-
* ```typescript
|
|
3947
|
-
* const walletProvider: WalletProvider = getWalletProvider();
|
|
3948
|
-
* assertWalletProviderMethodDefined(walletProvider, 'connect');
|
|
3949
|
-
* // walletProvider.connect is now guaranteed to be defined
|
|
3950
|
-
* await walletProvider.connect();
|
|
3951
|
-
* ```
|
|
4243
|
+
* Sourced from http://detectmobilebrowsers.com/
|
|
3952
4244
|
*/
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
}
|
|
4245
|
+
const userAgentRegex1 = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ios|ipad|playbook|silk/i;
|
|
4246
|
+
const userAgentRegex2 = /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i;
|
|
4247
|
+
const isMobile = (maxTouchPointsOverride) => {
|
|
4248
|
+
if (typeof window === "undefined" || typeof navigator === "undefined") return false;
|
|
4249
|
+
return userAgentRegex1.test(navigator.userAgent) || userAgentRegex2.test(navigator.userAgent.substring(0, 4)) || isIPad(maxTouchPointsOverride) || isIPhone();
|
|
4250
|
+
};
|
|
4251
|
+
const isIPhone = () => typeof window === "undefined" || typeof navigator === "undefined" ? false : /iPhone|ios/.test(navigator.userAgent);
|
|
4252
|
+
/**
|
|
4253
|
+
* @param [optional] maxTouchPointsOverride - this is used for testing since
|
|
4254
|
+
* it seems that JSDOM doesn't support maxTouchPoints, so it was impossible
|
|
4255
|
+
* to mock it
|
|
4256
|
+
*/
|
|
4257
|
+
const isIPad = (maxTouchPointsOverride) => {
|
|
4258
|
+
if (typeof window === "undefined" || typeof navigator === "undefined") return false;
|
|
4259
|
+
const maxTouchPoints = maxTouchPointsOverride || navigator.maxTouchPoints;
|
|
4260
|
+
return /iPad/.test(navigator.userAgent) || /Mac/.test(navigator.userAgent) && maxTouchPoints === 5;
|
|
4261
|
+
};
|
|
3959
4262
|
|
|
3960
4263
|
//#endregion
|
|
3961
4264
|
//#region src/modules/wallets/utils/getAddressesWithTypesFromConnectionResult/getAddressesWithTypesFromConnectionResult.ts
|
|
@@ -4165,6 +4468,13 @@ const verifyWalletAccount = async ({ walletAccount, requestedScopes }, client =
|
|
|
4165
4468
|
}, client);
|
|
4166
4469
|
};
|
|
4167
4470
|
|
|
4471
|
+
//#endregion
|
|
4472
|
+
//#region src/modules/wallets/walletProvider/isDeeplinkWalletProvider/isDeeplinkWalletProvider.ts
|
|
4473
|
+
/**
|
|
4474
|
+
* Returns true if the wallet provider uses the deep link protocol (e.g. Phantom redirect on mobile).
|
|
4475
|
+
*/
|
|
4476
|
+
const isDeeplinkWalletProvider = ({ walletProvider }) => walletProvider.walletProviderType === WalletProviderEnum.DeepLink;
|
|
4477
|
+
|
|
4168
4478
|
//#endregion
|
|
4169
4479
|
//#region src/modules/wallets/connectAndVerifyWithWalletProvider/connectAndVerifyWithWalletProvider.ts
|
|
4170
4480
|
/**
|
|
@@ -4174,12 +4484,24 @@ const verifyWalletAccount = async ({ walletAccount, requestedScopes }, client =
|
|
|
4174
4484
|
* requiring the user to sign a message to prove wallet ownership before
|
|
4175
4485
|
* the wallet account is added to their profile.
|
|
4176
4486
|
*
|
|
4487
|
+
* @throws {DeeplinkConnectAndVerifyUnsupportedError} On mobile with deep link
|
|
4488
|
+
* wallet providers (e.g. Phantom redirect). This function triggers two sequential
|
|
4489
|
+
* deeplinks — one to connect and another to sign for verification. iOS will not
|
|
4490
|
+
* honor the second deeplink because it is no longer tied to a user gesture.
|
|
4491
|
+
* Android may handle sequential deeplinks differently, but this guard applies to
|
|
4492
|
+
* all mobile platforms to ensure a stable experience and prevent production-only
|
|
4493
|
+
* errors. Use `connectWithWalletProvider` first and then invoke
|
|
4494
|
+
* `verifyWalletAccount` separately from a new user gesture (e.g. a "Verify
|
|
4495
|
+
* Ownership" button).
|
|
4496
|
+
*
|
|
4177
4497
|
* @param params.walletProviderKey - The unique key identifying the wallet provider to connect to.
|
|
4178
4498
|
* @param [params.hardwareWalletVendor] - The hardware wallet vendor, if connecting via a hardware wallet (e.g. 'ledger').
|
|
4179
4499
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4180
4500
|
* @returns A promise that resolves to the connected and verified wallet account.
|
|
4181
4501
|
*/
|
|
4182
4502
|
const connectAndVerifyWithWalletProvider = async ({ walletProviderKey, hardwareWalletVendor }, client = getDefaultClient()) => {
|
|
4503
|
+
const walletProvider = getWalletProviderByKey({ walletProviderKey }, client);
|
|
4504
|
+
if (isMobile() && isDeeplinkWalletProvider({ walletProvider })) throw new DeeplinkConnectAndVerifyUnsupportedError({ walletProviderKey });
|
|
4183
4505
|
const walletAccount = await connectWithWalletProvider({
|
|
4184
4506
|
addToDynamicWalletAccounts: false,
|
|
4185
4507
|
hardwareWalletVendor,
|
|
@@ -4551,6 +4873,34 @@ const signMessage = async ({ walletAccount, message }, client = getDefaultClient
|
|
|
4551
4873
|
return { signature };
|
|
4552
4874
|
};
|
|
4553
4875
|
|
|
4876
|
+
//#endregion
|
|
4877
|
+
//#region src/modules/wallets/transferAmount/transferAmount.ts
|
|
4878
|
+
/**
|
|
4879
|
+
* Transfers an amount of currency from the wallet account to a recipient.
|
|
4880
|
+
*
|
|
4881
|
+
* Supports native token transfers and, where supported by the chain,
|
|
4882
|
+
* fungible/token transfers via the optional `token` parameter.
|
|
4883
|
+
*
|
|
4884
|
+
* @param params.walletAccount - The wallet account to transfer from.
|
|
4885
|
+
* @param params.amount - The amount to transfer as a decimal string (e.g. "1.5").
|
|
4886
|
+
* @param params.recipient - The recipient address.
|
|
4887
|
+
* @param params.token - Optional token info for non-native transfers.
|
|
4888
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4889
|
+
* @returns A promise that resolves to an object containing the transaction hash.
|
|
4890
|
+
* @throws If the wallet provider does not support the transfer amount method.
|
|
4891
|
+
*/
|
|
4892
|
+
const transferAmount = async ({ walletAccount, amount, recipient, token }, client = getDefaultClient()) => {
|
|
4893
|
+
const walletProvider = getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
4894
|
+
assertWalletProviderMethodDefined(walletProvider, "transferAmount");
|
|
4895
|
+
const { transactionHash } = await walletProvider.transferAmount({
|
|
4896
|
+
amount,
|
|
4897
|
+
recipient,
|
|
4898
|
+
token,
|
|
4899
|
+
walletAccount
|
|
4900
|
+
});
|
|
4901
|
+
return { transactionHash };
|
|
4902
|
+
};
|
|
4903
|
+
|
|
4554
4904
|
//#endregion
|
|
4555
4905
|
//#region src/modules/wallets/transferWalletAccount/transferWalletAccount.ts
|
|
4556
4906
|
/**
|
|
@@ -4629,26 +4979,71 @@ const onWalletProviderEvent = ({ callback, event, walletProviderKey }, client =
|
|
|
4629
4979
|
};
|
|
4630
4980
|
|
|
4631
4981
|
//#endregion
|
|
4632
|
-
//#region src/utils/
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
}
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4982
|
+
//#region src/utils/getDeviceNameFromUserAgent/getDeviceNameFromUserAgent.ts
|
|
4983
|
+
const browserMatchers = [
|
|
4984
|
+
{
|
|
4985
|
+
name: "Edge",
|
|
4986
|
+
pattern: /Edg(e|A|iOS)?\//
|
|
4987
|
+
},
|
|
4988
|
+
{
|
|
4989
|
+
name: "Opera",
|
|
4990
|
+
pattern: /OPR\/|Opera/
|
|
4991
|
+
},
|
|
4992
|
+
{
|
|
4993
|
+
name: "Samsung Browser",
|
|
4994
|
+
pattern: /SamsungBrowser/
|
|
4995
|
+
},
|
|
4996
|
+
{
|
|
4997
|
+
name: "Firefox",
|
|
4998
|
+
pattern: /Firefox/
|
|
4999
|
+
},
|
|
5000
|
+
{
|
|
5001
|
+
name: "Safari",
|
|
5002
|
+
pattern: /^(?!.*(?:Chrome|Chromium|CriOS)).*Safari/
|
|
5003
|
+
},
|
|
5004
|
+
{
|
|
5005
|
+
name: "Chrome",
|
|
5006
|
+
pattern: /Chrome|CriOS/
|
|
5007
|
+
}
|
|
5008
|
+
];
|
|
5009
|
+
const osMatchers = [
|
|
5010
|
+
{
|
|
5011
|
+
name: "iPhone",
|
|
5012
|
+
pattern: /iPhone/
|
|
5013
|
+
},
|
|
5014
|
+
{
|
|
5015
|
+
name: "iPad",
|
|
5016
|
+
pattern: /iPad/
|
|
5017
|
+
},
|
|
5018
|
+
{
|
|
5019
|
+
name: "Android",
|
|
5020
|
+
pattern: /Android/
|
|
5021
|
+
},
|
|
5022
|
+
{
|
|
5023
|
+
name: "Windows",
|
|
5024
|
+
pattern: /Windows/
|
|
5025
|
+
},
|
|
5026
|
+
{
|
|
5027
|
+
name: "macOS",
|
|
5028
|
+
pattern: /Macintosh|Mac OS X/
|
|
5029
|
+
},
|
|
5030
|
+
{
|
|
5031
|
+
name: "Linux",
|
|
5032
|
+
pattern: /Linux/
|
|
5033
|
+
},
|
|
5034
|
+
{
|
|
5035
|
+
name: "ChromeOS",
|
|
5036
|
+
pattern: /CrOS/
|
|
5037
|
+
}
|
|
5038
|
+
];
|
|
5039
|
+
const getDeviceNameFromUserAgent = ({ userAgent }) => {
|
|
5040
|
+
if (!userAgent) return null;
|
|
5041
|
+
const browser = browserMatchers.find(({ pattern }) => pattern.test(userAgent))?.name;
|
|
5042
|
+
const os = osMatchers.find(({ pattern }) => pattern.test(userAgent))?.name;
|
|
5043
|
+
if (browser && os) return `${browser} on ${os}`;
|
|
5044
|
+
if (browser) return browser;
|
|
5045
|
+
if (os) return os;
|
|
5046
|
+
return null;
|
|
4652
5047
|
};
|
|
4653
5048
|
|
|
4654
5049
|
//#endregion
|
|
@@ -4656,5 +5051,5 @@ const isIPad = (maxTouchPointsOverride) => {
|
|
|
4656
5051
|
assertPackageVersion(name, version);
|
|
4657
5052
|
|
|
4658
5053
|
//#endregion
|
|
4659
|
-
export { BaseError, ClientAlreadyInitializedError, FeeEstimationFailedError, InvalidDeviceRegistrationRedirectError, InvalidExternalAuthError, InvalidParamError, InvalidRedirectStorageStateError, LinkCredentialError, MFAAction, MfaInvalidOtpError, MfaRateLimitedError, MissingRedirectStorageStateError, MissingSocialUrlParamError, MissingUserVerificationError, NetworkAddingUnavailableError, NetworkNotAddedError, NetworkSwitchingUnavailableError, NoAddressFoundError, NoNetworkProvidersError, NoPasskeyCredentialsFoundError, NoSmartWalletAccountSignerFoundError, NoWebAuthNSupportError, NotWaasWalletAccountError, SandboxMaximumThresholdReachedError, SimulationFailedError, UnavailableInServerSideError, UnrecognizedNetworkError, UserNotAuthenticatedError, UserRejectedError, WalletAccountAlreadyVerifiedError, WalletAccountNotSelectedError, WalletAlreadyLinkedToAnotherUserError, WalletProviderMethodUnavailableError, acknowledgeRecoveryCodes, addCoinbaseOnrampOrderEventListener, addNetwork, assertWalletAccountSigningAvailability, assertWalletProviderMethodDefined, authenticateMfaRecoveryCode, authenticatePasskeyMFA, authenticateTotpMfaDevice, authenticateWithSocial, canConnectWithHardwareWallet, completeDeviceRegistration, completeSocialAuthentication, connectAndVerifyWithWalletProvider, connectWithWalletProvider, consumeMfaToken, createCoinbaseOnrampOrder, createCryptoDotComPayment, createDynamicClient, createKrakenExchangeTransfer, createNewMfaRecoveryCodes, deleteMfaDevice, deletePasskey, deleteUser, detectDeviceRegistrationRedirect, detectOAuthRedirect, fetchProjectSettings, getActiveNetworkData, getActiveNetworkId, getAvailableWalletProvidersData, getBalance, getBalanceForAddress, getCoinbaseBuyUrl, getConnectedAddresses, getDefaultClient, getDeviceRegistrationTokenFromUrl, getElevatedAccessToken, getKrakenAccounts, getKrakenWhitelistedAddresses, getMfaDevices, getMfaMethods, getMfaRecoveryCodes, getMissingVerificationForCoinbaseOnrampOrder, getMultichainBalances, getNetworksData, getOwnerWalletAccountForSmartWalletAccount, getPasskeys, getPrimaryWalletAccount, getTransactionHistory, getUserSocialAccounts, getWalletAccountAddressByType, getWalletAccountFromAddress, getWalletAccounts, getWalletConnectCatalog, getWalletConnectCatalogWalletByWalletProviderKey, getWalletProviderDataByKey, hasExtension, initializeClient, isCaptchaRequired, isDeviceRegistrationRequired, isHardwareWalletAccount, isMfaRequiredForAction, isMobile, isPendingRecoveryCodesAcknowledgment, isProgrammaticNetworkSwitchAvailable, isSignedIn, isUserMissingMfaAuth, isUserOnboardingComplete, isWalletAccountVerified, logout, offEvent, offWalletProviderEvent, onEvent, onWalletProviderEvent, onceEvent, proveWalletAccountOwnership, refreshAuth, refreshUser, registerPasskey, registerTotpMfaDevice, removeWalletAccount, selectPrimaryWalletAccount, sendEmailOTP, sendSmsOTP, setCaptchaToken, setDefaultMfaDevice, signInWithExternalJwt, signInWithPasskey, signMessage, supportedCountries, switchActiveNetwork, transferWalletAccount, unlinkSocialAccount, updateUser, verifyOTP, verifyWalletAccount, waitForClientInitialized };
|
|
5054
|
+
export { BaseError, CheckoutSessionTokenMissingError, ClientAlreadyInitializedError, DeeplinkConnectAndVerifyUnsupportedError, FeeEstimationFailedError, InvalidDeviceRegistrationRedirectError, InvalidExternalAuthError, InvalidParamError, InvalidRedirectStorageStateError, LinkCredentialError, MFAAction, MfaInvalidOtpError, MfaRateLimitedError, MissingRedirectStorageStateError, MissingSocialUrlParamError, MissingUserVerificationError, NetworkAddingUnavailableError, NetworkNotAddedError, NetworkSwitchingUnavailableError, NoAddressFoundError, NoNetworkProvidersError, NoPasskeyCredentialsFoundError, NoSmartWalletAccountSignerFoundError, NoWebAuthNSupportError, NotWaasWalletAccountError, SandboxMaximumThresholdReachedError, SimulationFailedError, UnauthorizedError, UnavailableInServerSideError, UnrecognizedNetworkError, UserNotAuthenticatedError, UserRejectedError, WalletAccountAlreadyVerifiedError, WalletAccountNotSelectedError, WalletAlreadyLinkedToAnotherUserError, WalletProviderMethodUnavailableError, acknowledgeRecoveryCodes, addCoinbaseOnrampOrderEventListener, addNetwork, assertWalletAccountSigningAvailability, assertWalletProviderMethodDefined, attachCheckoutTransactionSource, authenticateMfaRecoveryCode, authenticatePasskeyMFA, authenticateTotpMfaDevice, authenticateWithSocial, broadcastCheckoutTransaction, canConnectWithHardwareWallet, cancelCheckoutTransaction, completeDeviceRegistration, completeSocialAuthentication, connectAndVerifyWithWalletProvider, connectWithWalletProvider, consumeMfaToken, createCheckoutTransaction, createCoinbaseOnrampOrder, createCryptoDotComPayment, createDynamicClient, createKrakenExchangeTransfer, createNewMfaRecoveryCodes, deleteMfaDevice, deletePasskey, deleteUser, detectDeviceRegistrationRedirect, detectOAuthRedirect, fetchProjectSettings, getActiveNetworkData, getActiveNetworkId, getAvailableWalletProvidersData, getBalance, getBalanceForAddress, getCheckoutTransaction, getCheckoutTransactionQuote, getCoinbaseBuyUrl, getConnectedAddresses, getDefaultClient, getDeviceNameFromUserAgent, getDeviceRegistrationTokenFromUrl, getElevatedAccessToken, getKrakenAccounts, getKrakenWhitelistedAddresses, getMfaDevices, getMfaMethods, getMfaRecoveryCodes, getMissingVerificationForCoinbaseOnrampOrder, getMultichainBalances, getNetworksData, getOwnerWalletAccountForSmartWalletAccount, getPasskeys, getPrimaryWalletAccount, getRegisteredDevices, getTransactionHistory, getUserSocialAccounts, getWalletAccountAddressByType, getWalletAccountFromAddress, getWalletAccounts, getWalletConnectCatalog, getWalletConnectCatalogWalletByWalletProviderKey, getWalletProviderDataByKey, hasExtension, initializeClient, isCaptchaRequired, isDeeplinkWalletProvider, isDeviceRegistrationRequired, isHardwareWalletAccount, isMfaRequiredForAction, isMobile, isPendingRecoveryCodesAcknowledgment, isProgrammaticNetworkSwitchAvailable, isSignedIn, isUserMissingMfaAuth, isUserOnboardingComplete, isWalletAccountVerified, logout, offEvent, offWalletProviderEvent, onEvent, onWalletProviderEvent, onceEvent, prepareCheckoutTransaction, proveWalletAccountOwnership, refreshAuth, refreshUser, registerPasskey, registerTotpMfaDevice, removeWalletAccount, revokeAllRegisteredDevices, revokeRegisteredDevice, selectPrimaryWalletAccount, sendEmailOTP, sendSmsOTP, setCaptchaToken, setDefaultMfaDevice, signInWithExternalJwt, signInWithPasskey, signMessage, submitCheckoutTransaction, supportedCountries, switchActiveNetwork, transferAmount, transferWalletAccount, unlinkSocialAccount, updateUser, verifyOTP, verifyWalletAccount, waitForClientInitialized };
|
|
4660
5055
|
//# sourceMappingURL=index.esm.js.map
|