@dynamic-labs/sdk-react-core 4.33.0 → 4.34.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +12 -12
  5. package/src/lib/client/extension/functions/isCookieEnabled/isCookieEnabled.cjs +10 -0
  6. package/src/lib/client/extension/functions/isCookieEnabled/isCookieEnabled.d.ts +1 -0
  7. package/src/lib/client/extension/functions/isCookieEnabled/isCookieEnabled.js +6 -0
  8. package/src/lib/client/extension/index.d.ts +1 -0
  9. package/src/lib/client/extension/setVerifyResponseToStorage/setVerifyResponseToStorage.cjs +2 -2
  10. package/src/lib/client/extension/setVerifyResponseToStorage/setVerifyResponseToStorage.js +2 -2
  11. package/src/lib/context/DynamicContext/DynamicContext.cjs +12 -11
  12. package/src/lib/context/DynamicContext/DynamicContext.js +12 -11
  13. package/src/lib/context/DynamicContext/types/SettingsOverrides.d.ts +10 -0
  14. package/src/lib/data/api/api.cjs +6 -6
  15. package/src/lib/data/api/api.js +6 -6
  16. package/src/lib/utils/functions/clientSessionKeys/getClientSessionKeys.cjs +6 -2
  17. package/src/lib/utils/functions/clientSessionKeys/getClientSessionKeys.js +6 -2
  18. package/src/lib/utils/functions/index.d.ts +0 -1
  19. package/src/lib/utils/hooks/useClientSessionKeys/useClientSessionKeys.cjs +3 -1
  20. package/src/lib/utils/hooks/useClientSessionKeys/useClientSessionKeys.js +3 -1
  21. package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +2 -2
  22. package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +2 -2
  23. package/src/lib/utils/hooks/useNetworkConfigurationsFromProjectSettings/useNetworkConfigurationsFromProjectSettings.cjs +7 -2
  24. package/src/lib/utils/hooks/useNetworkConfigurationsFromProjectSettings/useNetworkConfigurationsFromProjectSettings.d.ts +2 -1
  25. package/src/lib/utils/hooks/useNetworkConfigurationsFromProjectSettings/useNetworkConfigurationsFromProjectSettings.js +7 -2
  26. package/src/lib/utils/hooks/useRefreshUserState/useRefreshUserState.cjs +2 -2
  27. package/src/lib/utils/hooks/useRefreshUserState/useRefreshUserState.js +2 -2
  28. package/src/lib/utils/hooks/useValidateSession/handleUserDataOutOfSync/handleUserDataOutOfSync.cjs +3 -3
  29. package/src/lib/utils/hooks/useValidateSession/handleUserDataOutOfSync/handleUserDataOutOfSync.d.ts +1 -1
  30. package/src/lib/utils/hooks/useValidateSession/handleUserDataOutOfSync/handleUserDataOutOfSync.js +3 -3
  31. package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.d.ts +2 -2
  32. package/src/lib/views/WalletList/data.d.ts +1 -1
  33. package/src/lib/utils/functions/isCookieEnabled/isCookieEnabled.cjs +0 -33
  34. package/src/lib/utils/functions/isCookieEnabled/isCookieEnabled.d.ts +0 -2
  35. package/src/lib/utils/functions/isCookieEnabled/isCookieEnabled.js +0 -29
  36. /package/src/lib/{utils → client/extension}/functions/isCookieEnabled/index.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
1
 
