@dynamic-labs/sdk-react-core 4.40.0 → 4.40.2

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 (46) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +12 -12
  5. package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +1 -2
  6. package/src/lib/components/SendBalanceForm/SendBalanceForm.js +1 -2
  7. package/src/lib/components/SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.cjs +5 -2
  8. package/src/lib/components/SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.js +5 -2
  9. package/src/lib/context/DynamicContext/hooks/useHandleLogout/types.d.ts +2 -1
  10. package/src/lib/context/DynamicContext/hooks/useSelectedWalletConnector/SetSelectedWalletConnectorKey.type.d.ts +5 -0
  11. package/src/lib/context/DynamicContext/hooks/useSelectedWalletConnector/useSelectedWalletConnector.cjs +19 -5
  12. package/src/lib/context/DynamicContext/hooks/useSelectedWalletConnector/useSelectedWalletConnector.d.ts +3 -3
  13. package/src/lib/context/DynamicContext/hooks/useSelectedWalletConnector/useSelectedWalletConnector.js +19 -5
  14. package/src/lib/context/DynamicContext/types/IDynamicContext.d.ts +2 -1
  15. package/src/lib/styles/index.shadow.cjs +1 -1
  16. package/src/lib/styles/index.shadow.js +1 -1
  17. package/src/lib/utils/functions/findWalletOptionFor/findWalletOptionFor.cjs +8 -3
  18. package/src/lib/utils/functions/findWalletOptionFor/findWalletOptionFor.js +8 -3
  19. package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.cjs +4 -1
  20. package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.js +4 -1
  21. package/src/lib/utils/functions/walletListBuilder/walletListBuilder.cjs +14 -7
  22. package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +14 -7
  23. package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs +4 -1
  24. package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js +4 -1
  25. package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +4 -1
  26. package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +4 -1
  27. package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.cjs +7 -2
  28. package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.js +7 -2
  29. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +8 -2
  30. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +8 -2
  31. package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.cjs +24 -6
  32. package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.js +24 -6
  33. package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +7 -3
  34. package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +7 -3
  35. package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.cjs +6 -2
  36. package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.js +6 -2
  37. package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.cjs +17 -85
  38. package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.js +17 -85
  39. package/src/lib/views/LoginView/useLoginView/useLoginView.cjs +11 -7
  40. package/src/lib/views/LoginView/useLoginView/useLoginView.js +11 -7
  41. package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.cjs +6 -6
  42. package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.js +6 -6
  43. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.cjs +1 -8
  44. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.js +1 -8
  45. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +4 -1
  46. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +4 -1
package/CHANGELOG.md CHANGED
@@ -1,4 +1,17 @@
1
1
 
