@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.
Files changed (105) hide show
  1. package/dist/{NativeModuleNotLinkedError-DLP1hpcM.native.esm.js → NativeModuleNotLinkedError-dFDBC524.native.esm.js} +3 -3
  2. package/dist/{NativeModuleNotLinkedError-DLP1hpcM.native.esm.js.map → NativeModuleNotLinkedError-dFDBC524.native.esm.js.map} +1 -1
  3. package/dist/{consumeMfaTokenIfRequiredForAction-D2oiQdpj.esm.js → consumeMfaTokenIfRequiredForAction-DdGzQwQQ.esm.js} +2 -2
  4. package/dist/{consumeMfaTokenIfRequiredForAction-D2oiQdpj.esm.js.map → consumeMfaTokenIfRequiredForAction-DdGzQwQQ.esm.js.map} +1 -1
  5. package/dist/{consumeMfaTokenIfRequiredForAction-DJAdtHe3.cjs → consumeMfaTokenIfRequiredForAction-IsOFRL68.cjs} +2 -2
  6. package/dist/{consumeMfaTokenIfRequiredForAction-DJAdtHe3.cjs.map → consumeMfaTokenIfRequiredForAction-IsOFRL68.cjs.map} +1 -1
  7. package/dist/core.cjs +7 -6
  8. package/dist/core.cjs.map +1 -1
  9. package/dist/core.esm.js +9 -9
  10. package/dist/core.esm.js.map +1 -1
  11. package/dist/core.native.esm.js +6 -6
  12. package/dist/core.native.esm.js.map +1 -1
  13. package/dist/exports/core.d.ts +2 -0
  14. package/dist/exports/core.d.ts.map +1 -1
  15. package/dist/exports/waas.d.ts +1 -1
  16. package/dist/exports/waas.d.ts.map +1 -1
  17. package/dist/{getNetworkProviderFromNetworkId-BVP0ghId.cjs → getNetworkProviderFromNetworkId-CIcatN8-.cjs} +64 -2
  18. package/dist/getNetworkProviderFromNetworkId-CIcatN8-.cjs.map +1 -0
  19. package/dist/{getNetworkProviderFromNetworkId-OfuaqHXU.esm.js → getNetworkProviderFromNetworkId-CYONf9-8.esm.js} +63 -7
  20. package/dist/getNetworkProviderFromNetworkId-CYONf9-8.esm.js.map +1 -0
  21. package/dist/{getNetworkProviderFromNetworkId-Bh4_-rhf.native.esm.js → getNetworkProviderFromNetworkId-nLBIQ_5p.native.esm.js} +59 -3
  22. package/dist/getNetworkProviderFromNetworkId-nLBIQ_5p.native.esm.js.map +1 -0
  23. package/dist/{getSignedSessionId-CDEQ6TMC.esm.js → getSignedSessionId-B2kslh_k.esm.js} +2 -2
  24. package/dist/{getSignedSessionId-CDEQ6TMC.esm.js.map → getSignedSessionId-B2kslh_k.esm.js.map} +1 -1
  25. package/dist/{getSignedSessionId-2jmv21__.native.esm.js → getSignedSessionId-DV0hK3Tu.native.esm.js} +3 -3
  26. package/dist/{getSignedSessionId-2jmv21__.native.esm.js.map → getSignedSessionId-DV0hK3Tu.native.esm.js.map} +1 -1
  27. package/dist/{getSignedSessionId-_ZPqzvm5.cjs → getSignedSessionId-NZ8ndqG1.cjs} +2 -2
  28. package/dist/{getSignedSessionId-_ZPqzvm5.cjs.map → getSignedSessionId-NZ8ndqG1.cjs.map} +1 -1
  29. package/dist/{getWalletProviderByKey-0VBVdu30.native.esm.js → getWalletProviderByKey-DPZP397j.native.esm.js} +2 -2
  30. package/dist/{getWalletProviderByKey-0VBVdu30.native.esm.js.map → getWalletProviderByKey-DPZP397j.native.esm.js.map} +1 -1
  31. package/dist/{getWalletProviderByKey-BIHCI8S6.esm.js → getWalletProviderByKey-Dh3JbMi6.esm.js} +2 -2
  32. package/dist/{getWalletProviderByKey-BIHCI8S6.esm.js.map → getWalletProviderByKey-Dh3JbMi6.esm.js.map} +1 -1
  33. package/dist/{getWalletProviderByKey-F5wxlC_k.cjs → getWalletProviderByKey-DzKZXm5S.cjs} +2 -2
  34. package/dist/{getWalletProviderByKey-F5wxlC_k.cjs.map → getWalletProviderByKey-DzKZXm5S.cjs.map} +1 -1
  35. package/dist/index.cjs +17 -69
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.esm.js +19 -71
  38. package/dist/index.esm.js.map +1 -1
  39. package/dist/index.native.esm.js +20 -79
  40. package/dist/index.native.esm.js.map +1 -1
  41. package/dist/{isDynamicWaasEnabled-OlDJAGIi.esm.js → isDynamicWaasEnabled-BbhbghRE.esm.js} +2 -2
  42. package/dist/{isDynamicWaasEnabled-OlDJAGIi.esm.js.map → isDynamicWaasEnabled-BbhbghRE.esm.js.map} +1 -1
  43. package/dist/{isDynamicWaasEnabled-cVxCp5BV.native.esm.js → isDynamicWaasEnabled-BmB0lQJf.native.esm.js} +2 -2
  44. package/dist/{isDynamicWaasEnabled-cVxCp5BV.native.esm.js.map → isDynamicWaasEnabled-BmB0lQJf.native.esm.js.map} +1 -1
  45. package/dist/{isDynamicWaasEnabled-YigU-EAT.cjs → isDynamicWaasEnabled-D2U3MRnA.cjs} +2 -2
  46. package/dist/{isDynamicWaasEnabled-YigU-EAT.cjs.map → isDynamicWaasEnabled-D2U3MRnA.cjs.map} +1 -1
  47. package/dist/{isMfaRequiredForAction-Bn2HCYvZ.esm.js → isMfaRequiredForAction-DBlmv1ew.esm.js} +2 -2
  48. package/dist/{isMfaRequiredForAction-Bn2HCYvZ.esm.js.map → isMfaRequiredForAction-DBlmv1ew.esm.js.map} +1 -1
  49. package/dist/{isMfaRequiredForAction-BtPXuiSY.cjs → isMfaRequiredForAction-DCyorelQ.cjs} +2 -2
  50. package/dist/{isMfaRequiredForAction-BtPXuiSY.cjs.map → isMfaRequiredForAction-DCyorelQ.cjs.map} +1 -1
  51. package/dist/{isMfaRequiredForAction-DjC0wQJ4.native.esm.js → isMfaRequiredForAction-DP0kk0tY.native.esm.js} +2 -2
  52. package/dist/{isMfaRequiredForAction-DjC0wQJ4.native.esm.js.map → isMfaRequiredForAction-DP0kk0tY.native.esm.js.map} +1 -1
  53. package/dist/{isUserOnboardingComplete-Bi7tw1lk.cjs → isUserOnboardingComplete-DygWGu6p.cjs} +3 -3
  54. package/dist/{isUserOnboardingComplete-Bi7tw1lk.cjs.map → isUserOnboardingComplete-DygWGu6p.cjs.map} +1 -1
  55. package/dist/{isUserOnboardingComplete-BCZpska8.native.esm.js → isUserOnboardingComplete-Ebw4x90F.native.esm.js} +3 -3
  56. package/dist/{isUserOnboardingComplete-BCZpska8.native.esm.js.map → isUserOnboardingComplete-Ebw4x90F.native.esm.js.map} +1 -1
  57. package/dist/{isUserOnboardingComplete-DScTOOg_.esm.js → isUserOnboardingComplete-WzXFgdor.esm.js} +3 -3
  58. package/dist/{isUserOnboardingComplete-DScTOOg_.esm.js.map → isUserOnboardingComplete-WzXFgdor.esm.js.map} +1 -1
  59. package/dist/{migrateFromFireblocks-DkQj3aYU.esm.js → migrateFromFireblocks-BkcGdF_B.esm.js} +14 -14
  60. package/dist/migrateFromFireblocks-BkcGdF_B.esm.js.map +1 -0
  61. package/dist/{migrateFromFireblocks-7aKNa_3P.native.esm.js → migrateFromFireblocks-C1yQ4dm7.native.esm.js} +13 -13
  62. package/dist/migrateFromFireblocks-C1yQ4dm7.native.esm.js.map +1 -0
  63. package/dist/{migrateFromFireblocks-BnHU2AZJ.cjs → migrateFromFireblocks-CzPWPaDr.cjs} +13 -13
  64. package/dist/migrateFromFireblocks-CzPWPaDr.cjs.map +1 -0
  65. package/dist/modules/flow/prepareFlowSigning/prepareFlowSigning.d.ts +2 -2
  66. package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts +7 -11
  67. package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts.map +1 -1
  68. package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts +4 -4
  69. package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts.map +1 -1
  70. package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts +1 -1
  71. package/dist/modules/waas/businessAccounts/assertTargetIdentity.d.ts +14 -0
  72. package/dist/modules/waas/businessAccounts/assertTargetIdentity.d.ts.map +1 -0
  73. package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts +15 -1
  74. package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts.map +1 -1
  75. package/dist/modules/waas/waas.types.d.ts +2 -2
  76. package/dist/modules/waas/waas.types.d.ts.map +1 -1
  77. package/dist/services/openDeeplink/{createWebDeeplinkOpener/createWebDeeplinkOpener.d.ts → createDeeplinkOpener/createDeeplinkOpener.d.ts} +6 -2
  78. package/dist/services/openDeeplink/createDeeplinkOpener/createDeeplinkOpener.d.ts.map +1 -0
  79. package/dist/services/openDeeplink/createDeeplinkOpener/index.d.ts +2 -0
  80. package/dist/services/openDeeplink/createDeeplinkOpener/index.d.ts.map +1 -0
  81. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  82. package/dist/{updateAuthFromVerifyResponse-B2QePeNz.cjs → updateAuthFromVerifyResponse-B8tDJdXY.cjs} +3 -3
  83. package/dist/{updateAuthFromVerifyResponse-B2QePeNz.cjs.map → updateAuthFromVerifyResponse-B8tDJdXY.cjs.map} +1 -1
  84. package/dist/{updateAuthFromVerifyResponse-wHGRunTk.esm.js → updateAuthFromVerifyResponse-C_yGmd99.esm.js} +3 -3
  85. package/dist/{updateAuthFromVerifyResponse-wHGRunTk.esm.js.map → updateAuthFromVerifyResponse-C_yGmd99.esm.js.map} +1 -1
  86. package/dist/waas.cjs +64 -39
  87. package/dist/waas.cjs.map +1 -1
  88. package/dist/waas.esm.js +64 -39
  89. package/dist/waas.esm.js.map +1 -1
  90. package/dist/waas.native.esm.js +63 -38
  91. package/dist/waas.native.esm.js.map +1 -1
  92. package/dist/waasCore.cjs +7 -7
  93. package/dist/waasCore.esm.js +7 -7
  94. package/dist/waasCore.native.esm.js +6 -6
  95. package/ios/DynamicClientScreenshotProtection.mm +11 -0
  96. package/package.json +3 -3
  97. package/dist/getNetworkProviderFromNetworkId-BVP0ghId.cjs.map +0 -1
  98. package/dist/getNetworkProviderFromNetworkId-Bh4_-rhf.native.esm.js.map +0 -1
  99. package/dist/getNetworkProviderFromNetworkId-OfuaqHXU.esm.js.map +0 -1
  100. package/dist/migrateFromFireblocks-7aKNa_3P.native.esm.js.map +0 -1
  101. package/dist/migrateFromFireblocks-BnHU2AZJ.cjs.map +0 -1
  102. package/dist/migrateFromFireblocks-DkQj3aYU.esm.js.map +0 -1
  103. package/dist/services/openDeeplink/createWebDeeplinkOpener/createWebDeeplinkOpener.d.ts.map +0 -1
  104. package/dist/services/openDeeplink/createWebDeeplinkOpener/index.d.ts +0 -2
  105. package/dist/services/openDeeplink/createWebDeeplinkOpener/index.d.ts.map +0 -1