2
+ ## [4.34.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.33.0...v4.34.0) (2025-09-30)
3
+
4
+
5
+ ### Features
6
+
7
+ * add getMultichainBalances to react-native ([#9593](https://github.com/dynamic-labs/dynamic-auth/issues/9593)) ([2e482c3](https://github.com/dynamic-labs/dynamic-auth/commit/2e482c3a3d17e4570173c3ca6e27d83c9fac7265))
8
+
2
9
  ## [4.33.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.32.1...v4.33.0) (2025-09-26)
3
10
 
4
11
 
package/package.cjs CHANGED
@@ -3,10 +3,10 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.33.0";
6
+ var version = "4.34.0";
7
7
  var dependencies = {
8
8
  "@dynamic-labs/sdk-api-core": "0.0.762",
9
- "@dynamic-labs-sdk/client": "0.1.0-alpha.12",
9
+ "@dynamic-labs-sdk/client": "0.1.0-alpha.13",
10
10
  "@hcaptcha/react-hcaptcha": "1.4.4",
11
11
  "@thumbmarkjs/thumbmarkjs": "0.16.0",
12
12
  "country-list": "2.3.0",
package/package.js CHANGED
@@ -1,8 +1,8 @@
1
1
  'use client'
2
- var version = "4.33.0";
2
+ var version = "4.34.0";
3
3
  var dependencies = {
4
4
  "@dynamic-labs/sdk-api-core": "0.0.762",
5
- "@dynamic-labs-sdk/client": "0.1.0-alpha.12",
5
+ "@dynamic-labs-sdk/client": "0.1.0-alpha.13",
6
6
  "@hcaptcha/react-hcaptcha": "1.4.4",
7
7
  "@thumbmarkjs/thumbmarkjs": "0.16.0",
8
8
  "country-list": "2.3.0",
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "4.33.0",
3
+ "version": "4.34.0",
4
4
  "dependencies": {
5
5
  "@dynamic-labs/sdk-api-core": "0.0.762",
6
- "@dynamic-labs-sdk/client": "0.1.0-alpha.12",
6
+ "@dynamic-labs-sdk/client": "0.1.0-alpha.13",
7
7
  "@hcaptcha/react-hcaptcha": "1.4.4",
8
8
  "@thumbmarkjs/thumbmarkjs": "0.16.0",
9
9
  "country-list": "2.3.0",
@@ -15,16 +15,16 @@
15
15
  "yup": "0.32.11",
16
16
  "react-international-phone": "4.5.0",
17
17
  "bs58": "5.0.0",
18
- "@dynamic-labs/assert-package-version": "4.33.0",
19
- "@dynamic-labs/iconic": "4.33.0",
20
- "@dynamic-labs/logger": "4.33.0",
21
- "@dynamic-labs/multi-wallet": "4.33.0",
22
- "@dynamic-labs/rpc-providers": "4.33.0",
23
- "@dynamic-labs/store": "4.33.0",
24
- "@dynamic-labs/types": "4.33.0",
25
- "@dynamic-labs/utils": "4.33.0",
26
- "@dynamic-labs/wallet-book": "4.33.0",
27
- "@dynamic-labs/wallet-connector-core": "4.33.0",
18
+ "@dynamic-labs/assert-package-version": "4.34.0",
19
+ "@dynamic-labs/iconic": "4.34.0",
20
+ "@dynamic-labs/logger": "4.34.0",
21
+ "@dynamic-labs/multi-wallet": "4.34.0",
22
+ "@dynamic-labs/rpc-providers": "4.34.0",
23
+ "@dynamic-labs/store": "4.34.0",
24
+ "@dynamic-labs/types": "4.34.0",
25
+ "@dynamic-labs/utils": "4.34.0",
26
+ "@dynamic-labs/wallet-book": "4.34.0",
27
+ "@dynamic-labs/wallet-connector-core": "4.34.0",
28
28
  "eventemitter3": "5.0.1"
29
29
  },
30
30
  "devDependencies": {
@@ -0,0 +1,10 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var core = require('@dynamic-labs-sdk/client/core');
7
+
8
+ const isCookieEnabled = () => core.isCookieEnabled(core.getDefaultClient());
9
+
10
+ exports.isCookieEnabled = isCookieEnabled;
@@ -0,0 +1 @@
1
+ export declare const isCookieEnabled: () => boolean;
@@ -0,0 +1,6 @@
1
+ 'use client'
2
+ import { isCookieEnabled as isCookieEnabled$1, getDefaultClient } from '@dynamic-labs-sdk/client/core';
3
+
4
+ const isCookieEnabled = () => isCookieEnabled$1(getDefaultClient());
5
+
6
+ export { isCookieEnabled };
@@ -12,3 +12,4 @@ export { useUser, useUserProfile } from './user/useUser';
12
12
  export { useProjectSettings } from './projectSettings/useProjectSettings';
13
13
  export { getProjectSettings } from './projectSettings/getProjectSettings';
14
14
  export { useRefetchProjectSettings } from './projectSettings/useRefetchProjectSettings';
15
+ export { isCookieEnabled } from './functions/isCookieEnabled';
@@ -24,13 +24,13 @@ require('../../../context/ViewContext/ViewContext.cjs');
24
24
  require('@dynamic-labs/wallet-book');
25
25
  require('../../../shared/consts/index.cjs');
26
26
  require('../../../store/state/nonce/nonce.cjs');
27
- var isCookieEnabled = require('../../../utils/functions/isCookieEnabled/isCookieEnabled.cjs');
28
27
  require('../../../locale/locale.cjs');
29
28
  require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
30
29
  require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
31
30
  require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
32
31
  require('../../../events/dynamicEvents.cjs');
33
32
  var getProjectSettings = require('../projectSettings/getProjectSettings/getProjectSettings.cjs');
33
+ var isCookieEnabled = require('../functions/isCookieEnabled/isCookieEnabled.cjs');
34
34
 
35
35
  const setVerifyResponseToStorage = ({ expiresAt, jwt, minifiedJwt, }) => {
36
36
  // expiresAt is always sent back by the backend, regardless of whether jwt/minifiedJwt are sent or not
@@ -45,7 +45,7 @@ const setVerifyResponseToStorage = ({ expiresAt, jwt, minifiedJwt, }) => {
45
45
  priority: ['secureStorage', 'localStorage'],
46
46
  });
47
47
  const projectSettings = getProjectSettings.getProjectSettings();
48
- if (projectSettings && isCookieEnabled.isCookieEnabled(projectSettings)) {
48
+ if (projectSettings && isCookieEnabled.isCookieEnabled()) {
49
49
  // if cookie is enabled, but the backend returns a JWT, then use JS to store the cookie
50
50
  const expireDate = new Date(expiresAt * 1000).toUTCString();
51
51
  const authCookie = `${values.DYNAMIC_AUTH_COOKIE_NAME}=${minifiedJwt}; expires=${expireDate}; path=/; SameSite=Lax`;
@@ -20,13 +20,13 @@ import '../../../context/ViewContext/ViewContext.js';
20
20
  import '@dynamic-labs/wallet-book';
21
21
  import '../../../shared/consts/index.js';
22
22
  import '../../../store/state/nonce/nonce.js';
23
- import { isCookieEnabled } from '../../../utils/functions/isCookieEnabled/isCookieEnabled.js';
24
23
  import '../../../locale/locale.js';
25
24
  import '../../../store/state/dynamicContextProps/dynamicContextProps.js';
26
25
  import '../../../store/state/primaryWalletId/primaryWalletId.js';
27
26
  import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
28
27
  import '../../../events/dynamicEvents.js';
29
28
  import { getProjectSettings } from '../projectSettings/getProjectSettings/getProjectSettings.js';
29
+ import { isCookieEnabled } from '../functions/isCookieEnabled/isCookieEnabled.js';
30
30
 
31
31
  const setVerifyResponseToStorage = ({ expiresAt, jwt, minifiedJwt, }) => {
32
32
  // expiresAt is always sent back by the backend, regardless of whether jwt/minifiedJwt are sent or not
@@ -41,7 +41,7 @@ const setVerifyResponseToStorage = ({ expiresAt, jwt, minifiedJwt, }) => {
41
41
  priority: ['secureStorage', 'localStorage'],
42
42
  });
43
43
  const projectSettings = getProjectSettings();
44
- if (projectSettings && isCookieEnabled(projectSettings)) {
44
+ if (projectSettings && isCookieEnabled()) {
45
45
  // if cookie is enabled, but the backend returns a JWT, then use JS to store the cookie
46
46
  const expireDate = new Date(expiresAt * 1000).toUTCString();
47
47
  const authCookie = `${DYNAMIC_AUTH_COOKIE_NAME}=${minifiedJwt}; expires=${expireDate}; path=/; SameSite=Lax`;
@@ -176,7 +176,7 @@ const PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID = '2762a57b-faa4-41ce-9f16-abff9300e2c9
176
176
  const DynamicContext = React.createContext(undefined);
177
177
  /** The context provider itself we only use internally */
178
178
  const InnerDynamicContextProvider = (props) => {
179
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
179
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
180
180
  const { children, theme, settings: settings$1, locale: locale$1, enableInstrumentation = false, } = props;
181
181
  const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, defaultPhoneInputIso2, coinbaseWalletPreference, detectNewWalletsForLinking = defaultDynamicSettings.defaultDynamicSettings.detectNewWalletsForLinking, enableConnectOnlyFallback = defaultDynamicSettings.defaultDynamicSettings.enableConnectOnlyFallback, deepLinkPreference: deepLinkPreferenceProp = defaultDynamicSettings.defaultDynamicSettings.deepLinkPreference, bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = values.DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = defaultDynamicSettings.defaultDynamicSettings.initialAuthenticationMode, debugError = defaultDynamicSettings.defaultDynamicSettings.debugError, displaySiweStatement = defaultDynamicSettings.defaultDynamicSettings.displaySiweStatement, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = defaultDynamicSettings.defaultDynamicSettings.enableVisitTrackingOnConnectOnly, environmentId, walletsFilter, logLevel = defaultDynamicSettings.defaultDynamicSettings.logLevel, mobileExperience, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, siweStatement, shadowDOMEnabled = defaultDynamicSettings.defaultDynamicSettings.shadowDOMEnabled, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = defaultDynamicSettings.defaultDynamicSettings.showLockedWalletView, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, handlers, suppressEndUserConsoleWarning, transactionConfirmation: transactionConfirmationSettings, useMetamaskSdk = defaultDynamicSettings.defaultDynamicSettings.useMetamaskSdk, } = settings$1;
182
182
  let { appLogoUrl = defaultDynamicSettings.defaultDynamicSettings.appLogoUrl, appName = defaultDynamicSettings.defaultDynamicSettings.appName, } = settings$1;
@@ -245,6 +245,7 @@ const InnerDynamicContextProvider = (props) => {
245
245
  evmNetworksOverrides: (_c = settings$1.overrides) === null || _c === void 0 ? void 0 : _c.evmNetworks,
246
246
  projectSettings,
247
247
  solanaNetworksOverrides: (_d = settings$1.overrides) === null || _d === void 0 ? void 0 : _d.solNetworks,
248
+ tronNetworksOverrides: (_e = settings$1.overrides) === null || _e === void 0 ? void 0 : _e.tronNetworks,
248
249
  });
249
250
  useSendDynamicProps.useSendDynamicProps({ environmentId, settings: settings$1 });
250
251
  // Console warning for end user safety
@@ -254,16 +255,16 @@ const InnerDynamicContextProvider = (props) => {
254
255
  });
255
256
  const multiWallet = useMultiWallet.useMultiWallet({
256
257
  isBridgeFlow,
257
- multiWalletOverride: (_e = settings$1.overrides) === null || _e === void 0 ? void 0 : _e.multiWallet,
258
- multiWalletSettings: (_f = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _f === void 0 ? void 0 : _f.multiWallet,
258
+ multiWalletOverride: (_f = settings$1.overrides) === null || _f === void 0 ? void 0 : _f.multiWallet,
259
+ multiWalletSettings: (_g = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _g === void 0 ? void 0 : _g.multiWallet,
259
260
  });
260
261
  const multiAsset = useMultiAsset.useMultiAsset({
261
- multiAssetOverride: (_g = settings$1.overrides) === null || _g === void 0 ? void 0 : _g.multiAsset,
262
- multiAssetSettings: (_h = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _h === void 0 ? void 0 : _h.enableMultiAsset,
262
+ multiAssetOverride: (_h = settings$1.overrides) === null || _h === void 0 ? void 0 : _h.multiAsset,
263
+ multiAssetSettings: (_j = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _j === void 0 ? void 0 : _j.enableMultiAsset,
263
264
  });
264
265
  const showFiat = useShowFiat.useShowFiat({
265
- showFiatOverride: (_j = settings$1.overrides) === null || _j === void 0 ? void 0 : _j.showFiat,
266
- showFiatSettings: (_k = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _k === void 0 ? void 0 : _k.showFiat,
266
+ showFiatOverride: (_k = settings$1.overrides) === null || _k === void 0 ? void 0 : _k.showFiat,
267
+ showFiatSettings: (_l = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _l === void 0 ? void 0 : _l.showFiat,
267
268
  });
268
269
  // Used inside useVerifyOnAwaitingSignature. Is legacy and should be removed asap
269
270
  const [legacyIsVerifying, setLegacyIsVerifying] = React.useState(false);
@@ -338,7 +339,7 @@ const InnerDynamicContextProvider = (props) => {
338
339
  canHaveMultipleWalletsConnected: multiWallet,
339
340
  connectedWallets,
340
341
  primaryWalletId: primaryWalletId$1,
341
- separateSmartWalletAndSigner: (_m = (_l = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _l === void 0 ? void 0 : _l.accountAbstraction) === null || _m === void 0 ? void 0 : _m.separateSmartWalletAndSigner,
342
+ separateSmartWalletAndSigner: (_o = (_m = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _m === void 0 ? void 0 : _m.accountAbstraction) === null || _o === void 0 ? void 0 : _o.separateSmartWalletAndSigner,
342
343
  setMultiWalletWidgetState,
343
344
  user: user || userWithMissingInfo,
344
345
  walletConnectorOptions,
@@ -447,8 +448,8 @@ const InnerDynamicContextProvider = (props) => {
447
448
  }, [handleLogOut, isAuthenticated]);
448
449
  const { setCallback } = useCustomerCallbacks.useCustomerCallbacks({
449
450
  callbacks: {
450
- onAuthSuccess: (_o = settings$1.events) === null || _o === void 0 ? void 0 : _o.onAuthSuccess,
451
- onUserProfileUpdate: (_p = settings$1.events) === null || _p === void 0 ? void 0 : _p.onUserProfileUpdate,
451
+ onAuthSuccess: (_p = settings$1.events) === null || _p === void 0 ? void 0 : _p.onAuthSuccess,
452
+ onUserProfileUpdate: (_q = settings$1.events) === null || _q === void 0 ? void 0 : _q.onUserProfileUpdate,
452
453
  },
453
454
  handleLogOut,
454
455
  isAuthenticated,
@@ -736,7 +737,7 @@ const InnerDynamicContextProvider = (props) => {
736
737
  isBridgeFlow,
737
738
  isMultiWalletEnabled: multiWallet,
738
739
  });
739
- return (jsxRuntime.jsx(reactI18next.I18nextProvider, { i18n: i18nSDKInstance, children: jsxRuntime.jsx(DynamicContext.Provider, { value: value, children: jsxRuntime.jsx(walletBook.WalletBookContextProvider, { walletBook: walletBook$1, children: jsxRuntime.jsx(ThemeContext.ThemeContextProvider, { customerTheme: parseTheme.parseTheme(theme, ((_q = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _q === void 0 ? void 0 : _q.modal) || undefined), designSettings: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design, children: jsxRuntime.jsx(LoadingContext.LoadingContextProvider, { children: jsxRuntime.jsxs(ViewContext.ViewContextProvider, { initialViewType: initialViewType, children: [networkValidationMode === 'always' && jsxRuntime.jsx(UseNetworkValidation.UseNetworkValidation, {}), jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(AccountExistsContext.AccountExistsContextProvider, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, { children: jsxRuntime.jsx(VerificationContext.VerificationProvider, { children: jsxRuntime.jsx(PasskeyContext.PasskeyContextProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(OnrampContext.OnrampContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsx(WalletGroupContext.WalletGroupContextProvider, { children: jsxRuntime.jsx(UserFieldEditorContext.UserFieldEditorContextProvider, { children: jsxRuntime.jsx(ConnectWithOtpProvider.ConnectWithOtpProvider, { children: jsxRuntime.jsx(PhantomRedirectContext.PhantomRedirectContextProvider, { children: jsxRuntime.jsxs(SocialRedirectContext.SocialRedirectContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(OnrampWidget.OnrampWidget, {}), jsxRuntime.jsx(SyncAuthFlow.SyncAuthFlow, {}), jsxRuntime.jsx(WalletConnectorEvents.WalletConnectorEvents, { connectorProps: connectorProps }), confirmationModal, jsxRuntime.jsx(ErrorBoundaryExclude.ErrorBoundaryExclude, { children: children })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
740
+ return (jsxRuntime.jsx(reactI18next.I18nextProvider, { i18n: i18nSDKInstance, children: jsxRuntime.jsx(DynamicContext.Provider, { value: value, children: jsxRuntime.jsx(walletBook.WalletBookContextProvider, { walletBook: walletBook$1, children: jsxRuntime.jsx(ThemeContext.ThemeContextProvider, { customerTheme: parseTheme.parseTheme(theme, ((_r = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _r === void 0 ? void 0 : _r.modal) || undefined), designSettings: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design, children: jsxRuntime.jsx(LoadingContext.LoadingContextProvider, { children: jsxRuntime.jsxs(ViewContext.ViewContextProvider, { initialViewType: initialViewType, children: [networkValidationMode === 'always' && jsxRuntime.jsx(UseNetworkValidation.UseNetworkValidation, {}), jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(AccountExistsContext.AccountExistsContextProvider, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, { children: jsxRuntime.jsx(VerificationContext.VerificationProvider, { children: jsxRuntime.jsx(PasskeyContext.PasskeyContextProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(OnrampContext.OnrampContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsx(WalletGroupContext.WalletGroupContextProvider, { children: jsxRuntime.jsx(UserFieldEditorContext.UserFieldEditorContextProvider, { children: jsxRuntime.jsx(ConnectWithOtpProvider.ConnectWithOtpProvider, { children: jsxRuntime.jsx(PhantomRedirectContext.PhantomRedirectContextProvider, { children: jsxRuntime.jsxs(SocialRedirectContext.SocialRedirectContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(OnrampWidget.OnrampWidget, {}), jsxRuntime.jsx(SyncAuthFlow.SyncAuthFlow, {}), jsxRuntime.jsx(WalletConnectorEvents.WalletConnectorEvents, { connectorProps: connectorProps }), confirmationModal, jsxRuntime.jsx(ErrorBoundaryExclude.ErrorBoundaryExclude, { children: children })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
740
741
  };
741
742
  /** The context provider you need to have access too all of Dynamic's hooks */
742
743
  const DynamicContextProvider = (props) => {
@@ -172,7 +172,7 @@ const PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID = '2762a57b-faa4-41ce-9f16-abff9300e2c9
172
172
  const DynamicContext = createContext(undefined);
173
173
  /** The context provider itself we only use internally */
174
174
  const InnerDynamicContextProvider = (props) => {
175
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
175
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
176
176
  const { children, theme, settings, locale, enableInstrumentation = false, } = props;
177
177
  const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, defaultPhoneInputIso2, coinbaseWalletPreference, detectNewWalletsForLinking = defaultDynamicSettings.detectNewWalletsForLinking, enableConnectOnlyFallback = defaultDynamicSettings.enableConnectOnlyFallback, deepLinkPreference: deepLinkPreferenceProp = defaultDynamicSettings.deepLinkPreference, bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = defaultDynamicSettings.initialAuthenticationMode, debugError = defaultDynamicSettings.debugError, displaySiweStatement = defaultDynamicSettings.displaySiweStatement, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = defaultDynamicSettings.enableVisitTrackingOnConnectOnly, environmentId, walletsFilter, logLevel = defaultDynamicSettings.logLevel, mobileExperience, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, siweStatement, shadowDOMEnabled = defaultDynamicSettings.shadowDOMEnabled, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = defaultDynamicSettings.showLockedWalletView, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, handlers, suppressEndUserConsoleWarning, transactionConfirmation: transactionConfirmationSettings, useMetamaskSdk = defaultDynamicSettings.useMetamaskSdk, } = settings;
178
178
  let { appLogoUrl = defaultDynamicSettings.appLogoUrl, appName = defaultDynamicSettings.appName, } = settings;
@@ -241,6 +241,7 @@ const InnerDynamicContextProvider = (props) => {
241
241
  evmNetworksOverrides: (_c = settings.overrides) === null || _c === void 0 ? void 0 : _c.evmNetworks,
242
242
  projectSettings,
243
243
  solanaNetworksOverrides: (_d = settings.overrides) === null || _d === void 0 ? void 0 : _d.solNetworks,
244
+ tronNetworksOverrides: (_e = settings.overrides) === null || _e === void 0 ? void 0 : _e.tronNetworks,
244
245
  });
245
246
  useSendDynamicProps({ environmentId, settings });
246
247
  // Console warning for end user safety
@@ -250,16 +251,16 @@ const InnerDynamicContextProvider = (props) => {
250
251
  });
251
252
  const multiWallet = useMultiWallet({
252
253
  isBridgeFlow,
253
- multiWalletOverride: (_e = settings.overrides) === null || _e === void 0 ? void 0 : _e.multiWallet,
254
- multiWalletSettings: (_f = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _f === void 0 ? void 0 : _f.multiWallet,
254
+ multiWalletOverride: (_f = settings.overrides) === null || _f === void 0 ? void 0 : _f.multiWallet,
255
+ multiWalletSettings: (_g = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _g === void 0 ? void 0 : _g.multiWallet,
255
256
  });
256
257
  const multiAsset = useMultiAsset({
257
- multiAssetOverride: (_g = settings.overrides) === null || _g === void 0 ? void 0 : _g.multiAsset,
258
- multiAssetSettings: (_h = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _h === void 0 ? void 0 : _h.enableMultiAsset,
258
+ multiAssetOverride: (_h = settings.overrides) === null || _h === void 0 ? void 0 : _h.multiAsset,
259
+ multiAssetSettings: (_j = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _j === void 0 ? void 0 : _j.enableMultiAsset,
259
260
  });
260
261
  const showFiat = useShowFiat({
261
- showFiatOverride: (_j = settings.overrides) === null || _j === void 0 ? void 0 : _j.showFiat,
262
- showFiatSettings: (_k = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _k === void 0 ? void 0 : _k.showFiat,
262
+ showFiatOverride: (_k = settings.overrides) === null || _k === void 0 ? void 0 : _k.showFiat,
263
+ showFiatSettings: (_l = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _l === void 0 ? void 0 : _l.showFiat,
263
264
  });
264
265
  // Used inside useVerifyOnAwaitingSignature. Is legacy and should be removed asap
265
266
  const [legacyIsVerifying, setLegacyIsVerifying] = useState(false);
@@ -334,7 +335,7 @@ const InnerDynamicContextProvider = (props) => {
334
335
  canHaveMultipleWalletsConnected: multiWallet,
335
336
  connectedWallets,
336
337
  primaryWalletId,
337
- separateSmartWalletAndSigner: (_m = (_l = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _l === void 0 ? void 0 : _l.accountAbstraction) === null || _m === void 0 ? void 0 : _m.separateSmartWalletAndSigner,
338
+ separateSmartWalletAndSigner: (_o = (_m = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _m === void 0 ? void 0 : _m.accountAbstraction) === null || _o === void 0 ? void 0 : _o.separateSmartWalletAndSigner,
338
339
  setMultiWalletWidgetState,
339
340
  user: user || userWithMissingInfo,
340
341
  walletConnectorOptions,
@@ -443,8 +444,8 @@ const InnerDynamicContextProvider = (props) => {
443
444
  }, [handleLogOut, isAuthenticated]);
444
445
  const { setCallback } = useCustomerCallbacks({
445
446
  callbacks: {
446
- onAuthSuccess: (_o = settings.events) === null || _o === void 0 ? void 0 : _o.onAuthSuccess,
447
- onUserProfileUpdate: (_p = settings.events) === null || _p === void 0 ? void 0 : _p.onUserProfileUpdate,
447
+ onAuthSuccess: (_p = settings.events) === null || _p === void 0 ? void 0 : _p.onAuthSuccess,
448
+ onUserProfileUpdate: (_q = settings.events) === null || _q === void 0 ? void 0 : _q.onUserProfileUpdate,
448
449
  },
449
450
  handleLogOut,
450
451
  isAuthenticated,
@@ -732,7 +733,7 @@ const InnerDynamicContextProvider = (props) => {
732
733
  isBridgeFlow,
733
734
  isMultiWalletEnabled: multiWallet,
734
735
  });
735
- return (jsx(I18nextProvider, { i18n: i18nSDKInstance, children: jsx(DynamicContext.Provider, { value: value, children: jsx(WalletBookContextProvider, { walletBook: walletBook, children: jsx(ThemeContextProvider, { customerTheme: parseTheme(theme, ((_q = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _q === void 0 ? void 0 : _q.modal) || undefined), designSettings: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design, children: jsx(LoadingContextProvider, { children: jsxs(ViewContextProvider, { initialViewType: initialViewType, children: [networkValidationMode === 'always' && jsx(UseNetworkValidation, {}), jsx(CaptchaContextProvider, { children: jsx(AccountExistsContextProvider, { children: jsx(WalletContextProvider, { children: jsx(VerificationProvider, { children: jsx(PasskeyContextProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(OnrampContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsx(WalletGroupContextProvider, { children: jsx(UserFieldEditorContextProvider, { children: jsx(ConnectWithOtpProvider, { children: jsx(PhantomRedirectContextProvider, { children: jsxs(SocialRedirectContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(OnrampWidget, {}), jsx(SyncAuthFlow, {}), jsx(WalletConnectorEvents, { connectorProps: connectorProps }), confirmationModal, jsx(ErrorBoundaryExclude, { children: children })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
736
+ return (jsx(I18nextProvider, { i18n: i18nSDKInstance, children: jsx(DynamicContext.Provider, { value: value, children: jsx(WalletBookContextProvider, { walletBook: walletBook, children: jsx(ThemeContextProvider, { customerTheme: parseTheme(theme, ((_r = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _r === void 0 ? void 0 : _r.modal) || undefined), designSettings: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design, children: jsx(LoadingContextProvider, { children: jsxs(ViewContextProvider, { initialViewType: initialViewType, children: [networkValidationMode === 'always' && jsx(UseNetworkValidation, {}), jsx(CaptchaContextProvider, { children: jsx(AccountExistsContextProvider, { children: jsx(WalletContextProvider, { children: jsx(VerificationProvider, { children: jsx(PasskeyContextProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(OnrampContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsx(WalletGroupContextProvider, { children: jsx(UserFieldEditorContextProvider, { children: jsx(ConnectWithOtpProvider, { children: jsx(PhantomRedirectContextProvider, { children: jsxs(SocialRedirectContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(OnrampWidget, {}), jsx(SyncAuthFlow, {}), jsx(WalletConnectorEvents, { connectorProps: connectorProps }), confirmationModal, jsx(ErrorBoundaryExclude, { children: children })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
736
737
  };
737
738
  /** The context provider you need to have access too all of Dynamic's hooks */
738
739
  const DynamicContextProvider = (props) => {
@@ -83,6 +83,16 @@ export type SettingsOverrides = {
83
83
  */
84
84
  solNetworks?: NetworksOverrides;
85
85
  cosmosNetworks?: NetworksOverrides;
86
+ /**
87
+ * Allows overriding which tron networks the SDK has access to.
88
+ * If an array is provided, it is used instead of whatever is obtained from dashboard configs.
89
+ * If a callback is passed, the callback will be called with the values obtained from dashboard, and
90
+ * it must return the network values that will be used.
91
+ *
92
+ * WARNING: this callback must be memoized as it will be used in a dependency array to ensure
93
+ * the SDK can react to this value changing (for ex, toggling a chain off).
94
+ */
95
+ tronNetworks?: NetworksOverrides;
86
96
  /**
87
97
  * Allows overriding the multi-wallet feature from the dashboard.
88
98
  */
@@ -15,24 +15,24 @@ var getApiHeaders = require('../../client/extension/hooks/useInitializeSdkClient
15
15
  require('../../events/dynamicEvents.cjs');
16
16
  require('../../utils/constants/colors.cjs');
17
17
  require('../../utils/constants/values.cjs');
18
- require('@dynamic-labs/multi-wallet');
19
18
  require('../../shared/logger.cjs');
20
- var getMinAuthToken = require('../../utils/functions/getMinAuthToken/getMinAuthToken.cjs');
21
- require('react-international-phone');
22
19
  require('@dynamic-labs/iconic');
23
20
  require('@dynamic-labs/wallet-connector-core');
24
21
  require('react/jsx-runtime');
25
22
  require('../../context/ViewContext/ViewContext.cjs');
26
23
  require('@dynamic-labs/wallet-book');
27
24
  require('../../shared/consts/index.cjs');
25
+ var getProjectSettings = require('../../client/extension/projectSettings/getProjectSettings/getProjectSettings.cjs');
26
+ var isCookieEnabled = require('../../client/extension/functions/isCookieEnabled/isCookieEnabled.cjs');
27
+ require('@dynamic-labs/multi-wallet');
28
+ var getMinAuthToken = require('../../utils/functions/getMinAuthToken/getMinAuthToken.cjs');
29
+ require('react-international-phone');
28
30
  require('../../store/state/nonce/nonce.cjs');
29
31
  var randomString = require('../../utils/functions/randomString/randomString.cjs');
30
- var isCookieEnabled = require('../../utils/functions/isCookieEnabled/isCookieEnabled.cjs');
31
32
  require('../../locale/locale.cjs');
32
33
  require('../../store/state/dynamicContextProps/dynamicContextProps.cjs');
33
34
  require('../../store/state/primaryWalletId/primaryWalletId.cjs');
34
35
  require('../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
35
- var getProjectSettings = require('../../client/extension/projectSettings/getProjectSettings/getProjectSettings.cjs');
36
36
 
37
37
  const sdkApi = ({ customHeaders } = {}) => {
38
38
  const settings = {
@@ -44,7 +44,7 @@ const sdkApi = ({ customHeaders } = {}) => {
44
44
  settings.headers.Authorization = `Bearer ${minJwt}`;
45
45
  }
46
46
  const projectSettings = getProjectSettings.getProjectSettings();
47
- const credentials = projectSettings && isCookieEnabled.isCookieEnabled(projectSettings) ? 'include' : undefined;
47
+ const credentials = projectSettings && isCookieEnabled.isCookieEnabled() ? 'include' : undefined;
48
48
  return new sdkApiCore.SDKApi(new sdkApiCore.Configuration(Object.assign(Object.assign({}, settings), { credentials, fetchApi: utils.FetchService.fetch })));
49
49
  };
50
50
 
@@ -11,24 +11,24 @@ import { getApiHeaders } from '../../client/extension/hooks/useInitializeSdkClie
11
11
  import '../../events/dynamicEvents.js';
12
12
  import '../../utils/constants/colors.js';
13
13
  import '../../utils/constants/values.js';
14
- import '@dynamic-labs/multi-wallet';
15
14
  import '../../shared/logger.js';
16
- import { getMinAuthToken } from '../../utils/functions/getMinAuthToken/getMinAuthToken.js';
17
- import 'react-international-phone';
18
15
  import '@dynamic-labs/iconic';
19
16
  import '@dynamic-labs/wallet-connector-core';
20
17
  import 'react/jsx-runtime';
21
18
  import '../../context/ViewContext/ViewContext.js';
22
19
  import '@dynamic-labs/wallet-book';
23
20
  import '../../shared/consts/index.js';
21
+ import { getProjectSettings } from '../../client/extension/projectSettings/getProjectSettings/getProjectSettings.js';
22
+ import { isCookieEnabled } from '../../client/extension/functions/isCookieEnabled/isCookieEnabled.js';
23
+ import '@dynamic-labs/multi-wallet';
24
+ import { getMinAuthToken } from '../../utils/functions/getMinAuthToken/getMinAuthToken.js';
25
+ import 'react-international-phone';
24
26
  import '../../store/state/nonce/nonce.js';
25
27
  import { randomString } from '../../utils/functions/randomString/randomString.js';
26
- import { isCookieEnabled } from '../../utils/functions/isCookieEnabled/isCookieEnabled.js';
27
28
  import '../../locale/locale.js';
28
29
  import '../../store/state/dynamicContextProps/dynamicContextProps.js';
29
30
  import '../../store/state/primaryWalletId/primaryWalletId.js';
30
31
  import '../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
31
- import { getProjectSettings } from '../../client/extension/projectSettings/getProjectSettings/getProjectSettings.js';
32
32
 
33
33
  const sdkApi = ({ customHeaders } = {}) => {
34
34
  const settings = {
@@ -40,7 +40,7 @@ const sdkApi = ({ customHeaders } = {}) => {
40
40
  settings.headers.Authorization = `Bearer ${minJwt}`;
41
41
  }
42
42
  const projectSettings = getProjectSettings();
43
- const credentials = projectSettings && isCookieEnabled(projectSettings) ? 'include' : undefined;
43
+ const credentials = projectSettings && isCookieEnabled() ? 'include' : undefined;
44
44
  return new SDKApi(new Configuration(Object.assign(Object.assign({}, settings), { credentials, fetchApi: FetchService.fetch })));
45
45
  };
46
46
 
@@ -31,8 +31,10 @@ const generateKeyPair = () => _tslib.__awaiter(void 0, void 0, void 0, function*
31
31
  const { private: privateKey, public: publicKey, privateJwk, } = yield keyService.p256Keygen();
32
32
  // convert to base64 and store the session keys in session storage
33
33
  utils.StorageService.setItem(sessionStorage.CLIENT_SESSION_KEYS, keyService.toEncodedFormat(publicKey, privateKey, privateJwk, false), sessionStorage.CLIENT_SESSION_KEYS_STORAGE_OPTIONS);
34
- logger.logger.info('[SessionChaining] Generated new session key pair', {
34
+ logger.logger.instrument('[SessionChaining] Generated new session key pair', {
35
+ key: 'generated_session_key_pair',
35
36
  sessionPublicKey: publicKey,
37
+ time: 0,
36
38
  });
37
39
  utils.tracing.logEvent(constants.clientSessionKeyLogScope, 'Generated new session key pair', utils.tracing.formatObject({
38
40
  publicKey,
@@ -74,8 +76,10 @@ const getClientSessionSignature = (_b) => _tslib.__awaiter(void 0, [_b], void 0,
74
76
  });
75
77
  const clearClientSessionKeys = () => {
76
78
  const clientSessionKeys = getClientSessionKeys();
77
- logger.logger.info('[SessionChaining] Clearing client session keys', {
79
+ logger.logger.instrument('[SessionChaining] Clearing client session keys', {
80
+ key: 'clearing_client_session_keys',
78
81
  sessionPublicKey: clientSessionKeys === null || clientSessionKeys === void 0 ? void 0 : clientSessionKeys.publicKey,
82
+ time: 0,
79
83
  });
80
84
  utils.StorageService.removeItem(sessionStorage.CLIENT_SESSION_KEYS, sessionStorage.CLIENT_SESSION_KEYS_STORAGE_OPTIONS);
81
85
  };
@@ -27,8 +27,10 @@ const generateKeyPair = () => __awaiter(void 0, void 0, void 0, function* () {
27
27
  const { private: privateKey, public: publicKey, privateJwk, } = yield p256Keygen();
28
28
  // convert to base64 and store the session keys in session storage
29
29
  StorageService.setItem(CLIENT_SESSION_KEYS, toEncodedFormat(publicKey, privateKey, privateJwk, false), CLIENT_SESSION_KEYS_STORAGE_OPTIONS);
30
- logger.info('[SessionChaining] Generated new session key pair', {
30
+ logger.instrument('[SessionChaining] Generated new session key pair', {
31
+ key: 'generated_session_key_pair',
31
32
  sessionPublicKey: publicKey,
33
+ time: 0,
32
34
  });
33
35
  tracing.logEvent(clientSessionKeyLogScope, 'Generated new session key pair', tracing.formatObject({
34
36
  publicKey,
@@ -70,8 +72,10 @@ const getClientSessionSignature = (_b) => __awaiter(void 0, [_b], void 0, functi
70
72
  });
71
73
  const clearClientSessionKeys = () => {
72
74
  const clientSessionKeys = getClientSessionKeys();
73
- logger.info('[SessionChaining] Clearing client session keys', {
75
+ logger.instrument('[SessionChaining] Clearing client session keys', {
76
+ key: 'clearing_client_session_keys',
74
77
  sessionPublicKey: clientSessionKeys === null || clientSessionKeys === void 0 ? void 0 : clientSessionKeys.publicKey,
78
+ time: 0,
75
79
  });
76
80
  StorageService.removeItem(CLIENT_SESSION_KEYS, CLIENT_SESSION_KEYS_STORAGE_OPTIONS);
77
81
  };
@@ -65,7 +65,6 @@ export * from './getEmbeddedWalletAuthHandler';
65
65
  export * from './getEmbeddedWalletSessionExpiration';
66
66
  export * from './serializeWalletConnectors';
67
67
  export * from './downloadFile';
68
- export * from './isCookieEnabled';
69
68
  export * from './getExpiresAt';
70
69
  export * from './getSupportedCountriesForVerificationFromProjectSettings';
71
70
  export * from './getDefaultCountriesIfEmpty';
@@ -48,11 +48,13 @@ const useClientSessionKeys = () => {
48
48
  const result = yield getClientSessionKeys.getClientSessionSignature({
49
49
  sessionId: user === null || user === void 0 ? void 0 : user.sessionId,
50
50
  });
51
- logger.logger.info('[SessionChaining] Generated session signature', {
51
+ logger.logger.instrument('[SessionChaining] Generated session signature', {
52
52
  environmentId: user.projectEnvironmentId,
53
+ key: 'generated_session_signature',
53
54
  sessionId: user.sessionId,
54
55
  sessionPublicKey,
55
56
  sessionSignature: result.sessionSignature,
57
+ time: 0,
56
58
  });
57
59
  return result.sessionSignature;
58
60
  }), [user === null || user === void 0 ? void 0 : user.sessionId, sessionPublicKey]);
@@ -44,11 +44,13 @@ const useClientSessionKeys = () => {
44
44
  const result = yield getClientSessionSignature({
45
45
  sessionId: user === null || user === void 0 ? void 0 : user.sessionId,
46
46
  });
47
- logger.info('[SessionChaining] Generated session signature', {
47
+ logger.instrument('[SessionChaining] Generated session signature', {
48
48
  environmentId: user.projectEnvironmentId,
49
+ key: 'generated_session_signature',
49
50
  sessionId: user.sessionId,
50
51
  sessionPublicKey,
51
52
  sessionSignature: result.sessionSignature,
53
+ time: 0,
52
54
  });
53
55
  return result.sessionSignature;
54
56
  }), [user === null || user === void 0 ? void 0 : user.sessionId, sessionPublicKey]);
@@ -25,7 +25,6 @@ require('../../../context/ViewContext/ViewContext.cjs');
25
25
  require('@dynamic-labs/wallet-book');
26
26
  require('../../../shared/consts/index.cjs');
27
27
  require('../../../store/state/nonce/nonce.cjs');
28
- var isCookieEnabled = require('../../functions/isCookieEnabled/isCookieEnabled.cjs');
29
28
  var updatePrimaryWalletId = require('../../functions/updatePrimaryWalletId/updatePrimaryWalletId.cjs');
30
29
  require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
31
30
  var dynamicContextProps = require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
@@ -34,6 +33,7 @@ require('../../../locale/locale.cjs');
34
33
  var wallets = require('../../../data/api/wallets/wallets.cjs');
35
34
  var useOnboardingCompleteUser = require('../../../client/extension/user/useOnboardingCompleteUser/useOnboardingCompleteUser.cjs');
36
35
  var useProjectSettings = require('../../../client/extension/projectSettings/useProjectSettings/useProjectSettings.cjs');
36
+ var isCookieEnabled = require('../../../client/extension/functions/isCookieEnabled/isCookieEnabled.cjs');
37
37
  require('../../../context/DynamicContext/DynamicContext.cjs');
38
38
  require('../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
39
39
  require('../../../context/CaptchaContext/CaptchaContext.cjs');
@@ -154,7 +154,7 @@ const useDynamicWaas = () => {
154
154
  const authToken = getMinAuthToken.getMinAuthToken();
155
155
  const { getSignedSessionId } = useClientSessionKeys.useClientSessionKeys();
156
156
  const getMfaToken = useGetMfaToken.useGetMfaToken();
157
- const isCookieAuthEnabled = projectSettings && isCookieEnabled.isCookieEnabled(projectSettings);
157
+ const isCookieAuthEnabled = projectSettings && isCookieEnabled.isCookieEnabled();
158
158
  const isUpgrading = React.useRef(false);
159
159
  const getWalletConnector = React.useCallback((chainName) => {
160
160
  var _a;
@@ -21,7 +21,6 @@ import '../../../context/ViewContext/ViewContext.js';
21
21
  import '@dynamic-labs/wallet-book';
22
22
  import '../../../shared/consts/index.js';
23
23
  import '../../../store/state/nonce/nonce.js';
24
- import { isCookieEnabled } from '../../functions/isCookieEnabled/isCookieEnabled.js';
25
24
  import { updatePrimaryWalletId } from '../../functions/updatePrimaryWalletId/updatePrimaryWalletId.js';
26
25
  import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
27
26
  import { useApiBaseUrl, useEnvironmentId } from '../../../store/state/dynamicContextProps/dynamicContextProps.js';
@@ -30,6 +29,7 @@ import '../../../locale/locale.js';
30
29
  import { softDeleteEmbeddedWallet, restoreEmbeddedWallet } from '../../../data/api/wallets/wallets.js';
31
30
  import { useOnboardingCompleteUserProfile } from '../../../client/extension/user/useOnboardingCompleteUser/useOnboardingCompleteUser.js';
32
31
  import { useProjectSettings } from '../../../client/extension/projectSettings/useProjectSettings/useProjectSettings.js';
32
+ import { isCookieEnabled } from '../../../client/extension/functions/isCookieEnabled/isCookieEnabled.js';
33
33
  import '../../../context/DynamicContext/DynamicContext.js';
34
34
  import '../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
35
35
  import '../../../context/CaptchaContext/CaptchaContext.js';
@@ -150,7 +150,7 @@ const useDynamicWaas = () => {
150
150
  const authToken = getMinAuthToken();
151
151
  const { getSignedSessionId } = useClientSessionKeys();
152
152
  const getMfaToken = useGetMfaToken();
153
- const isCookieAuthEnabled = projectSettings && isCookieEnabled(projectSettings);
153
+ const isCookieAuthEnabled = projectSettings && isCookieEnabled();
154
154
  const isUpgrading = useRef(false);
155
155
  const getWalletConnector = useCallback((chainName) => {
156
156
  var _a;
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var React = require('react');
7
7
 
8
- const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, }) => React.useMemo(() => {
9
- var _a, _b, _c, _d, _e, _f;
8
+ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, tronNetworksOverrides, }) => React.useMemo(() => {
9
+ var _a, _b, _c, _d, _e, _f, _g;
10
10
  const networks = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.networks;
11
11
  if (!networks)
12
12
  return {};
@@ -16,6 +16,7 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
16
16
  const starknet = networks.find((configurations) => configurations.chainName === 'starknet');
17
17
  const eclipse = networks.find((configurations) => configurations.chainName === 'eclipse');
18
18
  const sui = networks.find((configurations) => configurations.chainName === 'sui');
19
+ const tron = networks.find((configurations) => configurations.chainName === 'tron');
19
20
  let cosmosNetworks = (_a = cosmos === null || cosmos === void 0 ? void 0 : cosmos.networks) === null || _a === void 0 ? void 0 : _a.map((net) => createNetwork(net, Number.parseInt));
20
21
  cosmosNetworks = overrideNetworks(cosmosNetworkOverrides, cosmosNetworks);
21
22
  let evmNetworks = (_b = evm === null || evm === void 0 ? void 0 : evm.networks) === null || _b === void 0 ? void 0 : _b.map((net) => createNetwork(net, Number.parseInt));
@@ -33,6 +34,8 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
33
34
  }
34
35
  }
35
36
  const suiNetworks = (_f = sui === null || sui === void 0 ? void 0 : sui.networks) === null || _f === void 0 ? void 0 : _f.map((net) => createNetwork(net));
37
+ let tronNetworks = (_g = tron === null || tron === void 0 ? void 0 : tron.networks) === null || _g === void 0 ? void 0 : _g.map((net) => createNetwork(net));
38
+ tronNetworks = overrideNetworks(tronNetworksOverrides, tronNetworks);
36
39
  const networkConfigurations = {
37
40
  cosmos: cosmosNetworks,
38
41
  eclipse: eclipseNetworks,
@@ -40,6 +43,7 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
40
43
  solana: solanaNetworks,
41
44
  starknet: starknetNetworks,
42
45
  sui: suiNetworks,
46
+ tron: tronNetworks,
43
47
  };
44
48
  return networkConfigurations;
45
49
  }, [
@@ -47,6 +51,7 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
47
51
  cosmosNetworkOverrides,
48
52
  evmNetworksOverrides,
49
53
  solanaNetworksOverrides,
54
+ tronNetworksOverrides,
50
55
  ]);
51
56
  const createNetwork = (network, parser = (input) => input) => {
52
57
  const result = {
@@ -5,6 +5,7 @@ type UseNetworkConfigurationsFromProjectSettingsProps = {
5
5
  evmNetworksOverrides?: NetworksOverrides;
6
6
  cosmosNetworkOverrides?: NetworksOverrides;
7
7
  solanaNetworksOverrides?: NetworksOverrides;
8
+ tronNetworksOverrides?: NetworksOverrides;
8
9
  };
9
- export declare const useNetworkConfigurationsFromProjectSettings: ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, }: UseNetworkConfigurationsFromProjectSettingsProps) => {};
10
+ export declare const useNetworkConfigurationsFromProjectSettings: ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, tronNetworksOverrides, }: UseNetworkConfigurationsFromProjectSettingsProps) => {};
10
11
  export {};
@@ -1,8 +1,8 @@
1
1
  'use client'
2
2
  import { useMemo } from 'react';
3
3
 
4
- const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, }) => useMemo(() => {
5
- var _a, _b, _c, _d, _e, _f;
4
+ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNetworkOverrides, evmNetworksOverrides, solanaNetworksOverrides, tronNetworksOverrides, }) => useMemo(() => {
5
+ var _a, _b, _c, _d, _e, _f, _g;
6
6
  const networks = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.networks;
7
7
  if (!networks)
8
8
  return {};
@@ -12,6 +12,7 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
12
12
  const starknet = networks.find((configurations) => configurations.chainName === 'starknet');
13
13
  const eclipse = networks.find((configurations) => configurations.chainName === 'eclipse');
14
14
  const sui = networks.find((configurations) => configurations.chainName === 'sui');
15
+ const tron = networks.find((configurations) => configurations.chainName === 'tron');
15
16
  let cosmosNetworks = (_a = cosmos === null || cosmos === void 0 ? void 0 : cosmos.networks) === null || _a === void 0 ? void 0 : _a.map((net) => createNetwork(net, Number.parseInt));
16
17
  cosmosNetworks = overrideNetworks(cosmosNetworkOverrides, cosmosNetworks);
17
18
  let evmNetworks = (_b = evm === null || evm === void 0 ? void 0 : evm.networks) === null || _b === void 0 ? void 0 : _b.map((net) => createNetwork(net, Number.parseInt));
@@ -29,6 +30,8 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
29
30
  }
30
31
  }
31
32
  const suiNetworks = (_f = sui === null || sui === void 0 ? void 0 : sui.networks) === null || _f === void 0 ? void 0 : _f.map((net) => createNetwork(net));
33
+ let tronNetworks = (_g = tron === null || tron === void 0 ? void 0 : tron.networks) === null || _g === void 0 ? void 0 : _g.map((net) => createNetwork(net));
34
+ tronNetworks = overrideNetworks(tronNetworksOverrides, tronNetworks);
32
35
  const networkConfigurations = {
33
36
  cosmos: cosmosNetworks,
34
37
  eclipse: eclipseNetworks,
@@ -36,6 +39,7 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
36
39
  solana: solanaNetworks,
37
40
  starknet: starknetNetworks,
38
41
  sui: suiNetworks,
42
+ tron: tronNetworks,
39
43
  };
40
44
  return networkConfigurations;
41
45
  }, [
@@ -43,6 +47,7 @@ const useNetworkConfigurationsFromProjectSettings = ({ projectSettings, cosmosNe
43
47
  cosmosNetworkOverrides,
44
48
  evmNetworksOverrides,
45
49
  solanaNetworksOverrides,
50
+ tronNetworksOverrides,
46
51
  ]);
47
52
  const createNetwork = (network, parser = (input) => input) => {
48
53
  const result = {
@@ -24,7 +24,6 @@ require('../../../context/ViewContext/ViewContext.cjs');
24
24
  require('@dynamic-labs/wallet-book');
25
25
  require('../../../shared/consts/index.cjs');
26
26
  require('../../../store/state/nonce/nonce.cjs');
27
- var isCookieEnabled = require('../../functions/isCookieEnabled/isCookieEnabled.cjs');
28
27
  var updatePrimaryWalletId = require('../../functions/updatePrimaryWalletId/updatePrimaryWalletId.cjs');
29
28
  require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
30
29
  var dynamicContextProps = require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
@@ -34,6 +33,7 @@ var user = require('../../../data/api/user/user.cjs');
34
33
  require('../../../events/dynamicEvents.cjs');
35
34
  var getUserProfile = require('../../../client/extension/user/getUserProfile/getUserProfile.cjs');
36
35
  var useProjectSettings = require('../../../client/extension/projectSettings/useProjectSettings/useProjectSettings.cjs');
36
+ var isCookieEnabled = require('../../../client/extension/functions/isCookieEnabled/isCookieEnabled.cjs');
37
37
  var useDynamicEvents = require('../events/useDynamicEvents/useDynamicEvents.cjs');
38
38
 
39
39
  const useRefreshUserState = () => {
@@ -75,7 +75,7 @@ const useRefreshUserState = () => {
75
75
  if (hasLoggedOut.current)
76
76
  return false;
77
77
  // should run if cookie is enabled and no user is present
78
- if (projectSettings && isCookieEnabled.isCookieEnabled(projectSettings))
78
+ if (projectSettings && isCookieEnabled.isCookieEnabled())
79
79
  return true;
80
80
  // should run if auth token is present but no user is present and cookie is not enabled
81
81
  return Boolean(getAuthToken.getAuthToken());
@@ -20,7 +20,6 @@ import '../../../context/ViewContext/ViewContext.js';
20
20
  import '@dynamic-labs/wallet-book';
21
21
  import '../../../shared/consts/index.js';
22
22
  import '../../../store/state/nonce/nonce.js';
23
- import { isCookieEnabled } from '../../functions/isCookieEnabled/isCookieEnabled.js';
24
23
  import { updatePrimaryWalletId } from '../../functions/updatePrimaryWalletId/updatePrimaryWalletId.js';
25
24
  import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
26
25
  import { useEnvironmentId } from '../../../store/state/dynamicContextProps/dynamicContextProps.js';
@@ -30,6 +29,7 @@ import { refreshUserJwt } from '../../../data/api/user/user.js';
30
29
  import '../../../events/dynamicEvents.js';
31
30
  import { getUserProfile } from '../../../client/extension/user/getUserProfile/getUserProfile.js';
32
31
  import { useProjectSettings } from '../../../client/extension/projectSettings/useProjectSettings/useProjectSettings.js';
32
+ import { isCookieEnabled } from '../../../client/extension/functions/isCookieEnabled/isCookieEnabled.js';
33
33
  import { useInternalDynamicEvents } from '../events/useDynamicEvents/useDynamicEvents.js';
34
34
 
35
35
  const useRefreshUserState = () => {
@@ -71,7 +71,7 @@ const useRefreshUserState = () => {
71
71
  if (hasLoggedOut.current)
72
72
  return false;
73
73
  // should run if cookie is enabled and no user is present
74
- if (projectSettings && isCookieEnabled(projectSettings))
74
+ if (projectSettings && isCookieEnabled())
75
75
  return true;
76
76
  // should run if auth token is present but no user is present and cookie is not enabled
77
77
  return Boolean(getAuthToken());
@@ -24,7 +24,6 @@ require('../../../../context/ViewContext/ViewContext.cjs');
24
24
  require('@dynamic-labs/wallet-book');
25
25
  require('../../../../shared/consts/index.cjs');
26
26
  require('../../../../store/state/nonce/nonce.cjs');
27
- var isCookieEnabled = require('../../../functions/isCookieEnabled/isCookieEnabled.cjs');
28
27
  require('../../../../locale/locale.cjs');
29
28
  var user = require('../../../../data/api/user/user.cjs');
30
29
  require('../../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
@@ -32,12 +31,13 @@ require('../../../../store/state/primaryWalletId/primaryWalletId.cjs');
32
31
  require('../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
33
32
  require('../../../../events/dynamicEvents.cjs');
34
33
  var getUserProfile = require('../../../../client/extension/user/getUserProfile/getUserProfile.cjs');
34
+ var isCookieEnabled = require('../../../../client/extension/functions/isCookieEnabled/isCookieEnabled.cjs');
35
35
 
36
36
  /**
37
37
  * Detects mismatch between user and auth token.
38
38
  */
39
- const handleUserDataOutOfSync = (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ environmentId, logout, projectSettings, }) {
40
- const cookieEnabled = isCookieEnabled.isCookieEnabled(projectSettings);
39
+ const handleUserDataOutOfSync = (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ environmentId, logout, }) {
40
+ const cookieEnabled = isCookieEnabled.isCookieEnabled();
41
41
  const authToken = getAuthToken.getAuthToken();
42
42
  const user$1 = getUserProfile.getUserProfile();
43
43
  if (authToken || !user$1) {
@@ -7,4 +7,4 @@ export type HandleUserDataOutOfSyncParams = {
7
7
  /**
8
8
  * Detects mismatch between user and auth token.
9
9
  */
10
- export declare const handleUserDataOutOfSync: ({ environmentId, logout, projectSettings, }: HandleUserDataOutOfSyncParams) => Promise<void>;
10
+ export declare const handleUserDataOutOfSync: ({ environmentId, logout, }: HandleUserDataOutOfSyncParams) => Promise<void>;
@@ -20,7 +20,6 @@ import '../../../../context/ViewContext/ViewContext.js';
20
20
  import '@dynamic-labs/wallet-book';
21
21
  import '../../../../shared/consts/index.js';
22
22
  import '../../../../store/state/nonce/nonce.js';
23
- import { isCookieEnabled } from '../../../functions/isCookieEnabled/isCookieEnabled.js';
24
23
  import '../../../../locale/locale.js';
25
24
  import { getAuthenticatedUser } from '../../../../data/api/user/user.js';
26
25
  import '../../../../store/state/dynamicContextProps/dynamicContextProps.js';
@@ -28,12 +27,13 @@ import '../../../../store/state/primaryWalletId/primaryWalletId.js';
28
27
  import '../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
29
28
  import '../../../../events/dynamicEvents.js';
30
29
  import { getUserProfile } from '../../../../client/extension/user/getUserProfile/getUserProfile.js';
30
+ import { isCookieEnabled } from '../../../../client/extension/functions/isCookieEnabled/isCookieEnabled.js';
31
31
 
32
32
  /**
33
33
  * Detects mismatch between user and auth token.
34
34
  */
35
- const handleUserDataOutOfSync = (_a) => __awaiter(void 0, [_a], void 0, function* ({ environmentId, logout, projectSettings, }) {
36
- const cookieEnabled = isCookieEnabled(projectSettings);
35
+ const handleUserDataOutOfSync = (_a) => __awaiter(void 0, [_a], void 0, function* ({ environmentId, logout, }) {
36
+ const cookieEnabled = isCookieEnabled();
37
37
  const authToken = getAuthToken();
38
38
  const user = getUserProfile();
39
39
  if (authToken || !user) {
@@ -2,7 +2,7 @@ import { Wallet } from '@dynamic-labs/wallet-connector-core';
2
2
  import { WalletOption } from '../../../shared';
3
3
  export declare const useWalletOptions: () => {
4
4
  getFilteredWalletOptions: (filter: (options: WalletOption[]) => WalletOption[]) => {
5
- chain: "ETH" | "FLOW" | "SOL" | "EVM" | "ALGO" | "STARK" | "ATOM" | "COSMOS" | "BTC" | "ECLIPSE" | "SUI" | "SPARK";
5
+ chain: "ETH" | "FLOW" | "SOL" | "EVM" | "ALGO" | "STARK" | "ATOM" | "COSMOS" | "BTC" | "ECLIPSE" | "SUI" | "SPARK" | "TRON";
6
6
  group: string | undefined;
7
7
  groupName: string | undefined;
8
8
  isInstalledOnBrowser: boolean;
@@ -13,7 +13,7 @@ export declare const useWalletOptions: () => {
13
13
  }[];
14
14
  selectWalletOption: (walletKey: string, selectGroupIfAvailable?: boolean, skipAllSelectionUi?: boolean) => Promise<Wallet<import("@dynamic-labs/wallet-connector-core").WalletConnectorCore.WalletConnector>>;
15
15
  walletOptions: {
16
- chain: "ETH" | "FLOW" | "SOL" | "EVM" | "ALGO" | "STARK" | "ATOM" | "COSMOS" | "BTC" | "ECLIPSE" | "SUI" | "SPARK";
16
+ chain: "ETH" | "FLOW" | "SOL" | "EVM" | "ALGO" | "STARK" | "ATOM" | "COSMOS" | "BTC" | "ECLIPSE" | "SUI" | "SPARK" | "TRON";
17
17
  group: string | undefined;
18
18
  groupName: string | undefined;
19
19
  isInstalledOnBrowser: boolean;
@@ -4,7 +4,7 @@ interface IChain {
4
4
  enabled: boolean;
5
5
  name: string;
6
6
  }
7
- export declare const getEnabledChains: (chains: IChain[]) => ("STARK" | "ETH" | "FLOW" | "SOL" | "EVM" | "ALGO" | "ATOM" | "COSMOS" | "BTC" | "ECLIPSE" | "SUI" | "SPARK")[];
7
+ export declare const getEnabledChains: (chains: IChain[]) => ("STARK" | "ETH" | "FLOW" | "SOL" | "EVM" | "ALGO" | "ATOM" | "COSMOS" | "BTC" | "ECLIPSE" | "SUI" | "SPARK" | "TRON")[];
8
8
  type BaseGetSupportedWalletOpts = Omit<GetSupportedWalletsOpts, 'walletConnectProjectId' | 'chainRpcProviders'>;
9
9
  export declare const getWallets: (props: {
10
10
  getSupportedWalletOpts: BaseGetSupportedWalletOpts;
@@ -1,33 +0,0 @@
1
- 'use client'
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, '__esModule', { value: true });
5
-
6
- var sdkApiCore = require('@dynamic-labs/sdk-api-core');
7
- var utils = require('@dynamic-labs/utils');
8
-
9
- const isCookieEnabled = (projectSettings) => {
10
- var _a, _b;
11
- utils.assertDefined(projectSettings, 'projectSettings is required');
12
- /**
13
- * There is no cookie on native mobile applications
14
- * so this feature must be disabled for native mobile
15
- */
16
- if (utils.PlatformService.isNativeMobile) {
17
- return false;
18
- }
19
- const securitySettings = projectSettings.security;
20
- if (!securitySettings)
21
- return false;
22
- // client uses Dynamic cookies
23
- const dynamicCookiesEnabled = (((_a = securitySettings.auth) === null || _a === void 0 ? void 0 : _a.storage) || []).includes(sdkApiCore.AuthStorageEnum.Cookie);
24
- // BYO JWT client puts their non-Dynamic JWT in a cookie
25
- const byoJwtCookieEnabled = Boolean((_b = securitySettings.externalAuth) === null || _b === void 0 ? void 0 : _b.cookieName);
26
- // should return true for both of these scenarios
27
- // because we also need to do `credentials: true` in api.ts when
28
- // a byo jwt client sets their named cookie for their jwt and
29
- // needs to send it to our backend
30
- return dynamicCookiesEnabled || byoJwtCookieEnabled;
31
- };
32
-
33
- exports.isCookieEnabled = isCookieEnabled;
@@ -1,2 +0,0 @@
1
- import { ProjectSettings } from '@dynamic-labs/sdk-api-core';
2
- export declare const isCookieEnabled: (projectSettings: ProjectSettings) => boolean;
@@ -1,29 +0,0 @@
1
- 'use client'
2
- import { AuthStorageEnum } from '@dynamic-labs/sdk-api-core';
3
- import { assertDefined, PlatformService } from '@dynamic-labs/utils';
4
-
5
- const isCookieEnabled = (projectSettings) => {
6
- var _a, _b;
7
- assertDefined(projectSettings, 'projectSettings is required');
8
- /**
9
- * There is no cookie on native mobile applications
10
- * so this feature must be disabled for native mobile
11
- */
12
- if (PlatformService.isNativeMobile) {
13
- return false;
14
- }
15
- const securitySettings = projectSettings.security;
16
- if (!securitySettings)
17
- return false;
18
- // client uses Dynamic cookies
19
- const dynamicCookiesEnabled = (((_a = securitySettings.auth) === null || _a === void 0 ? void 0 : _a.storage) || []).includes(AuthStorageEnum.Cookie);
20
- // BYO JWT client puts their non-Dynamic JWT in a cookie
21
- const byoJwtCookieEnabled = Boolean((_b = securitySettings.externalAuth) === null || _b === void 0 ? void 0 : _b.cookieName);
22
- // should return true for both of these scenarios
23
- // because we also need to do `credentials: true` in api.ts when
24
- // a byo jwt client sets their named cookie for their jwt and
25
- // needs to send it to our backend
26
- return dynamicCookiesEnabled || byoJwtCookieEnabled;
27
- };
28
-
29
- export { isCookieEnabled };