2
+ ### [4.40.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.40.1...v4.40.2) (2025-10-28)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * upgrade node to 20.20 in sanity-yarn-add-sdk job for compatibility ([#9743](https://github.com/dynamic-labs/dynamic-auth/issues/9743)) ([58d7e32](https://github.com/dynamic-labs/dynamic-auth/commit/58d7e32cd3965fba983c91c6345eae3bfe8dd1d5))
8
+
9
+ ### [4.40.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.40.0...v4.40.1) (2025-10-24)
10
+
11
+ ### Bug Fixes
12
+
13
+ * add support for Keplr in-app browser redirect for cosmos chain ([#9770](https://github.com/dynamic-labs/dynamic-auth/issues/9770)) ([35652f3](https://github.com/dynamic-labs/dynamic-auth/commit/35652f3167a4e768f5d4c634ab1b4f127fd5076a))
14
+
2
15
  ## [4.40.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.39.0...v4.40.0) (2025-10-22)
3
16
 
4
17
 
package/package.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.40.0";
6
+ var version = "4.40.2";
7
7
  var dependencies = {
8
8
  "@dynamic-labs/sdk-api-core": "0.0.813",
9
9
  "@dynamic-labs-sdk/client": "0.1.0-alpha.23",
package/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client'
2
- var version = "4.40.0";
2
+ var version = "4.40.2";
3
3
  var dependencies = {
4
4
  "@dynamic-labs/sdk-api-core": "0.0.813",
5
5
  "@dynamic-labs-sdk/client": "0.1.0-alpha.23",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "4.40.0",
3
+ "version": "4.40.2",
4
4
  "dependencies": {
5
5
  "@dynamic-labs/sdk-api-core": "0.0.813",
6
6
  "@dynamic-labs-sdk/client": "0.1.0-alpha.23",
@@ -15,17 +15,17 @@
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.40.0",
19
- "@dynamic-labs/iconic": "4.40.0",
20
- "@dynamic-labs/locale": "4.40.0",
21
- "@dynamic-labs/logger": "4.40.0",
22
- "@dynamic-labs/multi-wallet": "4.40.0",
23
- "@dynamic-labs/rpc-providers": "4.40.0",
24
- "@dynamic-labs/store": "4.40.0",
25
- "@dynamic-labs/types": "4.40.0",
26
- "@dynamic-labs/utils": "4.40.0",
27
- "@dynamic-labs/wallet-book": "4.40.0",
28
- "@dynamic-labs/wallet-connector-core": "4.40.0",
18
+ "@dynamic-labs/assert-package-version": "4.40.2",
19
+ "@dynamic-labs/iconic": "4.40.2",
20
+ "@dynamic-labs/locale": "4.40.2",
21
+ "@dynamic-labs/logger": "4.40.2",
22
+ "@dynamic-labs/multi-wallet": "4.40.2",
23
+ "@dynamic-labs/rpc-providers": "4.40.2",
24
+ "@dynamic-labs/store": "4.40.2",
25
+ "@dynamic-labs/types": "4.40.2",
26
+ "@dynamic-labs/utils": "4.40.2",
27
+ "@dynamic-labs/wallet-book": "4.40.2",
28
+ "@dynamic-labs/wallet-connector-core": "4.40.2",
29
29
  "eventemitter3": "5.0.1"
30
30
  },
31
31
  "devDependencies": {
@@ -93,7 +93,6 @@ require('../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.cjs')
93
93
  require('../../context/PasskeyContext/PasskeyContext.cjs');
94
94
  require('../../context/OnrampContext/OnrampContext.cjs');
95
95
  var sendBalances = require('../../store/state/sendBalances.cjs');
96
- var roundToNthDecimal = require('../../utils/functions/roundToNthDecimal/roundToNthDecimal.cjs');
97
96
  var TokensBalanceDropdown = require('../SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.cjs');
98
97
  var utils = require('../TransactionConfirmationPageLayout/utils.cjs');
99
98
  require('../../store/state/connectorsInitializing/connectorsInitializing.cjs');
@@ -186,7 +185,7 @@ const SendBalanceForm = ({ initialValues, onSubmit, decimals = 18, validateAddre
186
185
  }, placeholder: t('dyn_send_transaction.data.amount.placeholder'), as: Input.Input, error: errors['amount'], copykey: 'dyn_send_transaction.data.amount.label', message: touched['amount'] &&
187
186
  getDisplayErrorMessage(errors, t, 'amount', decimals), style: {
188
187
  paddingLeft: `${leftSymbolPadding}px`,
189
- } }), jsxRuntime.jsx("div", { className: 'send-balance-form__amount-container__floating_value', ref: floatingValueRef, children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', weight: 'regular', color: 'secondary', children: currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol }) }), jsxRuntime.jsx("div", { className: 'send-balance-form__amount-container__balance', children: showFiat && !Number.isNaN(amount) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_mini', weight: 'bold', color: 'secondary', children: "$" }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_mini', weight: 'regular', color: 'secondary', children: utils.getDisplayFiatPrice(amount, currentToken) })] })) })] }), jsxRuntime.jsx(Typography.Typography, { className: 'send-balance-form__amount_available', variant: 'body_small', weight: 'regular', color: 'secondary', as: 'div', children: jsxRuntime.jsxs("div", { style: { display: 'flex', gap: '0.225rem' }, children: [jsxRuntime.jsx(Typography.Typography, { className: 'send-balance-form__amount_available__line', variant: 'body_small', weight: 'bold', color: 'primary', as: 'div', children: (_a = roundToNthDecimal.roundToNthDecimal(currentToken === null || currentToken === void 0 ? void 0 : currentToken.balance, 6)) !== null && _a !== void 0 ? _a : 0 }), `${currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol} Available`] }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'regular', color: 'secondary', copykey: 'dyn_send_transaction.data.recipient.label', children: "Recipient Address" }), jsxRuntime.jsx(formik.Field, { className: 'send-balance-form__field', placeholder: t('dyn_send_transaction.data.recipient.placeholder'), label: t('dyn_send_transaction.data.recipient.label'), id: 'recipient', name: 'recipient', as: Input.Input, error: errors['recipient'], copykey: 'dyn_send_transaction.data.recipient.label', message: touched['recipient'] &&
188
+ } }), jsxRuntime.jsx("div", { className: 'send-balance-form__amount-container__floating_value', ref: floatingValueRef, children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', weight: 'regular', color: 'secondary', children: currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol }) }), jsxRuntime.jsx("div", { className: 'send-balance-form__amount-container__balance', children: showFiat && !Number.isNaN(amount) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_mini', weight: 'bold', color: 'secondary', children: "$" }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_mini', weight: 'regular', color: 'secondary', children: utils.getDisplayFiatPrice(amount, currentToken) })] })) })] }), jsxRuntime.jsx(Typography.Typography, { className: 'send-balance-form__amount_available', variant: 'body_small', weight: 'regular', color: 'secondary', as: 'div', children: jsxRuntime.jsxs("div", { style: { display: 'flex', gap: '0.225rem' }, children: [jsxRuntime.jsx(Typography.Typography, { className: 'send-balance-form__amount_available__line', variant: 'body_small', weight: 'bold', color: 'primary', as: 'div', children: (_a = currentToken === null || currentToken === void 0 ? void 0 : currentToken.balance) !== null && _a !== void 0 ? _a : 0 }), `${currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol} Available`] }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'regular', color: 'secondary', copykey: 'dyn_send_transaction.data.recipient.label', children: "Recipient Address" }), jsxRuntime.jsx(formik.Field, { className: 'send-balance-form__field', placeholder: t('dyn_send_transaction.data.recipient.placeholder'), label: t('dyn_send_transaction.data.recipient.label'), id: 'recipient', name: 'recipient', as: Input.Input, error: errors['recipient'], copykey: 'dyn_send_transaction.data.recipient.label', message: touched['recipient'] &&
190
189
  getDisplayErrorMessage(errors, t, 'recipient') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'sendBalanceFormSubmitButton', expanded: true, type: 'submit', buttonVariant: 'primary', buttonPadding: 'small', buttonClassName: 'send-balance-form__button', copykey: 'dyn_send_transaction.preview_transaction', children: t('dyn_send_transaction.preview_transaction') })] }));