@@ -1,12 +1,13 @@
1
- import { $ as UnauthorizedError, B as onEvent, Ct as name, E as getWalletProviderRegistry, F as normalizeAddress, H as createApiClient, I as splitWalletProviderKey, K as getNonce, M as getChainFromVerifiedCredentialChain, N as CHAINS_INFO_MAP, O as NoWalletProviderFoundError, P as formatWalletAccountId, Q as createLocalStorageAdapter, R as emitEvent, S as extractSessionId, St as getCore, T as WalletProviderPriority, V as onceEvent, X as updateNoncePoolStorage, Y as fetchAndStoreNonces, Z as createStorageKeySchema, _ as instrumentFunction, _t as NONCE_POOL_SIZE, a as InvalidParamError, at as APIError, b as getUserAgent, ct as DYNAMIC_ICONIC_SPRITE_URL, dt as isCookieEnabled, et as SandboxMaximumThresholdReachedError, ft as assertDefined, gt as getPlatform, h as checkAndRaiseWalletAccountsChangedEvent, ht as randomString, i as parseElevatedAccessToken, it as InvalidExternalAuthError, k as getWalletAccounts, lt as SDK_API_CORE_VERSION, m as isUserMissingMfaAuth, mt as getElevatedAccessToken, n as updateAuthFromVerifyResponse, nt as MfaInvalidOtpError, o as initializeWaasClientsForEagerRecovery, p as getWalletProviders, pt as ValueMustBeDefinedError, r as upsertElevatedAccessToken, rt as LinkCredentialError, tt as MfaRateLimitedError, v as scrubParameters, vt as getDefaultClient, w as getWalletProviderFromWalletAccount, wt as version, x as getOperatingSystem, xt as BaseError, y as DEFAULT_PII_FIELDS, yt as setDefaultClient, z as offEvent } from "./NativeModuleNotLinkedError-DLP1hpcM.native.esm.js";
2
- import { B as subscribeWithSelector, C as getKeychainIndexedDBName, E as assertSafeNavigationUrl, F as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, H as createStorage, I as REFRESH_USER_STATE_FROM_COOKIE_TRACKER_KEY, L as REFRESH_USER_STATE_FROM_VALID_TOKEN_TRACKER_KEY, M as createDeferredPromise, N as FETCH_PROJECT_SETTINGS_TRACKER_KEY, O as createLogger, P as GENERATE_SESSION_KEYS_TRACKER_KEY, R as isServerSideRendering, S as MergeAccountsConfirmationError, T as createKeychainService, V as isEqualShallow, _ as getAppMetadata, a as verifyMessageSignatureOwnership, b as WalletAlreadyLinkedToAnotherUserError, c as formatSignInMessage, d as setUnverifiedWalletAccounts, f as createVisit, g as isCaptchaRequired, h as consumeCaptchaToken, i as getNetworksData, j as CannotTrackError, k as createCrossTabBroadcast, l as reconcileWalletAccountsAgainstClient, m as __setCaptchaToken_wrapped, o as removeUnverifiedWalletAccount, p as hasExtension, s as createSignInMessageStatement, t as getNetworkProviderFromNetworkId, u as updateWalletProviderKeysForVerifiedCredentials, v as MethodNotImplementedError, w as createRealtimeService, x as NoNetworkProvidersError, y as WalletScreeningBlockedError, z as getBuffer } from "./getNetworkProviderFromNetworkId-Bh4_-rhf.native.esm.js";
3
- import { a as fetchProjectSettings, i as generateSessionKeys, n as getVerifiedCredentialForWalletAccount, o as isSignedIn, r as __logoutWithReason_wrapped, s as retryOnFail, t as getWalletProviderByKey } from "./getWalletProviderByKey-0VBVdu30.native.esm.js";
4
- import { n as NotWaasWalletAccountError, r as __refreshAuth_wrapped } from "./isDynamicWaasEnabled-cVxCp5BV.native.esm.js";
5
- import { a as WaasOnboardingIncompleteError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, o as WaasLoadFailedError, r as isDeviceRegistrationRequired, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-BCZpska8.native.esm.js";
6
- import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-DjC0wQJ4.native.esm.js";
1
+ import { $ as UnauthorizedError, B as onEvent, Ct as name, E as getWalletProviderRegistry, F as normalizeAddress, H as createApiClient, I as splitWalletProviderKey, K as getNonce, M as getChainFromVerifiedCredentialChain, N as CHAINS_INFO_MAP, O as NoWalletProviderFoundError, P as formatWalletAccountId, Q as createLocalStorageAdapter, R as emitEvent, S as extractSessionId, St as getCore, T as WalletProviderPriority, V as onceEvent, X as updateNoncePoolStorage, Y as fetchAndStoreNonces, Z as createStorageKeySchema, _ as instrumentFunction, _t as NONCE_POOL_SIZE, a as InvalidParamError, at as APIError, b as getUserAgent, ct as DYNAMIC_ICONIC_SPRITE_URL, dt as isCookieEnabled, et as SandboxMaximumThresholdReachedError, ft as assertDefined, gt as getPlatform, h as checkAndRaiseWalletAccountsChangedEvent, ht as randomString, i as parseElevatedAccessToken, it as InvalidExternalAuthError, k as getWalletAccounts, lt as SDK_API_CORE_VERSION, m as isUserMissingMfaAuth, mt as getElevatedAccessToken, n as updateAuthFromVerifyResponse, nt as MfaInvalidOtpError, o as initializeWaasClientsForEagerRecovery, p as getWalletProviders, pt as ValueMustBeDefinedError, r as upsertElevatedAccessToken, rt as LinkCredentialError, tt as MfaRateLimitedError, v as scrubParameters, vt as getDefaultClient, w as getWalletProviderFromWalletAccount, wt as version, x as getOperatingSystem, xt as BaseError, y as DEFAULT_PII_FIELDS, yt as setDefaultClient, z as offEvent } from "./NativeModuleNotLinkedError-dFDBC524.native.esm.js";
2
+ import { A as createCrossTabBroadcast, B as getBuffer, C as getKeychainIndexedDBName, D as assertSafeNavigationUrl, E as createKeychainService, F as GENERATE_SESSION_KEYS_TRACKER_KEY, H as isEqualShallow, I as INITIALIZE_STORAGE_SYNC_TRACKER_KEY, 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, U as createStorage, V as subscribeWithSelector, _ as getAppMetadata, a as verifyMessageSignatureOwnership, b as WalletAlreadyLinkedToAnotherUserError, c as formatSignInMessage, d as setUnverifiedWalletAccounts, f as createVisit, g as isCaptchaRequired, h as consumeCaptchaToken, i as getNetworksData, k as createLogger, l as reconcileWalletAccountsAgainstClient, m as __setCaptchaToken_wrapped, o as removeUnverifiedWalletAccount, p as hasExtension, s as createSignInMessageStatement, t as getNetworkProviderFromNetworkId, u as updateWalletProviderKeysForVerifiedCredentials, v as MethodNotImplementedError, w as createRealtimeService, x as NoNetworkProvidersError, y as WalletScreeningBlockedError, z as isServerSideRendering } from "./getNetworkProviderFromNetworkId-nLBIQ_5p.native.esm.js";
3
+ import { a as fetchProjectSettings, i as generateSessionKeys, n as getVerifiedCredentialForWalletAccount, o as isSignedIn, r as __logoutWithReason_wrapped, s as retryOnFail, t as getWalletProviderByKey } from "./getWalletProviderByKey-DPZP397j.native.esm.js";
4
+ import { n as NotWaasWalletAccountError, r as __refreshAuth_wrapped } from "./isDynamicWaasEnabled-BmB0lQJf.native.esm.js";
5
+ import { a as WaasOnboardingIncompleteError, i as preconnectWaasIframe, n as isPendingRecoveryCodesAcknowledgment, o as WaasLoadFailedError, r as isDeviceRegistrationRequired, t as isUserOnboardingComplete } from "./isUserOnboardingComplete-Ebw4x90F.native.esm.js";
6
+ import { n as getMfaMethods, r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-DP0kk0tY.native.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 { Linking } from "react-native";
10
11
  import EventEmitter, { EventEmitter as EventEmitter$1 } from "eventemitter3";
11
12
  import { Passkey } from "react-native-passkey";
12
13
 
@@ -777,82 +778,22 @@ const createNavigationHandler = () => {
777
778
  };
778
779
 
779
780
  //#endregion
780
- //#region src/errors/UnsafeDeeplinkUrlError.ts
781
+ //#region src/services/openDeeplink/createDeeplinkOpener/createDeeplinkOpener.native.ts
781
782
  /**
782
- * Thrown when a deeplink is opened with a URL whose scheme can execute script
783
- * in the current origin (`javascript:`, `data:`, `vbscript:`). Unlike
784
- * navigation, deeplinks legitimately use custom app schemes (e.g. `phantom:`,
785
- * `metamask:`), so this guards via a denylist of dangerous schemes rather than
786
- * an `http(s)` allowlist, preventing DOM XSS through the `window.location.assign`
787
- * sink while leaving valid wallet deeplinks untouched.
788
- */
789
- var UnsafeDeeplinkUrlError = class extends BaseError {
790
- constructor({ scheme }) {
791
- super({
792
- cause: null,
793
- code: "unsafe_deeplink_url_error",
794
- docsUrl: null,
795
- name: "UnsafeDeeplinkUrlError",
796
- 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.`
797
- });
798
- }
799
- };
800
-
801
- //#endregion
802
- //#region src/utils/assertSafeDeeplinkUrl/assertSafeDeeplinkUrl.ts
803
- /**
804
- * Schemes that can execute script in the current origin and must never reach a
805
- * deeplink navigation sink. Deeplinks legitimately use arbitrary custom app
806
- * schemes (e.g. `phantom:`, `metamask:`), so a denylist of dangerous schemes is
807
- * used here instead of the `http(s)` allowlist applied to standard navigation.
808
- */
809
- const DANGEROUS_DEEPLINK_SCHEMES = new Set([
810
- "javascript:",
811
- "data:",
812
- "vbscript:",
813
- "blob:"
814
- ]);
815
- /**
816
- * Asserts that the given deeplink URL is safe to open, i.e. its scheme is not
817
- * one that can execute script (`javascript:`, `data:`, `vbscript:`, `blob:`). Used as a
818
- * defense-in-depth guard on the `window.location.assign` deeplink sink to
819
- * prevent DOM XSS, while still permitting custom wallet app schemes.
783
+ * React Native variant of the deeplink opener.
820
784
  *
821
- * @param url - The deeplink URL string to validate.
822
- * @throws {UnsafeDeeplinkUrlError} If the URL cannot be parsed or its scheme can execute script.
785
+ * Metro resolves `.native.ts` over the plain `.ts` counterpart, so this file
786
+ * is used exclusively in RN builds. React Native has no browser navigation, so
787
+ * the web implementation (`window.location.assign`) is unusable — and RN's
788
+ * read-only `location` throws on href assignment. `Linking.openURL` is the
789
+ * platform primitive for handing a `metamask:`/`phantom:` pairing deeplink off
790
+ * to the wallet app.
823
791
  * @notInstrumented
824
792
  */
825
- const assertSafeDeeplinkUrl = (url) => {
826
- let parsed;
827
- try {
828
- parsed = new URL(url);
829
- } catch {
830
- throw new UnsafeDeeplinkUrlError({ scheme: "unknown" });
831
- }
832
- if (DANGEROUS_DEEPLINK_SCHEMES.has(parsed.protocol)) throw new UnsafeDeeplinkUrlError({ scheme: parsed.protocol });
833
- };
834
-
835
- //#endregion
836
- //#region src/services/openDeeplink/createWebDeeplinkOpener/createWebDeeplinkOpener.ts
837
- /**
838
- * Creates a deeplink opener that navigates the current tab to the deeplink URL.
839
- *
840
- * Uses `window.location.assign` instead of `window.open` deliberately.
841
- * This matters for Phantom redirect specifically, which is the only deep link
842
- * provider that redirects back to the app in a new tab. With `window.open`,
843
- * the browser first opens an `about:blank` tab before the native wallet app
844
- * handles the deep link. When Phantom redirects back, it opens yet another
845
- * tab. The user ends up with three tabs (original, about:blank, redirect) and
846
- * the browser focuses the lingering about:blank after the redirect tab closes.
847
- * `window.location.assign` reuses the current tab, avoiding the extra tab
848
- * entirely.
849
- * @notInstrumented
850
- */
851
- const createWebDeeplinkOpener = () => {
852
- if (isServerSideRendering()) return () => Promise.reject(new UnavailableInServerSideError("createWebDeeplinkOpener"));
793
+ const createDeeplinkOpener = () => {
853
794
  return async (url) => {
854
795
  assertSafeDeeplinkUrl(url);
855
- window.location.assign(url);
796
+ await Linking.openURL(url);
856
797
  };
857
798
  };
858
799
 
@@ -1115,7 +1056,7 @@ const createCore = (config) => {
1115
1056
  storageAdapter: config.coreConfig?.storageAdapter ?? createLocalStorageAdapter()
1116
1057
  });
1117
1058
  const fetch = config.coreConfig?.fetch ?? createWebFetch();
1118
- const openDeeplink = config.coreConfig?.openDeeplink ?? createWebDeeplinkOpener();
1059
+ const openDeeplink = config.coreConfig?.openDeeplink ?? createDeeplinkOpener();
1119
1060
  const openAuthSession = config.coreConfig?.openAuthSession;
1120
1061
  const navigate = config.coreConfig?.navigate ?? createNavigationHandler();
1121
1062
  const state = createObservableState(getInitialState);
@@ -3933,8 +3874,8 @@ const prepareFlowSigning = async ({ assertBalanceForGasCost, assertBalanceForTra
3933
3874
  environmentId,
3934
3875
  flowId,
3935
3876
  flowPrepareSigningRequest: {
3936
- assertBalanceForGasCost: assertBalanceForGasCost ?? false,
3937
- assertBalanceForTransferAmount: assertBalanceForTransferAmount ?? false
3877
+ assertBalanceForGasCost: assertBalanceForGasCost ?? true,
3878
+ assertBalanceForTransferAmount: assertBalanceForTransferAmount ?? true
3938
3879
  },
3939
3880
  xDynamicFlowSessionToken: sessionToken
3940
3881
  }),