@dynamic-labs-sdk/client 1.23.1 → 1.24.1
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/{NativeModuleNotLinkedError-DLP1hpcM.native.esm.js → NativeModuleNotLinkedError-dFDBC524.native.esm.js} +3 -3
- package/dist/{NativeModuleNotLinkedError-DLP1hpcM.native.esm.js.map → NativeModuleNotLinkedError-dFDBC524.native.esm.js.map} +1 -1
- package/dist/{consumeMfaTokenIfRequiredForAction-D2oiQdpj.esm.js → consumeMfaTokenIfRequiredForAction-DdGzQwQQ.esm.js} +2 -2
- package/dist/{consumeMfaTokenIfRequiredForAction-D2oiQdpj.esm.js.map → consumeMfaTokenIfRequiredForAction-DdGzQwQQ.esm.js.map} +1 -1
- package/dist/{consumeMfaTokenIfRequiredForAction-DJAdtHe3.cjs → consumeMfaTokenIfRequiredForAction-IsOFRL68.cjs} +2 -2
- package/dist/{consumeMfaTokenIfRequiredForAction-DJAdtHe3.cjs.map → consumeMfaTokenIfRequiredForAction-IsOFRL68.cjs.map} +1 -1
- package/dist/core.cjs +7 -6
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +9 -9
- 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/waas.d.ts +1 -1
- package/dist/exports/waas.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-BVP0ghId.cjs → getNetworkProviderFromNetworkId-CIcatN8-.cjs} +64 -2
- package/dist/getNetworkProviderFromNetworkId-CIcatN8-.cjs.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-OfuaqHXU.esm.js → getNetworkProviderFromNetworkId-CYONf9-8.esm.js} +63 -7
- package/dist/getNetworkProviderFromNetworkId-CYONf9-8.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-Bh4_-rhf.native.esm.js → getNetworkProviderFromNetworkId-nLBIQ_5p.native.esm.js} +59 -3
- package/dist/getNetworkProviderFromNetworkId-nLBIQ_5p.native.esm.js.map +1 -0
- package/dist/{getSignedSessionId-CDEQ6TMC.esm.js → getSignedSessionId-B2kslh_k.esm.js} +2 -2
- package/dist/{getSignedSessionId-CDEQ6TMC.esm.js.map → getSignedSessionId-B2kslh_k.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-2jmv21__.native.esm.js → getSignedSessionId-DV0hK3Tu.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-2jmv21__.native.esm.js.map → getSignedSessionId-DV0hK3Tu.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-_ZPqzvm5.cjs → getSignedSessionId-NZ8ndqG1.cjs} +2 -2
- package/dist/{getSignedSessionId-_ZPqzvm5.cjs.map → getSignedSessionId-NZ8ndqG1.cjs.map} +1 -1
- package/dist/{getWalletProviderByKey-0VBVdu30.native.esm.js → getWalletProviderByKey-DPZP397j.native.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-0VBVdu30.native.esm.js.map → getWalletProviderByKey-DPZP397j.native.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-BIHCI8S6.esm.js → getWalletProviderByKey-Dh3JbMi6.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-BIHCI8S6.esm.js.map → getWalletProviderByKey-Dh3JbMi6.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-F5wxlC_k.cjs → getWalletProviderByKey-DzKZXm5S.cjs} +2 -2
- package/dist/{getWalletProviderByKey-F5wxlC_k.cjs.map → getWalletProviderByKey-DzKZXm5S.cjs.map} +1 -1
- package/dist/index.cjs +17 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +19 -71
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +20 -79
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isDynamicWaasEnabled-OlDJAGIi.esm.js → isDynamicWaasEnabled-BbhbghRE.esm.js} +2 -2
- package/dist/{isDynamicWaasEnabled-OlDJAGIi.esm.js.map → isDynamicWaasEnabled-BbhbghRE.esm.js.map} +1 -1
- package/dist/{isDynamicWaasEnabled-cVxCp5BV.native.esm.js → isDynamicWaasEnabled-BmB0lQJf.native.esm.js} +2 -2
- package/dist/{isDynamicWaasEnabled-cVxCp5BV.native.esm.js.map → isDynamicWaasEnabled-BmB0lQJf.native.esm.js.map} +1 -1
- package/dist/{isDynamicWaasEnabled-YigU-EAT.cjs → isDynamicWaasEnabled-D2U3MRnA.cjs} +2 -2
- package/dist/{isDynamicWaasEnabled-YigU-EAT.cjs.map → isDynamicWaasEnabled-D2U3MRnA.cjs.map} +1 -1
- package/dist/{isMfaRequiredForAction-Bn2HCYvZ.esm.js → isMfaRequiredForAction-DBlmv1ew.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-Bn2HCYvZ.esm.js.map → isMfaRequiredForAction-DBlmv1ew.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-BtPXuiSY.cjs → isMfaRequiredForAction-DCyorelQ.cjs} +2 -2
- package/dist/{isMfaRequiredForAction-BtPXuiSY.cjs.map → isMfaRequiredForAction-DCyorelQ.cjs.map} +1 -1
- package/dist/{isMfaRequiredForAction-DjC0wQJ4.native.esm.js → isMfaRequiredForAction-DP0kk0tY.native.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-DjC0wQJ4.native.esm.js.map → isMfaRequiredForAction-DP0kk0tY.native.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-Bi7tw1lk.cjs → isUserOnboardingComplete-DygWGu6p.cjs} +3 -3
- package/dist/{isUserOnboardingComplete-Bi7tw1lk.cjs.map → isUserOnboardingComplete-DygWGu6p.cjs.map} +1 -1
- package/dist/{isUserOnboardingComplete-BCZpska8.native.esm.js → isUserOnboardingComplete-Ebw4x90F.native.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-BCZpska8.native.esm.js.map → isUserOnboardingComplete-Ebw4x90F.native.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-DScTOOg_.esm.js → isUserOnboardingComplete-WzXFgdor.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-DScTOOg_.esm.js.map → isUserOnboardingComplete-WzXFgdor.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-DkQj3aYU.esm.js → migrateFromFireblocks-BkcGdF_B.esm.js} +14 -14
- package/dist/migrateFromFireblocks-BkcGdF_B.esm.js.map +1 -0
- package/dist/{migrateFromFireblocks-7aKNa_3P.native.esm.js → migrateFromFireblocks-C1yQ4dm7.native.esm.js} +13 -13
- package/dist/migrateFromFireblocks-C1yQ4dm7.native.esm.js.map +1 -0
- package/dist/{migrateFromFireblocks-BnHU2AZJ.cjs → migrateFromFireblocks-CzPWPaDr.cjs} +13 -13
- package/dist/migrateFromFireblocks-CzPWPaDr.cjs.map +1 -0
- package/dist/modules/flow/prepareFlowSigning/prepareFlowSigning.d.ts +2 -2
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts +7 -11
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts +4 -4
- package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts +1 -1
- package/dist/modules/waas/businessAccounts/assertTargetIdentity.d.ts +14 -0
- package/dist/modules/waas/businessAccounts/assertTargetIdentity.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts +15 -1
- package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts.map +1 -1
- package/dist/modules/waas/waas.types.d.ts +2 -2
- package/dist/modules/waas/waas.types.d.ts.map +1 -1
- package/dist/services/openDeeplink/{createWebDeeplinkOpener/createWebDeeplinkOpener.d.ts → createDeeplinkOpener/createDeeplinkOpener.d.ts} +6 -2
- package/dist/services/openDeeplink/createDeeplinkOpener/createDeeplinkOpener.d.ts.map +1 -0
- package/dist/services/openDeeplink/createDeeplinkOpener/index.d.ts +2 -0
- package/dist/services/openDeeplink/createDeeplinkOpener/index.d.ts.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/{updateAuthFromVerifyResponse-B2QePeNz.cjs → updateAuthFromVerifyResponse-B8tDJdXY.cjs} +3 -3
- package/dist/{updateAuthFromVerifyResponse-B2QePeNz.cjs.map → updateAuthFromVerifyResponse-B8tDJdXY.cjs.map} +1 -1
- package/dist/{updateAuthFromVerifyResponse-wHGRunTk.esm.js → updateAuthFromVerifyResponse-C_yGmd99.esm.js} +3 -3
- package/dist/{updateAuthFromVerifyResponse-wHGRunTk.esm.js.map → updateAuthFromVerifyResponse-C_yGmd99.esm.js.map} +1 -1
- package/dist/waas.cjs +64 -39
- package/dist/waas.cjs.map +1 -1
- package/dist/waas.esm.js +64 -39
- package/dist/waas.esm.js.map +1 -1
- package/dist/waas.native.esm.js +63 -38
- package/dist/waas.native.esm.js.map +1 -1
- package/dist/waasCore.cjs +7 -7
- package/dist/waasCore.esm.js +7 -7
- package/dist/waasCore.native.esm.js +6 -6
- package/ios/DynamicClientScreenshotProtection.mm +11 -0
- package/package.json +3 -3
- package/dist/getNetworkProviderFromNetworkId-BVP0ghId.cjs.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-Bh4_-rhf.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-OfuaqHXU.esm.js.map +0 -1
- package/dist/migrateFromFireblocks-7aKNa_3P.native.esm.js.map +0 -1
- package/dist/migrateFromFireblocks-BnHU2AZJ.cjs.map +0 -1
- package/dist/migrateFromFireblocks-DkQj3aYU.esm.js.map +0 -1
- package/dist/services/openDeeplink/createWebDeeplinkOpener/createWebDeeplinkOpener.d.ts.map +0 -1
- package/dist/services/openDeeplink/createWebDeeplinkOpener/index.d.ts +0 -2
- package/dist/services/openDeeplink/createWebDeeplinkOpener/index.d.ts.map +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { $ as UnauthorizedError, A as isSignedIn, B as retryOnFail, C as getWalletProviderFromWalletAccount, Ct as version, D as NoWalletProviderFoundError, F as CHAINS_INFO_MAP, G as createApiClient, H as offEvent, I as formatWalletAccountId, L as normalizeAddress, O as generateSessionKeys, P as getChainFromVerifiedCredentialChain, Q as createStorageKeySchema, R as splitWalletProviderKey, S as extractSessionId, St as name, T as getWalletProviderRegistry, U as onEvent, V as emitEvent, W as onceEvent, X as fetchAndStoreNonces, Y as getNonce, Z as updateNoncePoolStorage, _ as instrumentFunction, _t as getDefaultClient, a as initializeWaasClientsForEagerRecovery, at as APIError, b as getUserAgent, bt as BaseError, ct as SDK_API_CORE_VERSION, dt as assertDefined, et as SandboxMaximumThresholdReachedError, f as getWalletProviders, ft as ValueMustBeDefinedError, g as __logoutWithReason_wrapped, gt as NONCE_POOL_SIZE, ht as getPlatform, i as InvalidParamError, it as InvalidExternalAuthError, j as getWalletAccounts, k as fetchProjectSettings, m as checkAndRaiseWalletAccountsChangedEvent, mt as randomString, n as upsertElevatedAccessToken, nt as MfaInvalidOtpError, p as isUserMissingMfaAuth, pt as getElevatedAccessToken, r as parseElevatedAccessToken, rt as LinkCredentialError, st as DYNAMIC_ICONIC_SPRITE_URL, t as updateAuthFromVerifyResponse, tt as MfaRateLimitedError, ut as isCookieEnabled, v as scrubParameters, vt as setDefaultClient, w as WalletProviderPriority, x as getOperatingSystem, xt as getCore, y as DEFAULT_PII_FIELDS } from "./updateAuthFromVerifyResponse-
|
|
2
|
-
import { B as
|
|
3
|
-
import { n as NotWaasWalletAccountError, r as __refreshAuth_wrapped } from "./isDynamicWaasEnabled-
|
|
4
|
-
import { a as WaasOnboardingIncompleteError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, o as WaasLoadFailedError, r as isDeviceRegistrationRequired, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-
|
|
5
|
-
import { n as getVerifiedCredentialForWalletAccount, t as getWalletProviderByKey } from "./getWalletProviderByKey-
|
|
6
|
-
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-
|
|
1
|
+
import { $ as UnauthorizedError, A as isSignedIn, B as retryOnFail, C as getWalletProviderFromWalletAccount, Ct as version, D as NoWalletProviderFoundError, F as CHAINS_INFO_MAP, G as createApiClient, H as offEvent, I as formatWalletAccountId, L as normalizeAddress, O as generateSessionKeys, P as getChainFromVerifiedCredentialChain, Q as createStorageKeySchema, R as splitWalletProviderKey, S as extractSessionId, St as name, T as getWalletProviderRegistry, U as onEvent, V as emitEvent, W as onceEvent, X as fetchAndStoreNonces, Y as getNonce, Z as updateNoncePoolStorage, _ as instrumentFunction, _t as getDefaultClient, a as initializeWaasClientsForEagerRecovery, at as APIError, b as getUserAgent, bt as BaseError, ct as SDK_API_CORE_VERSION, dt as assertDefined, et as SandboxMaximumThresholdReachedError, f as getWalletProviders, ft as ValueMustBeDefinedError, g as __logoutWithReason_wrapped, gt as NONCE_POOL_SIZE, ht as getPlatform, i as InvalidParamError, it as InvalidExternalAuthError, j as getWalletAccounts, k as fetchProjectSettings, m as checkAndRaiseWalletAccountsChangedEvent, mt as randomString, n as upsertElevatedAccessToken, nt as MfaInvalidOtpError, p as isUserMissingMfaAuth, pt as getElevatedAccessToken, r as parseElevatedAccessToken, rt as LinkCredentialError, st as DYNAMIC_ICONIC_SPRITE_URL, t as updateAuthFromVerifyResponse, tt as MfaRateLimitedError, ut as isCookieEnabled, v as scrubParameters, vt as setDefaultClient, w as WalletProviderPriority, x as getOperatingSystem, xt as getCore, y as DEFAULT_PII_FIELDS } from "./updateAuthFromVerifyResponse-C_yGmd99.esm.js";
|
|
2
|
+
import { A as createCrossTabBroadcast, B as subscribeWithSelector, C as getKeychainIndexedDBName, D as assertSafeNavigationUrl, E as createKeychainService, F as GENERATE_SESSION_KEYS_TRACKER_KEY, G as isServerSideRendering, H as createStorage, I as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, K as UnavailableInServerSideError, L as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, M as CannotTrackError, N as createDeferredPromise, P as FETCH_PROJECT_SETTINGS_TRACKER_KEY, R as REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY, S as MergeAccountsConfirmationError, T as assertSafeDeeplinkUrl, V as isEqualShallow, W as createLocalStorageAdapter, _ as consumeCaptchaToken, a as verifyMessageSignatureOwnership, b as WalletAlreadyLinkedToAnotherUserError, c as formatSignInMessage, d as updateWalletProviderKeysForVerifiedCredentials, f as setUnverifiedWalletAccounts, g as MethodNotImplementedError, h as __setCaptchaToken_wrapped, i as getNetworksData, k as createLogger, l as getAppMetadata, m as hasExtension, o as removeUnverifiedWalletAccount, p as createVisit, s as createSignInMessageStatement, t as getNetworkProviderFromNetworkId, u as reconcileWalletAccountsAgainstClient, v as isCaptchaRequired, w as createRealtimeService, x as NoNetworkProvidersError, y as WalletScreeningBlockedError, z as getBuffer } from "./getNetworkProviderFromNetworkId-CYONf9-8.esm.js";
|
|
3
|
+
import { n as NotWaasWalletAccountError, r as __refreshAuth_wrapped } from "./isDynamicWaasEnabled-BbhbghRE.esm.js";
|
|
4
|
+
import { a as WaasOnboardingIncompleteError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, o as WaasLoadFailedError, r as isDeviceRegistrationRequired, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-WzXFgdor.esm.js";
|
|
5
|
+
import { n as getVerifiedCredentialForWalletAccount, t as getWalletProviderByKey } from "./getWalletProviderByKey-Dh3JbMi6.esm.js";
|
|
6
|
+
import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-DBlmv1ew.esm.js";
|
|
7
7
|
import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
|
|
8
8
|
import { AuthModeEnum, CaptchaProviderEnum as CaptchaProviderEnum$1, ExchangeKeyEnum, JwtVerifiedCredentialFormatEnum, JwtVerifiedCredentialFormatEnum as JwtVerifiedCredentialFormatEnum$1, MFAAction, MfaBackupCodeAcknowledgement, ProviderEnum, ProviderEnum as ProviderEnum$1, TokenScope, TokenScope as TokenScope$1, WaasBackupOptionsEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
9
9
|
import * as z from "zod/mini";
|
|
10
|
-
import EventEmitter
|
|
10
|
+
import EventEmitter, { EventEmitter as EventEmitter$1 } from "eventemitter3";
|
|
11
11
|
import { browserSupportsWebAuthn, startAuthentication, startRegistration } from "@simplewebauthn/browser";
|
|
12
12
|
|
|
13
13
|
//#region src/modules/state/raiseStateEvents/events.ts
|
|
@@ -567,7 +567,7 @@ const createAsyncTrack = () => {
|
|
|
567
567
|
* This ensures no process is missed (as it would throw when tracked on a different node tick).
|
|
568
568
|
*/
|
|
569
569
|
let isTrackEnabled = true;
|
|
570
|
-
const eventEmitter = new EventEmitter();
|
|
570
|
+
const eventEmitter = new EventEmitter$1();
|
|
571
571
|
const allSettledPromise = createDeferredPromise();
|
|
572
572
|
const tracker = /* @__PURE__ */ new Map();
|
|
573
573
|
/**
|
|
@@ -614,7 +614,7 @@ const createAsyncTrack = () => {
|
|
|
614
614
|
//#endregion
|
|
615
615
|
//#region src/services/eventEmitter/createEventEmitter.ts
|
|
616
616
|
/** @notInstrumented */
|
|
617
|
-
const createEventEmitter = () => new EventEmitter
|
|
617
|
+
const createEventEmitter = () => new EventEmitter();
|
|
618
618
|
|
|
619
619
|
//#endregion
|
|
620
620
|
//#region src/services/fetch/createWebFetch.ts
|
|
@@ -763,66 +763,14 @@ const createNavigationHandler = () => {
|
|
|
763
763
|
};
|
|
764
764
|
|
|
765
765
|
//#endregion
|
|
766
|
-
//#region src/
|
|
767
|
-
/**
|
|
768
|
-
* Thrown when a deeplink is opened with a URL whose scheme can execute script
|
|
769
|
-
* in the current origin (`javascript:`, `data:`, `vbscript:`). Unlike
|
|
770
|
-
* navigation, deeplinks legitimately use custom app schemes (e.g. `phantom:`,
|
|
771
|
-
* `metamask:`), so this guards via a denylist of dangerous schemes rather than
|
|
772
|
-
* an `http(s)` allowlist, preventing DOM XSS through the `window.location.assign`
|
|
773
|
-
* sink while leaving valid wallet deeplinks untouched.
|
|
774
|
-
*/
|
|
775
|
-
var UnsafeDeeplinkUrlError = class extends BaseError {
|
|
776
|
-
constructor({ scheme }) {
|
|
777
|
-
super({
|
|
778
|
-
cause: null,
|
|
779
|
-
code: "unsafe_deeplink_url_error",
|
|
780
|
-
docsUrl: null,
|
|
781
|
-
name: "UnsafeDeeplinkUrlError",
|
|
782
|
-
shortMessage: `Refusing to open a deeplink with an unsafe scheme "${scheme}". Script-executing schemes (javascript:, data:, vbscript:) are not allowed. This may indicate a compromised or misconfigured deeplink URL.`
|
|
783
|
-
});
|
|
784
|
-
}
|
|
785
|
-
};
|
|
786
|
-
|
|
787
|
-
//#endregion
|
|
788
|
-
//#region src/utils/assertSafeDeeplinkUrl/assertSafeDeeplinkUrl.ts
|
|
789
|
-
/**
|
|
790
|
-
* Schemes that can execute script in the current origin and must never reach a
|
|
791
|
-
* deeplink navigation sink. Deeplinks legitimately use arbitrary custom app
|
|
792
|
-
* schemes (e.g. `phantom:`, `metamask:`), so a denylist of dangerous schemes is
|
|
793
|
-
* used here instead of the `http(s)` allowlist applied to standard navigation.
|
|
794
|
-
*/
|
|
795
|
-
const DANGEROUS_DEEPLINK_SCHEMES = new Set([
|
|
796
|
-
"javascript:",
|
|
797
|
-
"data:",
|
|
798
|
-
"vbscript:",
|
|
799
|
-
"blob:"
|
|
800
|
-
]);
|
|
801
|
-
/**
|
|
802
|
-
* Asserts that the given deeplink URL is safe to open, i.e. its scheme is not
|
|
803
|
-
* one that can execute script (`javascript:`, `data:`, `vbscript:`, `blob:`). Used as a
|
|
804
|
-
* defense-in-depth guard on the `window.location.assign` deeplink sink to
|
|
805
|
-
* prevent DOM XSS, while still permitting custom wallet app schemes.
|
|
806
|
-
*
|
|
807
|
-
* @param url - The deeplink URL string to validate.
|
|
808
|
-
* @throws {UnsafeDeeplinkUrlError} If the URL cannot be parsed or its scheme can execute script.
|
|
809
|
-
* @notInstrumented
|
|
810
|
-
*/
|
|
811
|
-
const assertSafeDeeplinkUrl = (url) => {
|
|
812
|
-
let parsed;
|
|
813
|
-
try {
|
|
814
|
-
parsed = new URL(url);
|
|
815
|
-
} catch {
|
|
816
|
-
throw new UnsafeDeeplinkUrlError({ scheme: "unknown" });
|
|
817
|
-
}
|
|
818
|
-
if (DANGEROUS_DEEPLINK_SCHEMES.has(parsed.protocol)) throw new UnsafeDeeplinkUrlError({ scheme: parsed.protocol });
|
|
819
|
-
};
|
|
820
|
-
|
|
821
|
-
//#endregion
|
|
822
|
-
//#region src/services/openDeeplink/createWebDeeplinkOpener/createWebDeeplinkOpener.ts
|
|
766
|
+
//#region src/services/openDeeplink/createDeeplinkOpener/createDeeplinkOpener.ts
|
|
823
767
|
/**
|
|
824
768
|
* Creates a deeplink opener that navigates the current tab to the deeplink URL.
|
|
825
769
|
*
|
|
770
|
+
* This is the default (web) implementation. React Native builds resolve
|
|
771
|
+
* `createDeeplinkOpener.native.ts` instead, which opens the URL via RN
|
|
772
|
+
* `Linking` since there is no browser navigation on device.
|
|
773
|
+
*
|
|
826
774
|
* Uses `window.location.assign` instead of `window.open` deliberately.
|
|
827
775
|
* This matters for Phantom redirect specifically, which is the only deep link
|
|
828
776
|
* provider that redirects back to the app in a new tab. With `window.open`,
|
|
@@ -834,8 +782,8 @@ const assertSafeDeeplinkUrl = (url) => {
|
|
|
834
782
|
* entirely.
|
|
835
783
|
* @notInstrumented
|
|
836
784
|
*/
|
|
837
|
-
const
|
|
838
|
-
if (isServerSideRendering()) return () => Promise.reject(new UnavailableInServerSideError("
|
|
785
|
+
const createDeeplinkOpener = () => {
|
|
786
|
+
if (isServerSideRendering()) return () => Promise.reject(new UnavailableInServerSideError("createDeeplinkOpener"));
|
|
839
787
|
return async (url) => {
|
|
840
788
|
assertSafeDeeplinkUrl(url);
|
|
841
789
|
window.location.assign(url);
|
|
@@ -1027,7 +975,7 @@ const createCore = (config) => {
|
|
|
1027
975
|
storageAdapter: config.coreConfig?.storageAdapter ?? createLocalStorageAdapter()
|
|
1028
976
|
});
|
|
1029
977
|
const fetch = config.coreConfig?.fetch ?? createWebFetch();
|
|
1030
|
-
const openDeeplink = config.coreConfig?.openDeeplink ??
|
|
978
|
+
const openDeeplink = config.coreConfig?.openDeeplink ?? createDeeplinkOpener();
|
|
1031
979
|
const openAuthSession = config.coreConfig?.openAuthSession;
|
|
1032
980
|
const navigate = config.coreConfig?.navigate ?? createNavigationHandler();
|
|
1033
981
|
const state = createObservableState(getInitialState);
|
|
@@ -3899,8 +3847,8 @@ const prepareFlowSigning = async ({ assertBalanceForGasCost, assertBalanceForTra
|
|
|
3899
3847
|
environmentId,
|
|
3900
3848
|
flowId,
|
|
3901
3849
|
flowPrepareSigningRequest: {
|
|
3902
|
-
assertBalanceForGasCost: assertBalanceForGasCost ??
|
|
3903
|
-
assertBalanceForTransferAmount: assertBalanceForTransferAmount ??
|
|
3850
|
+
assertBalanceForGasCost: assertBalanceForGasCost ?? true,
|
|
3851
|
+
assertBalanceForTransferAmount: assertBalanceForTransferAmount ?? true
|
|
3904
3852
|
},
|
|
3905
3853
|
xDynamicFlowSessionToken: sessionToken
|
|
3906
3854
|
}),
|