191
190
  } }));
192
191
  };
@@ -89,7 +89,6 @@ import '../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.js';
89
89
  import '../../context/PasskeyContext/PasskeyContext.js';
90
90
  import '../../context/OnrampContext/OnrampContext.js';
91
91
  import { useSendBalanceState, setSendBalanceVariable } from '../../store/state/sendBalances.js';
92
- import { roundToNthDecimal } from '../../utils/functions/roundToNthDecimal/roundToNthDecimal.js';
93
92
  import { TokensBalanceDropdown } from '../SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.js';
94
93
  import { getDisplayFiatPrice } from '../TransactionConfirmationPageLayout/utils.js';
95
94
  import '../../store/state/connectorsInitializing/connectorsInitializing.js';
@@ -182,7 +181,7 @@ const SendBalanceForm = ({ initialValues, onSubmit, decimals = 18, validateAddre
182
181
  }, placeholder: t('dyn_send_transaction.data.amount.placeholder'), as: Input, error: errors['amount'], copykey: 'dyn_send_transaction.data.amount.label', message: touched['amount'] &&
183
182
  getDisplayErrorMessage(errors, t, 'amount', decimals), style: {
184
183
  paddingLeft: `${leftSymbolPadding}px`,
185
- } }), jsx("div", { className: 'send-balance-form__amount-container__floating_value', ref: floatingValueRef, children: jsx(Typography, { variant: 'title', weight: 'regular', color: 'secondary', children: currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol }) }), jsx("div", { className: 'send-balance-form__amount-container__balance', children: showFiat && !Number.isNaN(amount) && (jsxs(Fragment, { children: [jsx(Typography, { variant: 'body_mini', weight: 'bold', color: 'secondary', children: "$" }), jsx(Typography, { variant: 'body_mini', weight: 'regular', color: 'secondary', children: getDisplayFiatPrice(amount, currentToken) })] })) })] }), jsx(Typography, { className: 'send-balance-form__amount_available', variant: 'body_small', weight: 'regular', color: 'secondary', as: 'div', children: jsxs("div", { style: { display: 'flex', gap: '0.225rem' }, children: [jsx(Typography, { className: 'send-balance-form__amount_available__line', variant: 'body_small', weight: 'bold', color: 'primary', as: 'div', children: (_a = roundToNthDecimal(currentToken === null || currentToken === void 0 ? void 0 : currentToken.balance, 6)) !== null && _a !== void 0 ? _a : 0 }), `${currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol} Available`] }) }), jsx(Typography, { variant: 'body_small', weight: 'regular', color: 'secondary', copykey: 'dyn_send_transaction.data.recipient.label', children: "Recipient Address" }), jsx(Field, { className: 'send-balance-form__field', placeholder: t('dyn_send_transaction.data.recipient.placeholder'), label: t('dyn_send_transaction.data.recipient.label'), id: 'recipient', name: 'recipient', as: Input, error: errors['recipient'], copykey: 'dyn_send_transaction.data.recipient.label', message: touched['recipient'] &&
184
+ } }), jsx("div", { className: 'send-balance-form__amount-container__floating_value', ref: floatingValueRef, children: jsx(Typography, { variant: 'title', weight: 'regular', color: 'secondary', children: currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol }) }), jsx("div", { className: 'send-balance-form__amount-container__balance', children: showFiat && !Number.isNaN(amount) && (jsxs(Fragment, { children: [jsx(Typography, { variant: 'body_mini', weight: 'bold', color: 'secondary', children: "$" }), jsx(Typography, { variant: 'body_mini', weight: 'regular', color: 'secondary', children: getDisplayFiatPrice(amount, currentToken) })] })) })] }), jsx(Typography, { className: 'send-balance-form__amount_available', variant: 'body_small', weight: 'regular', color: 'secondary', as: 'div', children: jsxs("div", { style: { display: 'flex', gap: '0.225rem' }, children: [jsx(Typography, { className: 'send-balance-form__amount_available__line', variant: 'body_small', weight: 'bold', color: 'primary', as: 'div', children: (_a = currentToken === null || currentToken === void 0 ? void 0 : currentToken.balance) !== null && _a !== void 0 ? _a : 0 }), `${currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol} Available`] }) }), jsx(Typography, { variant: 'body_small', weight: 'regular', color: 'secondary', copykey: 'dyn_send_transaction.data.recipient.label', children: "Recipient Address" }), jsx(Field, { className: 'send-balance-form__field', placeholder: t('dyn_send_transaction.data.recipient.placeholder'), label: t('dyn_send_transaction.data.recipient.label'), id: 'recipient', name: 'recipient', as: Input, error: errors['recipient'], copykey: 'dyn_send_transaction.data.recipient.label', message: touched['recipient'] &&
186
185
  getDisplayErrorMessage(errors, t, 'recipient') }), jsx(TypographyButton, { dataTestId: 'sendBalanceFormSubmitButton', expanded: true, type: 'submit', buttonVariant: 'primary', buttonPadding: 'small', buttonClassName: 'send-balance-form__button', copykey: 'dyn_send_transaction.preview_transaction', children: t('dyn_send_transaction.preview_transaction') })] }));
187
186
  } }));
188
187
  };
@@ -79,7 +79,6 @@ require('../../../MenuList/Dropdown/Dropdown.cjs');
79
79
  require('formik');
80
80
  require('../../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
81
81
  var sendBalances = require('../../../../store/state/sendBalances.cjs');
82
- var roundToNthDecimal = require('../../../../utils/functions/roundToNthDecimal/roundToNthDecimal.cjs');
83
82
  require('../../../Input/Input.cjs');
84
83
  var abi = require('../../../../utils/constants/erc20/abi.cjs');
85
84
  var MenuList = require('../../../MenuList/MenuList/MenuList.cjs');
@@ -172,7 +171,11 @@ const TokensBalanceDropdown = ({ tokenBalances, currentToken, setCurrentToken, i
172
171
  }), children: jsxRuntime.jsx(stroke.ReactComponent, {}) })] })), jsxRuntime.jsx(MenuList.MenuList, { className: 'tokens-balance-dropdown__menu_list', isOpen: isDropdownOpen, popperProps: {
173
172
  anchorOrigin: 'bottom-left',
174
173
  anchorRef,
175
- }, mobileTitle: 'Select token', children: filteredTokenBalances.length > 0 ? (filteredTokenBalances.map((t) => (jsxRuntime.jsxs("button", { className: 'tokens-balance-dropdown__menu_list_item', onClick: () => handleTokenClick(t.name), children: [jsxRuntime.jsxs("div", { className: 'tokens-balance-dropdown__menu_list_item__name', children: [tokenLogo(t, '16'), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'primary', children: t.name })] }), jsxRuntime.jsxs("div", { className: 'tokens-balance-dropdown__menu_list_item__balance', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', children: t.symbol }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'primary', children: roundToNthDecimal.roundToNthDecimal(t.balance, 6) })] })] }, t.address)))) : (jsxRuntime.jsx("div", { className: 'token-balance-list__empty', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', copykey: 'dyn_wallet_information.multi_asset.empty_state', children: t('dyn_wallet_information.multi_asset.empty_state') }) })) })] }));
174
+ }, mobileTitle: 'Select token', children: filteredTokenBalances.length > 0 ? (filteredTokenBalances.map((t) => (jsxRuntime.jsxs("button", { className: 'tokens-balance-dropdown__menu_list_item', onClick: () => handleTokenClick(t.name), children: [jsxRuntime.jsxs("div", { className: 'tokens-balance-dropdown__menu_list_item__name', children: [tokenLogo(t, '16'), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'primary', children: t.name })] }), jsxRuntime.jsxs("div", { className: 'tokens-balance-dropdown__menu_list_item__balance', style: {
175
+ alignItems: 'flex-end',
176
+ display: 'flex',
177
+ flexDirection: 'column',
178
+ }, children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', children: t.symbol }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'primary', children: t.balance })] })] }, t.address)))) : (jsxRuntime.jsx("div", { className: 'token-balance-list__empty', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', copykey: 'dyn_wallet_information.multi_asset.empty_state', children: t('dyn_wallet_information.multi_asset.empty_state') }) })) })] }));
176
179
  };
177
180
 
178
181
  exports.TokensBalanceDropdown = TokensBalanceDropdown;
@@ -75,7 +75,6 @@ import '../../../MenuList/Dropdown/Dropdown.js';
75
75
  import 'formik';
76
76
  import '../../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.js';
77
77
  import { setSendBalanceVariable } from '../../../../store/state/sendBalances.js';
78
- import { roundToNthDecimal } from '../../../../utils/functions/roundToNthDecimal/roundToNthDecimal.js';
79
78
  import '../../../Input/Input.js';
80
79
  import { erc20Abi } from '../../../../utils/constants/erc20/abi.js';
81
80
  import { MenuList } from '../../../MenuList/MenuList/MenuList.js';
@@ -168,7 +167,11 @@ const TokensBalanceDropdown = ({ tokenBalances, currentToken, setCurrentToken, i
168
167
  }), children: jsx(SvgStroke, {}) })] })), jsx(MenuList, { className: 'tokens-balance-dropdown__menu_list', isOpen: isDropdownOpen, popperProps: {
169
168
  anchorOrigin: 'bottom-left',
170
169
  anchorRef,
171
- }, mobileTitle: 'Select token', children: filteredTokenBalances.length > 0 ? (filteredTokenBalances.map((t) => (jsxs("button", { className: 'tokens-balance-dropdown__menu_list_item', onClick: () => handleTokenClick(t.name), children: [jsxs("div", { className: 'tokens-balance-dropdown__menu_list_item__name', children: [tokenLogo(t, '16'), jsx(Typography, { variant: 'body_small', color: 'primary', children: t.name })] }), jsxs("div", { className: 'tokens-balance-dropdown__menu_list_item__balance', children: [jsx(Typography, { variant: 'body_small', color: 'secondary', children: t.symbol }), jsx(Typography, { variant: 'body_small', color: 'primary', children: roundToNthDecimal(t.balance, 6) })] })] }, t.address)))) : (jsx("div", { className: 'token-balance-list__empty', children: jsx(Typography, { variant: 'body_small', color: 'secondary', copykey: 'dyn_wallet_information.multi_asset.empty_state', children: t('dyn_wallet_information.multi_asset.empty_state') }) })) })] }));
170
+ }, mobileTitle: 'Select token', children: filteredTokenBalances.length > 0 ? (filteredTokenBalances.map((t) => (jsxs("button", { className: 'tokens-balance-dropdown__menu_list_item', onClick: () => handleTokenClick(t.name), children: [jsxs("div", { className: 'tokens-balance-dropdown__menu_list_item__name', children: [tokenLogo(t, '16'), jsx(Typography, { variant: 'body_small', color: 'primary', children: t.name })] }), jsxs("div", { className: 'tokens-balance-dropdown__menu_list_item__balance', style: {
171
+ alignItems: 'flex-end',
172
+ display: 'flex',
173
+ flexDirection: 'column',
174
+ }, children: [jsx(Typography, { variant: 'body_small', color: 'secondary', children: t.symbol }), jsx(Typography, { variant: 'body_small', color: 'primary', children: t.balance })] })] }, t.address)))) : (jsx("div", { className: 'token-balance-list__empty', children: jsx(Typography, { variant: 'body_small', color: 'secondary', copykey: 'dyn_wallet_information.multi_asset.empty_state', children: t('dyn_wallet_information.multi_asset.empty_state') }) })) })] }));
172
175
  };
173
176
 
174
177
  export { TokensBalanceDropdown };
@@ -5,10 +5,11 @@ import { DynamicEventsCallbacks, Wallet } from '../../../../shared';
5
5
  import { MultiWalletWidgetStateSetter } from '../../../../utils/hooks/multiWallet';
6
6
  import { ChainsToConnect } from '../../types';
7
7
  import { SetShowAuthFlow } from '../useShowAuthFlow';
8
+ import { SetSelectedWalletConnectorKey } from '../useSelectedWalletConnector/SetSelectedWalletConnectorKey.type';
8
9
  export type UseHandleLogoutParams = {
9
10
  clearAllWalletConnectSessions: () => void;
10
11
  bridgeChains: ChainsToConnect[] | undefined;
11
- setSelectedWalletConnectorKey: Dispatch<SetStateAction<string | null>>;
12
+ setSelectedWalletConnectorKey: SetSelectedWalletConnectorKey;
12
13
  setShowDynamicUserProfile: Dispatch<SetStateAction<boolean>>;
13
14
  setShowBridgeWidget: Dispatch<SetStateAction<boolean>>;
14
15
  user: UserProfile | undefined;
@@ -0,0 +1,5 @@
1
+ import { WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
2
+ export type SetSelectedWalletConnectorKey = (data: {
3
+ key: string;
4
+ chain?: WalletConnectorBase['connectedChain'];
5
+ } | string | null) => void;
@@ -6,15 +6,29 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
  var React = require('react');
7
7
 
8
8
  const useSelectedWalletConnector = ({ walletConnectorOptions, }) => {
9
- const [selectedWalletConnectorKey, setSelectedWalletConnectorKey] = React.useState(null);
9
+ const [selectedWalletConnectorData, setSelectedWalletConnectorData] = React.useState(null);
10
+ /**
11
+ * To keep backwards compatibility, this also accepts a single string param which will be just the key
12
+ */
13
+ const setSelectedWalletConnectorKey = (data) => {
14
+ if (typeof data === 'string') {
15
+ setSelectedWalletConnectorData({ key: data });
16
+ }
17
+ else {
18
+ setSelectedWalletConnectorData(data);
19
+ }
20
+ };
10
21
  // Instead of storing the selected connector directly, we derive it from the wallets
11
22
  // This way if wallets change, the selected connector will be updated too
12
23
  const selectedWalletConnector = React.useMemo(() => {
13
- var _a, _b;
14
- if (!selectedWalletConnectorKey)
24
+ var _a;
25
+ if (!selectedWalletConnectorData)
15
26
  return null;
16
- return ((_b = (_a = walletConnectorOptions.find(({ walletConnector }) => walletConnector.key === selectedWalletConnectorKey)) === null || _a === void 0 ? void 0 : _a.walletConnector) !== null && _b !== void 0 ? _b : null);
17
- }, [selectedWalletConnectorKey, walletConnectorOptions]);
27
+ const option = walletConnectorOptions.find(({ walletConnector }) => walletConnector.key === selectedWalletConnectorData.key &&
28
+ (!selectedWalletConnectorData.chain ||
29
+ walletConnector.connectedChain === selectedWalletConnectorData.chain));
30
+ return (_a = option === null || option === void 0 ? void 0 : option.walletConnector) !== null && _a !== void 0 ? _a : null;
31
+ }, [selectedWalletConnectorData, walletConnectorOptions]);
18
32
  return { selectedWalletConnector, setSelectedWalletConnectorKey };
19
33
  };
20
34
 
@@ -1,10 +1,10 @@
1
- /// <reference types="react" />
2
1
  import { WalletOption } from '../../../../shared';
2
+ import { SetSelectedWalletConnectorKey } from './SetSelectedWalletConnectorKey.type';
3
3
  type useSelectedWalletConnectorProps = {
4
4
  walletConnectorOptions: WalletOption[];
5
5
  };
6
6
  export declare const useSelectedWalletConnector: ({ walletConnectorOptions, }: useSelectedWalletConnectorProps) => {
7
- selectedWalletConnector: import("dist/packages/wallet-connector-core/src").WalletConnectorCore.WalletConnector | null;
8
- setSelectedWalletConnectorKey: import("react").Dispatch<import("react").SetStateAction<string | null>>;
7
+ selectedWalletConnector: import("@dynamic-labs/wallet-connector-core").WalletConnectorCore.WalletConnector | null;
8
+ setSelectedWalletConnectorKey: SetSelectedWalletConnectorKey;
9
9
  };
10
10
  export {};
@@ -2,15 +2,29 @@
2
2
  import { useState, useMemo } from 'react';
3
3
 
4
4
  const useSelectedWalletConnector = ({ walletConnectorOptions, }) => {
5
- const [selectedWalletConnectorKey, setSelectedWalletConnectorKey] = useState(null);
5
+ const [selectedWalletConnectorData, setSelectedWalletConnectorData] = useState(null);
6
+ /**
7
+ * To keep backwards compatibility, this also accepts a single string param which will be just the key
8
+ */
9
+ const setSelectedWalletConnectorKey = (data) => {
10
+ if (typeof data === 'string') {
11
+ setSelectedWalletConnectorData({ key: data });
12
+ }
13
+ else {
14
+ setSelectedWalletConnectorData(data);
15
+ }
16
+ };
6
17
  // Instead of storing the selected connector directly, we derive it from the wallets
7
18
  // This way if wallets change, the selected connector will be updated too
8
19
  const selectedWalletConnector = useMemo(() => {
9
- var _a, _b;
10
- if (!selectedWalletConnectorKey)
20
+ var _a;
21
+ if (!selectedWalletConnectorData)
11
22
  return null;
12
- return ((_b = (_a = walletConnectorOptions.find(({ walletConnector }) => walletConnector.key === selectedWalletConnectorKey)) === null || _a === void 0 ? void 0 : _a.walletConnector) !== null && _b !== void 0 ? _b : null);
13
- }, [selectedWalletConnectorKey, walletConnectorOptions]);
23
+ const option = walletConnectorOptions.find(({ walletConnector }) => walletConnector.key === selectedWalletConnectorData.key &&
24
+ (!selectedWalletConnectorData.chain ||
25
+ walletConnector.connectedChain === selectedWalletConnectorData.chain));
26
+ return (_a = option === null || option === void 0 ? void 0 : option.walletConnector) !== null && _a !== void 0 ? _a : null;
27
+ }, [selectedWalletConnectorData, walletConnectorOptions]);
14
28
  return { selectedWalletConnector, setSelectedWalletConnectorKey };
15
29
  };
16
30
 
@@ -13,6 +13,7 @@ import { ConnectWalletOptions } from '../../../utils/hooks/useConnectWallet/useC
13
13
  import { ThemeData, ThemeSetting } from '../../ThemeContext';
14
14
  import { DisplayOrder, SetDisplayOrderPriority, SetShowAuthFlow } from '../hooks';
15
15
  import { SetCallbackType } from '../useCustomerCallbacks';
16
+ import { SetSelectedWalletConnectorKey } from '../hooks/useSelectedWalletConnector/SetSelectedWalletConnectorKey.type';
16
17
  import { SettingsOverrides } from './SettingsOverrides';
17
18
  import { SocialSettings } from './SocialSettings';
18
19
  export type ChainsToConnect = {
@@ -134,7 +135,7 @@ export interface IDynamicContext {
134
135
  setPasskeySuccessPopup: (key: PasskeySuccessEnum) => void;
135
136
  setPrimaryWallet: (walletId: string) => Promise<void>;
136
137
  setQrcodeUri: Dispatch<SetStateAction<string>>;
137
- setSelectedWalletConnectorKey: (key: string | null) => void;
138
+ setSelectedWalletConnectorKey: SetSelectedWalletConnectorKey;
138
139
  setSelectedWalletWithAction: (walletWithAction: WalletWithAction | null) => void;
139
140
  setShowAuthFlow: SetShowAuthFlow;
140
141
  /**