@dynamic-labs/sdk-react-core 4.20.15 → 4.20.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/index.cjs +1 -1
- package/src/index.js +1 -1
- package/src/lib/components/MenuList/DropdownMenu/DropdownMenu.types.d.ts +1 -0
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +1 -1
- package/src/lib/components/NetworkPicker/components/Network/Network.js +1 -1
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +1 -1
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +1 -1
- package/src/lib/components/SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.cjs +1 -1
- package/src/lib/components/SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.js +1 -1
- package/src/lib/components/TypographyButton/TypographyButton.cjs +1 -1
- package/src/lib/components/TypographyButton/TypographyButton.js +1 -1
- package/src/lib/locale/en/translation.cjs +17 -0
- package/src/lib/locale/en/translation.d.ts +17 -0
- package/src/lib/locale/en/translation.js +17 -0
- package/src/lib/utils/functions/findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.d.ts +2 -1
- package/src/lib/utils/hooks/useSubmitExchangeFunding/useSubmitExchangeFunding.cjs +1 -1
- package/src/lib/utils/hooks/useSubmitExchangeFunding/useSubmitExchangeFunding.js +1 -1
- package/src/lib/utils/hooks/useSyncEmbeddedWalletFlow/useSyncEmbeddedWalletFlow.cjs +14 -9
- package/src/lib/utils/hooks/useSyncEmbeddedWalletFlow/useSyncEmbeddedWalletFlow.js +14 -9
- package/src/lib/views/AccessBlockedView/AccessBlockedView.cjs +1 -1
- package/src/lib/views/AccessBlockedView/AccessBlockedView.js +1 -1
- package/src/lib/views/ExchangeList/ExchangeListItem/ExchangeListItem.cjs +1 -1
- package/src/lib/views/ExchangeList/ExchangeListItem/ExchangeListItem.js +1 -1
- package/src/lib/views/GlobalWalletConfirmView/GlobalWalletConfirmView.cjs +2 -2
- package/src/lib/views/GlobalWalletConfirmView/GlobalWalletConfirmView.js +2 -2
- package/src/lib/views/GlobalWalletInfoView/GlobalWalletInfoView.cjs +1 -1
- package/src/lib/views/GlobalWalletInfoView/GlobalWalletInfoView.js +1 -1
- package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.cjs +1 -1
- package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.js +1 -1
- package/src/lib/views/MfaExchangeView/MfaExchangeView.cjs +2 -2
- package/src/lib/views/MfaExchangeView/MfaExchangeView.js +2 -2
- package/src/lib/views/MfaRecoveryView/MfaRecoveryView.cjs +1 -1
- package/src/lib/views/MfaRecoveryView/MfaRecoveryView.js +1 -1
- package/src/lib/views/MfaSecureDeviceHelpView/MfaSecureDeviceHelpView.cjs +2 -2
- package/src/lib/views/MfaSecureDeviceHelpView/MfaSecureDeviceHelpView.js +2 -2
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.cjs +1 -1
- package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.js +1 -1
- package/src/lib/views/MobileWalletRedirectView/MobileWalletRedirectView.cjs +2 -2
- package/src/lib/views/MobileWalletRedirectView/MobileWalletRedirectView.js +2 -2
- package/src/lib/views/Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.js +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.js +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +1 -1
- package/src/lib/views/SandboxMaximumThresholdReached/SandboxMaximumThresholdReached.cjs +1 -1
- package/src/lib/views/SandboxMaximumThresholdReached/SandboxMaximumThresholdReached.js +1 -1
- package/src/lib/views/SessionPermissionsView/SessionPermissionsView.cjs +2 -2
- package/src/lib/views/SessionPermissionsView/SessionPermissionsView.js +2 -2
- package/src/lib/views/SubdomainField/SubdomainField.cjs +1 -1
- package/src/lib/views/SubdomainField/SubdomainField.js +1 -1
- package/src/lib/views/SyncWalletView/AutoReconnectingView/AutoReconnectingView.cjs +1 -1
- package/src/lib/views/SyncWalletView/AutoReconnectingView/AutoReconnectingView.js +1 -1
- package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.cjs +4 -2
- package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.js +4 -2
- package/src/lib/views/WalletAlreadyExistsView/WalletAlreadyExistsView.cjs +1 -1
- package/src/lib/views/WalletAlreadyExistsView/WalletAlreadyExistsView.js +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.cjs +3 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.js +3 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceList/TokenBalanceList.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceList/TokenBalanceList.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +6 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +6 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +5 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +5 -2
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +51 -41
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +51 -41
- package/src/lib/widgets/DynamicWidget/components/WalletDetailsCard/WalletDetailsCard.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/WalletDetailsCard/WalletDetailsCard.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.cjs +5 -5
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.js +5 -5
- package/src/lib/widgets/DynamicWidget/views/ChooseLinkedWalletView/ChooseLinkedWalletView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ChooseLinkedWalletView/ChooseLinkedWalletView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ChooseOnrampProviderView/ChooseOnrampProviderView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ChooseOnrampProviderView/ChooseOnrampProviderView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/ChooseWalletFundingMethod.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/ChooseWalletFundingMethod.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ConfirmExchangeTransferView/ConfirmExchangeTransferView.cjs +7 -7
- package/src/lib/widgets/DynamicWidget/views/ConfirmExchangeTransferView/ConfirmExchangeTransferView.js +7 -7
- package/src/lib/widgets/DynamicWidget/views/ConnectedAppsView/ConnectedAppsView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/ConnectedAppsView/ConnectedAppsView.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/DepositView/DepositView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/DepositView/DepositView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/DepositedExchangeView/DepositedExchangeView.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/views/DepositedExchangeView/DepositedExchangeView.js +3 -3
- package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/components/UserDeviceTile.cjs +7 -4
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/components/UserDeviceTile.js +7 -4
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +2 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +2 -1
- package/src/lib/widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs +5 -3
- package/src/lib/widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js +5 -3
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionListItem/SessionListItem.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionListItem/SessionListItem.js +3 -3
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementInfoView/SessionManagementInfoView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementInfoView/SessionManagementInfoView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/SettingsView/EmptyScreen/EmptyScreen.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/SettingsView/EmptyScreen/EmptyScreen.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.20.17](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.16...v4.20.17) (2025-07-04)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* accidentally setting primary wallet back after logout ([#9095](https://github.com/dynamic-labs/dynamic-auth/issues/9095)) ([9fc029c](https://github.com/dynamic-labs/dynamic-auth/commit/9fc029c3e83a946e134715549fdf5b81699df9bc))
|
|
8
|
+
* make export handler static to avoid issues with reconstrucs ([#9092](https://github.com/dynamic-labs/dynamic-auth/issues/9092)) ([5bcd68e](https://github.com/dynamic-labs/dynamic-auth/commit/5bcd68ee8fa81c7ae77680be157417e54edb9533))
|
|
9
|
+
* phantom redirect for mainnet ([#9094](https://github.com/dynamic-labs/dynamic-auth/issues/9094)) ([5e9066f](https://github.com/dynamic-labs/dynamic-auth/commit/5e9066fa9cc0648cb48dda1f553f56c9f98028f3))
|
|
10
|
+
|
|
11
|
+
### [4.20.16](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.15...v4.20.16) (2025-07-03)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* remove metamask in-app-browser default ([#9086](https://github.com/dynamic-labs/dynamic-auth/issues/9086)) ([f3170d6](https://github.com/dynamic-labs/dynamic-auth/commit/f3170d6a6de251f8d9f6585fbc1bac916aa892a2))
|
|
17
|
+
|
|
2
18
|
### [4.20.15](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.14...v4.20.15) (2025-07-03)
|
|
3
19
|
|
|
4
20
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.20.
|
|
3
|
+
"version": "4.20.17",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.704",
|
|
6
6
|
"@dynamic-labs-sdk/client": "0.0.1-alpha.7",
|
|
@@ -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.20.
|
|
19
|
-
"@dynamic-labs/iconic": "4.20.
|
|
20
|
-
"@dynamic-labs/logger": "4.20.
|
|
21
|
-
"@dynamic-labs/multi-wallet": "4.20.
|
|
22
|
-
"@dynamic-labs/rpc-providers": "4.20.
|
|
23
|
-
"@dynamic-labs/store": "4.20.
|
|
24
|
-
"@dynamic-labs/types": "4.20.
|
|
25
|
-
"@dynamic-labs/utils": "4.20.
|
|
26
|
-
"@dynamic-labs/wallet-book": "4.20.
|
|
27
|
-
"@dynamic-labs/wallet-connector-core": "4.20.
|
|
18
|
+
"@dynamic-labs/assert-package-version": "4.20.17",
|
|
19
|
+
"@dynamic-labs/iconic": "4.20.17",
|
|
20
|
+
"@dynamic-labs/logger": "4.20.17",
|
|
21
|
+
"@dynamic-labs/multi-wallet": "4.20.17",
|
|
22
|
+
"@dynamic-labs/rpc-providers": "4.20.17",
|
|
23
|
+
"@dynamic-labs/store": "4.20.17",
|
|
24
|
+
"@dynamic-labs/types": "4.20.17",
|
|
25
|
+
"@dynamic-labs/utils": "4.20.17",
|
|
26
|
+
"@dynamic-labs/wallet-book": "4.20.17",
|
|
27
|
+
"@dynamic-labs/wallet-connector-core": "4.20.17",
|
|
28
28
|
"eventemitter3": "5.0.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
package/src/index.cjs
CHANGED
|
@@ -119,9 +119,9 @@ var useMultiWalletPromptState = require('./lib/widgets/DynamicWidget/hooks/useMu
|
|
|
119
119
|
require('./lib/context/WalletContext/WalletContext.cjs');
|
|
120
120
|
require('./lib/context/CaptchaContext/CaptchaContext.cjs');
|
|
121
121
|
var DynamicWidgetContext = require('./lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
122
|
+
var useSwitchWallet = require('./lib/utils/hooks/useSwitchWallet/useSwitchWallet.cjs');
|
|
122
123
|
require('./lib/components/IconButton/IconButton.cjs');
|
|
123
124
|
require('./lib/components/MenuList/Dropdown/Dropdown.cjs');
|
|
124
|
-
var useSwitchWallet = require('./lib/utils/hooks/useSwitchWallet/useSwitchWallet.cjs');
|
|
125
125
|
require('formik');
|
|
126
126
|
require('./lib/utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
|
|
127
127
|
require('./lib/store/state/sendBalances.cjs');
|
package/src/index.js
CHANGED
|
@@ -115,9 +115,9 @@ export { useMultiWalletPromptState } from './lib/widgets/DynamicWidget/hooks/use
|
|
|
115
115
|
import './lib/context/WalletContext/WalletContext.js';
|
|
116
116
|
import './lib/context/CaptchaContext/CaptchaContext.js';
|
|
117
117
|
export { DynamicWidgetContextProvider } from './lib/widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
118
|
+
export { useSwitchWallet } from './lib/utils/hooks/useSwitchWallet/useSwitchWallet.js';
|
|
118
119
|
import './lib/components/IconButton/IconButton.js';
|
|
119
120
|
import './lib/components/MenuList/Dropdown/Dropdown.js';
|
|
120
|
-
export { useSwitchWallet } from './lib/utils/hooks/useSwitchWallet/useSwitchWallet.js';
|
|
121
121
|
import 'formik';
|
|
122
122
|
import './lib/utils/hooks/useSubdomainCheck/useSubdomainCheck.js';
|
|
123
123
|
import './lib/store/state/sendBalances.js';
|
|
@@ -107,7 +107,7 @@ const Network = ({ iconUrl, isActive, networkName, className, checkboxClassName
|
|
|
107
107
|
const { t } = reactI18next.useTranslation();
|
|
108
108
|
return (jsxRuntime.jsxs("div", { className: classNames.classNames('network', className, {
|
|
109
109
|
'network--not-supported': notSupported,
|
|
110
|
-
}), children: [jsxRuntime.jsxs("div", { className: 'network__container', children: [iconUrl ? (jsxRuntime.jsx("img", { src: iconUrl, className: 'network__title-icon', alt: `${networkName} icon` })) : (jsxRuntime.jsx(error.ReactComponent, {})), jsxRuntime.jsxs("div", { className: 'network__title-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'button_primary', className: 'network__title-copy', as: 'span', weight: 'medium', color: notSupported ? 'secondary' : 'primary', children: networkName }), notSupported && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_mini', className: 'network__title-copy', as: 'span', weight: 'medium', color: notSupported ? 'secondary' : 'primary', "data-testid": 'network-not-supported', children: t('dyn_network_not_supported.wallet') }))] })] }), jsxRuntime.jsxs("div", { className: classNames.classNames('network__status-container', {
|
|
110
|
+
}), children: [jsxRuntime.jsxs("div", { className: 'network__container', children: [iconUrl ? (jsxRuntime.jsx("img", { src: iconUrl, className: 'network__title-icon', alt: `${networkName} icon` })) : (jsxRuntime.jsx(error.ReactComponent, {})), jsxRuntime.jsxs("div", { className: 'network__title-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'button_primary', className: 'network__title-copy', as: 'span', weight: 'medium', color: notSupported ? 'secondary' : 'primary', children: networkName }), notSupported && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_mini', className: 'network__title-copy', as: 'span', weight: 'medium', color: notSupported ? 'secondary' : 'primary', "data-testid": 'network-not-supported', copykey: 'dyn_network_not_supported.wallet', children: t('dyn_network_not_supported.wallet') }))] })] }), jsxRuntime.jsxs("div", { className: classNames.classNames('network__status-container', {
|
|
111
111
|
'network__status-container--active': isActive,
|
|
112
112
|
}, checkboxClassName), "data-testid": 'single-network-checkbox', children: [isActive && jsxRuntime.jsx(check.ReactComponent, { className: 'network__status-icon' }), isChanging && (jsxRuntime.jsx(Spinner.Spinner, { className: 'network__status-spinner-icon', size: 12 }))] })] }));
|
|
113
113
|
};
|
|
@@ -103,7 +103,7 @@ const Network = ({ iconUrl, isActive, networkName, className, checkboxClassName
|
|
|
103
103
|
const { t } = useTranslation();
|
|
104
104
|
return (jsxs("div", { className: classNames('network', className, {
|
|
105
105
|
'network--not-supported': notSupported,
|
|
106
|
-
}), children: [jsxs("div", { className: 'network__container', children: [iconUrl ? (jsx("img", { src: iconUrl, className: 'network__title-icon', alt: `${networkName} icon` })) : (jsx(SvgError, {})), jsxs("div", { className: 'network__title-container', children: [jsx(Typography, { variant: 'button_primary', className: 'network__title-copy', as: 'span', weight: 'medium', color: notSupported ? 'secondary' : 'primary', children: networkName }), notSupported && (jsx(Typography, { variant: 'body_mini', className: 'network__title-copy', as: 'span', weight: 'medium', color: notSupported ? 'secondary' : 'primary', "data-testid": 'network-not-supported', children: t('dyn_network_not_supported.wallet') }))] })] }), jsxs("div", { className: classNames('network__status-container', {
|
|
106
|
+
}), children: [jsxs("div", { className: 'network__container', children: [iconUrl ? (jsx("img", { src: iconUrl, className: 'network__title-icon', alt: `${networkName} icon` })) : (jsx(SvgError, {})), jsxs("div", { className: 'network__title-container', children: [jsx(Typography, { variant: 'button_primary', className: 'network__title-copy', as: 'span', weight: 'medium', color: notSupported ? 'secondary' : 'primary', children: networkName }), notSupported && (jsx(Typography, { variant: 'body_mini', className: 'network__title-copy', as: 'span', weight: 'medium', color: notSupported ? 'secondary' : 'primary', "data-testid": 'network-not-supported', copykey: 'dyn_network_not_supported.wallet', children: t('dyn_network_not_supported.wallet') }))] })] }), jsxs("div", { className: classNames('network__status-container', {
|
|
107
107
|
'network__status-container--active': isActive,
|
|
108
108
|
}, checkboxClassName), "data-testid": 'single-network-checkbox', children: [isActive && jsx(SvgCheck, { className: 'network__status-icon' }), isChanging && (jsx(Spinner, { className: 'network__status-spinner-icon', size: 12 }))] })] }));
|
|
109
109
|
};
|
|
@@ -183,7 +183,7 @@ const SendBalanceForm = ({ initialValues, onSubmit, decimals = 18, validateAddre
|
|
|
183
183
|
}, placeholder: t('dyn_send_transaction.data.amount.placeholder'), as: Input.Input, error: errors['amount'], copykey: 'dyn_send_transaction.data.amount.label', message: touched['amount'] &&
|
|
184
184
|
getDisplayErrorMessage(errors, t, 'amount', decimals), style: {
|
|
185
185
|
paddingLeft: `${leftSymbolPadding}px`,
|
|
186
|
-
} }), 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', 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'] &&
|
|
186
|
+
} }), 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'] &&
|
|
187
187
|
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') })] }));
|
|
188
188
|
} }));
|
|
189
189
|
};
|
|
@@ -179,7 +179,7 @@ const SendBalanceForm = ({ initialValues, onSubmit, decimals = 18, validateAddre
|
|
|
179
179
|
}, placeholder: t('dyn_send_transaction.data.amount.placeholder'), as: Input, error: errors['amount'], copykey: 'dyn_send_transaction.data.amount.label', message: touched['amount'] &&
|
|
180
180
|
getDisplayErrorMessage(errors, t, 'amount', decimals), style: {
|
|
181
181
|
paddingLeft: `${leftSymbolPadding}px`,
|
|
182
|
-
} }), 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', 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'] &&
|
|
182
|
+
} }), 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'] &&
|
|
183
183
|
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') })] }));
|
|
184
184
|
} }));
|
|
185
185
|
};
|
|
@@ -169,7 +169,7 @@ const TokensBalanceDropdown = ({ tokenBalances, currentToken, setCurrentToken, i
|
|
|
169
169
|
}), children: jsxRuntime.jsx(stroke.ReactComponent, {}) })] })), jsxRuntime.jsx(MenuList.MenuList, { className: 'tokens-balance-dropdown__menu_list', isOpen: isDropdownOpen, popperProps: {
|
|
170
170
|
anchorOrigin: 'bottom-left',
|
|
171
171
|
anchorRef,
|
|
172
|
-
}, 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', children: t('dyn_wallet_information.multi_asset.empty_state') }) })) })] }));
|
|
172
|
+
}, 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') }) })) })] }));
|
|
173
173
|
};
|
|
174
174
|
|
|
175
175
|
exports.TokensBalanceDropdown = TokensBalanceDropdown;
|
|
@@ -165,7 +165,7 @@ const TokensBalanceDropdown = ({ tokenBalances, currentToken, setCurrentToken, i
|
|
|
165
165
|
}), children: jsx(SvgStroke, {}) })] })), jsx(MenuList, { className: 'tokens-balance-dropdown__menu_list', isOpen: isDropdownOpen, popperProps: {
|
|
166
166
|
anchorOrigin: 'bottom-left',
|
|
167
167
|
anchorRef,
|
|
168
|
-
}, 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', children: t('dyn_wallet_information.multi_asset.empty_state') }) })) })] }));
|
|
168
|
+
}, 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') }) })) })] }));
|
|
169
169
|
};
|
|
170
170
|
|
|
171
171
|
export { TokensBalanceDropdown };
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
8
9
|
var Button = require('../Button/Button.cjs');
|
|
9
10
|
var Typography = require('../Typography/Typography.cjs');
|
|
10
|
-
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
11
11
|
|
|
12
12
|
const defaultTypographyVariantMap = {
|
|
13
13
|
'brand-primary': 'button_primary',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __rest } from '../../../../_virtual/_tslib.js';
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
4
5
|
import { Button, defaultButtonVariant } from '../Button/Button.js';
|
|
5
6
|
import { Typography } from '../Typography/Typography.js';
|
|
6
|
-
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
7
7
|
|
|
8
8
|
const defaultTypographyVariantMap = {
|
|
9
9
|
'brand-primary': 'button_primary',
|
|
@@ -891,6 +891,8 @@ const translation = {
|
|
|
891
891
|
iPhone: 'iPhone',
|
|
892
892
|
opera: 'Opera Browser',
|
|
893
893
|
safari: 'Safari Browser',
|
|
894
|
+
passkey: 'Passkey',
|
|
895
|
+
passkey_rename: 'Rename',
|
|
894
896
|
},
|
|
895
897
|
recovery_button: 'Set up new passkey',
|
|
896
898
|
},
|
|
@@ -1203,6 +1205,7 @@ const translation = {
|
|
|
1203
1205
|
add_mfa_button: 'Authenticator App',
|
|
1204
1206
|
no_devices: 'No authenticator apps configured',
|
|
1205
1207
|
generate_backup_codes_button: 'Get new backup codes',
|
|
1208
|
+
delete: 'Delete',
|
|
1206
1209
|
},
|
|
1207
1210
|
/**
|
|
1208
1211
|
* @description copy keys for waas backup unsuccessful view
|
|
@@ -1883,6 +1886,20 @@ const translation = {
|
|
|
1883
1886
|
description: 'You’ve selected the same wallet for both sending and receiving. To continue, choose a different wallet.',
|
|
1884
1887
|
return: 'Return to wallet list',
|
|
1885
1888
|
},
|
|
1889
|
+
dyn_secondary_wallet: {
|
|
1890
|
+
title: 'Select Wallet',
|
|
1891
|
+
copy_address: 'Copy address',
|
|
1892
|
+
view_address: 'View address',
|
|
1893
|
+
copy_ens: 'Copy ENS',
|
|
1894
|
+
view_ens: 'View ENS',
|
|
1895
|
+
unlink: 'Unlink',
|
|
1896
|
+
switch_wallet: 'Switch wallet',
|
|
1897
|
+
unlink_from_account: 'Unlink from my account',
|
|
1898
|
+
disconnect_from_account: 'Disconnect from my account',
|
|
1899
|
+
export: 'Export private keys',
|
|
1900
|
+
connect_new: 'Connect new',
|
|
1901
|
+
link_new: 'Link new',
|
|
1902
|
+
},
|
|
1886
1903
|
/**
|
|
1887
1904
|
* @description copy keys for send transaction flow views
|
|
1888
1905
|
* @default
|
|
@@ -885,6 +885,8 @@ export declare const translation: {
|
|
|
885
885
|
iPhone: string;
|
|
886
886
|
opera: string;
|
|
887
887
|
safari: string;
|
|
888
|
+
passkey: string;
|
|
889
|
+
passkey_rename: string;
|
|
888
890
|
};
|
|
889
891
|
recovery_button: string;
|
|
890
892
|
};
|
|
@@ -1199,6 +1201,7 @@ export declare const translation: {
|
|
|
1199
1201
|
add_mfa_button: string;
|
|
1200
1202
|
no_devices: string;
|
|
1201
1203
|
generate_backup_codes_button: string;
|
|
1204
|
+
delete: string;
|
|
1202
1205
|
};
|
|
1203
1206
|
/**
|
|
1204
1207
|
* @description copy keys for waas backup unsuccessful view
|
|
@@ -1879,6 +1882,20 @@ export declare const translation: {
|
|
|
1879
1882
|
description: string;
|
|
1880
1883
|
return: string;
|
|
1881
1884
|
};
|
|
1885
|
+
dyn_secondary_wallet: {
|
|
1886
|
+
title: string;
|
|
1887
|
+
copy_address: string;
|
|
1888
|
+
view_address: string;
|
|
1889
|
+
copy_ens: string;
|
|
1890
|
+
view_ens: string;
|
|
1891
|
+
unlink: string;
|
|
1892
|
+
switch_wallet: string;
|
|
1893
|
+
unlink_from_account: string;
|
|
1894
|
+
disconnect_from_account: string;
|
|
1895
|
+
export: string;
|
|
1896
|
+
connect_new: string;
|
|
1897
|
+
link_new: string;
|
|
1898
|
+
};
|
|
1882
1899
|
/**
|
|
1883
1900
|
* @description copy keys for send transaction flow views
|
|
1884
1901
|
* @default
|
|
@@ -887,6 +887,8 @@ const translation = {
|
|
|
887
887
|
iPhone: 'iPhone',
|
|
888
888
|
opera: 'Opera Browser',
|
|
889
889
|
safari: 'Safari Browser',
|
|
890
|
+
passkey: 'Passkey',
|
|
891
|
+
passkey_rename: 'Rename',
|
|
890
892
|
},
|
|
891
893
|
recovery_button: 'Set up new passkey',
|
|
892
894
|
},
|
|
@@ -1199,6 +1201,7 @@ const translation = {
|
|
|
1199
1201
|
add_mfa_button: 'Authenticator App',
|
|
1200
1202
|
no_devices: 'No authenticator apps configured',
|
|
1201
1203
|
generate_backup_codes_button: 'Get new backup codes',
|
|
1204
|
+
delete: 'Delete',
|
|
1202
1205
|
},
|
|
1203
1206
|
/**
|
|
1204
1207
|
* @description copy keys for waas backup unsuccessful view
|
|
@@ -1879,6 +1882,20 @@ const translation = {
|
|
|
1879
1882
|
description: 'You’ve selected the same wallet for both sending and receiving. To continue, choose a different wallet.',
|
|
1880
1883
|
return: 'Return to wallet list',
|
|
1881
1884
|
},
|
|
1885
|
+
dyn_secondary_wallet: {
|
|
1886
|
+
title: 'Select Wallet',
|
|
1887
|
+
copy_address: 'Copy address',
|
|
1888
|
+
view_address: 'View address',
|
|
1889
|
+
copy_ens: 'Copy ENS',
|
|
1890
|
+
view_ens: 'View ENS',
|
|
1891
|
+
unlink: 'Unlink',
|
|
1892
|
+
switch_wallet: 'Switch wallet',
|
|
1893
|
+
unlink_from_account: 'Unlink from my account',
|
|
1894
|
+
disconnect_from_account: 'Disconnect from my account',
|
|
1895
|
+
export: 'Export private keys',
|
|
1896
|
+
connect_new: 'Connect new',
|
|
1897
|
+
link_new: 'Link new',
|
|
1898
|
+
},
|
|
1882
1899
|
/**
|
|
1883
1900
|
* @description copy keys for send transaction flow views
|
|
1884
1901
|
* @default
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SdkUser } from '@dynamic-labs/sdk-api-core';
|
|
1
2
|
import { UserProfile } from '../../../..';
|
|
2
3
|
/**
|
|
3
4
|
* Finds the first embedded wallet from the verified credentials for the given chains.
|
|
@@ -6,4 +7,4 @@ import { UserProfile } from '../../../..';
|
|
|
6
7
|
* @param chains - The chains to check for embedded wallets.
|
|
7
8
|
* @returns The first embedded wallet from the verified credentials for the given chains.
|
|
8
9
|
*/
|
|
9
|
-
export declare const findEmbeddedWalletFromVerifiedCredentials: (user: UserProfile, chains?: string[]) => import("@dynamic-labs/sdk-api-core").JwtVerifiedCredential | undefined;
|
|
10
|
+
export declare const findEmbeddedWalletFromVerifiedCredentials: (user: UserProfile | SdkUser, chains?: string[]) => import("@dynamic-labs/sdk-api-core").JwtVerifiedCredential | undefined;
|
|
@@ -166,7 +166,7 @@ const useSubmitExchangeFunding = () => {
|
|
|
166
166
|
errorMessage = t('dyn_exchange_transfer_errors.unknown');
|
|
167
167
|
}
|
|
168
168
|
if (showError) {
|
|
169
|
-
const errorAlert = (jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', color: 'current-color', children: [t('dyn_exchange_transfer_errors.title'), jsxRuntime.jsx(Typography.Typography, { color: 'current-color', children: errorMessage })] }));
|
|
169
|
+
const errorAlert = (jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', color: 'current-color', copykey: 'dyn_exchange_transfer_errors.title', children: [t('dyn_exchange_transfer_errors.title'), jsxRuntime.jsx(Typography.Typography, { color: 'current-color', children: errorMessage })] }));
|
|
170
170
|
setShowAuthFlow(false);
|
|
171
171
|
goToInitialDynamicWidgetView();
|
|
172
172
|
setHeaderAlert({
|
|
@@ -162,7 +162,7 @@ const useSubmitExchangeFunding = () => {
|
|
|
162
162
|
errorMessage = t('dyn_exchange_transfer_errors.unknown');
|
|
163
163
|
}
|
|
164
164
|
if (showError) {
|
|
165
|
-
const errorAlert = (jsxs(Typography, { variant: 'body_normal', color: 'current-color', children: [t('dyn_exchange_transfer_errors.title'), jsx(Typography, { color: 'current-color', children: errorMessage })] }));
|
|
165
|
+
const errorAlert = (jsxs(Typography, { variant: 'body_normal', color: 'current-color', copykey: 'dyn_exchange_transfer_errors.title', children: [t('dyn_exchange_transfer_errors.title'), jsx(Typography, { color: 'current-color', children: errorMessage })] }));
|
|
166
166
|
setShowAuthFlow(false);
|
|
167
167
|
goToInitialDynamicWidgetView();
|
|
168
168
|
setHeaderAlert({
|
|
@@ -6,13 +6,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var utils = require('@dynamic-labs/utils');
|
|
9
|
-
var
|
|
10
|
-
require('@dynamic-labs/sdk-api-core');
|
|
11
|
-
require('@dynamic-labs/wallet-connector-core');
|
|
9
|
+
var client = require('../../../client/client.cjs');
|
|
12
10
|
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
13
11
|
require('../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
12
|
+
require('@dynamic-labs/sdk-api-core');
|
|
14
13
|
var logger = require('../../../shared/logger.cjs');
|
|
15
14
|
require('@dynamic-labs/iconic');
|
|
15
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
16
16
|
require('react/jsx-runtime');
|
|
17
17
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
18
18
|
require('@dynamic-labs/wallet-book');
|
|
@@ -28,7 +28,6 @@ require('@dynamic-labs/multi-wallet');
|
|
|
28
28
|
require('react-international-phone');
|
|
29
29
|
require('../../../store/state/nonce/nonce.cjs');
|
|
30
30
|
require('@dynamic-labs-sdk/client');
|
|
31
|
-
require('../../../client/client.cjs');
|
|
32
31
|
require('@dynamic-labs-sdk/client/core');
|
|
33
32
|
require('../../../store/state/projectSettings/projectSettings.cjs');
|
|
34
33
|
require('../../../events/dynamicEvents.cjs');
|
|
@@ -51,6 +50,9 @@ require('bs58');
|
|
|
51
50
|
require('@dynamic-labs/types');
|
|
52
51
|
require('../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
53
52
|
var LoadingContext = require('../../../context/LoadingContext/LoadingContext.cjs');
|
|
53
|
+
var useEmbeddedWallet = require('../useEmbeddedWallet/useEmbeddedWallet.cjs');
|
|
54
|
+
var WalletContext = require('../../../context/WalletContext/WalletContext.cjs');
|
|
55
|
+
require('../useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
|
|
54
56
|
require('yup');
|
|
55
57
|
require('../../../context/MockContext/MockContext.cjs');
|
|
56
58
|
require('../../../views/CollectUserDataView/useFields.cjs');
|
|
@@ -61,7 +63,6 @@ require('../../../store/state/walletOptions/walletOptions.cjs');
|
|
|
61
63
|
require('react-i18next');
|
|
62
64
|
require('../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
63
65
|
require('../../../components/Alert/Alert.cjs');
|
|
64
|
-
var WalletContext = require('../../../context/WalletContext/WalletContext.cjs');
|
|
65
66
|
require('../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
66
67
|
require('../../../components/IconButton/IconButton.cjs');
|
|
67
68
|
require('../../../components/InlineWidget/InlineWidget.cjs');
|
|
@@ -102,15 +103,14 @@ require('../../../../index.cjs');
|
|
|
102
103
|
require('../../../store/state/tokenBalances.cjs');
|
|
103
104
|
require('../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
104
105
|
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
105
|
-
require('../useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
|
|
106
106
|
|
|
107
107
|
let acknowledgedExportPrompt = false;
|
|
108
108
|
const useSyncEmbeddedWalletFlow = () => {
|
|
109
|
-
const { projectSettings, user, primaryWalletId, walletConnectorOptions, primaryWallet, setShowAuthFlow, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
109
|
+
const { projectSettings, user: contextUser, primaryWalletId, walletConnectorOptions, primaryWallet, setShowAuthFlow, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
110
110
|
const { isLoadingEmbeddedWallet } = WalletContext.useWalletContext();
|
|
111
111
|
const { loading: globalLoading } = LoadingContext.useLoadingContext();
|
|
112
112
|
const { initExportProcess } = useEmbeddedReveal.useEmbeddedReveal();
|
|
113
|
-
const [wasShownExportPrompt, setWasShownExportPrompt] = useLocalStorage.useLocalStorage(`dynamic_export_prompt-${
|
|
113
|
+
const [wasShownExportPrompt, setWasShownExportPrompt] = useLocalStorage.useLocalStorage(`dynamic_export_prompt-${contextUser === null || contextUser === void 0 ? void 0 : contextUser.userId}`, false, (data) => Boolean(data));
|
|
114
114
|
const { createEmbeddedWallet, shouldAutoCreateEmbeddedWallet, shouldPromptForKeyExport, } = useEmbeddedWallet.useEmbeddedWallet();
|
|
115
115
|
const triggeredCreate = React.useRef(false);
|
|
116
116
|
const handleAcknowledgeExportPrompt = React.useCallback((value = true) => {
|
|
@@ -126,6 +126,11 @@ const useSyncEmbeddedWalletFlow = () => {
|
|
|
126
126
|
// we force them to created it before they can use the app
|
|
127
127
|
// ** It must be an useEffect because some of the dependencies are async
|
|
128
128
|
React.useEffect(() => {
|
|
129
|
+
// Explanation: if the user just logged out, the user from the hook might still be set
|
|
130
|
+
// but the client will be null.
|
|
131
|
+
// And if the user is not onboarding complete yet, the hook won't be set even though the client.user is set.
|
|
132
|
+
// This is why we check for the user AND the client.user.
|
|
133
|
+
const user = contextUser && client.getDynamicClient().user;
|
|
129
134
|
const syncEmbeddedWallet = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
130
135
|
const isNewUser = user === null || user === void 0 ? void 0 : user.newUser;
|
|
131
136
|
if (shouldSyncCreateWallet) {
|
|
@@ -175,7 +180,7 @@ const useSyncEmbeddedWalletFlow = () => {
|
|
|
175
180
|
}
|
|
176
181
|
syncEmbeddedWallet();
|
|
177
182
|
}, [
|
|
178
|
-
|
|
183
|
+
contextUser,
|
|
179
184
|
projectSettings,
|
|
180
185
|
primaryWalletId,
|
|
181
186
|
createEmbeddedWallet,
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { useRef, useCallback, useEffect } from 'react';
|
|
4
4
|
import { EmbeddedWalletException } from '@dynamic-labs/utils';
|
|
5
|
-
import {
|
|
6
|
-
import '@dynamic-labs/sdk-api-core';
|
|
7
|
-
import '@dynamic-labs/wallet-connector-core';
|
|
5
|
+
import { getDynamicClient } from '../../../client/client.js';
|
|
8
6
|
import '../../../context/DynamicContext/DynamicContext.js';
|
|
9
7
|
import '../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
8
|
+
import '@dynamic-labs/sdk-api-core';
|
|
10
9
|
import { logger } from '../../../shared/logger.js';
|
|
11
10
|
import '@dynamic-labs/iconic';
|
|
11
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
12
12
|
import 'react/jsx-runtime';
|
|
13
13
|
import '../../../context/ViewContext/ViewContext.js';
|
|
14
14
|
import '@dynamic-labs/wallet-book';
|
|
@@ -24,7 +24,6 @@ import '@dynamic-labs/multi-wallet';
|
|
|
24
24
|
import 'react-international-phone';
|
|
25
25
|
import '../../../store/state/nonce/nonce.js';
|
|
26
26
|
import '@dynamic-labs-sdk/client';
|
|
27
|
-
import '../../../client/client.js';
|
|
28
27
|
import '@dynamic-labs-sdk/client/core';
|
|
29
28
|
import '../../../store/state/projectSettings/projectSettings.js';
|
|
30
29
|
import '../../../events/dynamicEvents.js';
|
|
@@ -47,6 +46,9 @@ import 'bs58';
|
|
|
47
46
|
import '@dynamic-labs/types';
|
|
48
47
|
import '../../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
49
48
|
import { useLoadingContext } from '../../../context/LoadingContext/LoadingContext.js';
|
|
49
|
+
import { useEmbeddedWallet } from '../useEmbeddedWallet/useEmbeddedWallet.js';
|
|
50
|
+
import { useWalletContext } from '../../../context/WalletContext/WalletContext.js';
|
|
51
|
+
import '../useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
|
|
50
52
|
import 'yup';
|
|
51
53
|
import '../../../context/MockContext/MockContext.js';
|
|
52
54
|
import '../../../views/CollectUserDataView/useFields.js';
|
|
@@ -57,7 +59,6 @@ import '../../../store/state/walletOptions/walletOptions.js';
|
|
|
57
59
|
import 'react-i18next';
|
|
58
60
|
import '../../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
59
61
|
import '../../../components/Alert/Alert.js';
|
|
60
|
-
import { useWalletContext } from '../../../context/WalletContext/WalletContext.js';
|
|
61
62
|
import '../../../components/ShadowDOM/ShadowDOM.js';
|
|
62
63
|
import '../../../components/IconButton/IconButton.js';
|
|
63
64
|
import '../../../components/InlineWidget/InlineWidget.js';
|
|
@@ -98,15 +99,14 @@ import '../../../../index.js';
|
|
|
98
99
|
import '../../../store/state/tokenBalances.js';
|
|
99
100
|
import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
100
101
|
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
101
|
-
import '../useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
|
|
102
102
|
|
|
103
103
|
let acknowledgedExportPrompt = false;
|
|
104
104
|
const useSyncEmbeddedWalletFlow = () => {
|
|
105
|
-
const { projectSettings, user, primaryWalletId, walletConnectorOptions, primaryWallet, setShowAuthFlow, } = useInternalDynamicContext();
|
|
105
|
+
const { projectSettings, user: contextUser, primaryWalletId, walletConnectorOptions, primaryWallet, setShowAuthFlow, } = useInternalDynamicContext();
|
|
106
106
|
const { isLoadingEmbeddedWallet } = useWalletContext();
|
|
107
107
|
const { loading: globalLoading } = useLoadingContext();
|
|
108
108
|
const { initExportProcess } = useEmbeddedReveal();
|
|
109
|
-
const [wasShownExportPrompt, setWasShownExportPrompt] = useLocalStorage(`dynamic_export_prompt-${
|
|
109
|
+
const [wasShownExportPrompt, setWasShownExportPrompt] = useLocalStorage(`dynamic_export_prompt-${contextUser === null || contextUser === void 0 ? void 0 : contextUser.userId}`, false, (data) => Boolean(data));
|
|
110
110
|
const { createEmbeddedWallet, shouldAutoCreateEmbeddedWallet, shouldPromptForKeyExport, } = useEmbeddedWallet();
|
|
111
111
|
const triggeredCreate = useRef(false);
|
|
112
112
|
const handleAcknowledgeExportPrompt = useCallback((value = true) => {
|
|
@@ -122,6 +122,11 @@ const useSyncEmbeddedWalletFlow = () => {
|
|
|
122
122
|
// we force them to created it before they can use the app
|
|
123
123
|
// ** It must be an useEffect because some of the dependencies are async
|
|
124
124
|
useEffect(() => {
|
|
125
|
+
// Explanation: if the user just logged out, the user from the hook might still be set
|
|
126
|
+
// but the client will be null.
|
|
127
|
+
// And if the user is not onboarding complete yet, the hook won't be set even though the client.user is set.
|
|
128
|
+
// This is why we check for the user AND the client.user.
|
|
129
|
+
const user = contextUser && getDynamicClient().user;
|
|
125
130
|
const syncEmbeddedWallet = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
126
131
|
const isNewUser = user === null || user === void 0 ? void 0 : user.newUser;
|
|
127
132
|
if (shouldSyncCreateWallet) {
|
|
@@ -171,7 +176,7 @@ const useSyncEmbeddedWalletFlow = () => {
|
|
|
171
176
|
}
|
|
172
177
|
syncEmbeddedWallet();
|
|
173
178
|
}, [
|
|
174
|
-
|
|
179
|
+
contextUser,
|
|
175
180
|
projectSettings,
|
|
176
181
|
primaryWalletId,
|
|
177
182
|
createEmbeddedWallet,
|
|
@@ -110,7 +110,7 @@ const AccessBlockedView = () => {
|
|
|
110
110
|
onResolve: (config) => setCountry(config === null || config === void 0 ? void 0 : config.country),
|
|
111
111
|
retries: 2,
|
|
112
112
|
});
|
|
113
|
-
return (jsxRuntime.jsxs("div", { className: 'access-blocked__container', children: [jsxRuntime.jsx("div", { className: 'access-blocked__icon', children: jsxRuntime.jsx(accessBlocked.ReactComponent, {}) }), jsxRuntime.jsx("div", { className: 'access-blocked__content', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', children: t('dyn_access_blocked.content', { jurisdiction: country }) }) })] }));
|
|
113
|
+
return (jsxRuntime.jsxs("div", { className: 'access-blocked__container', children: [jsxRuntime.jsx("div", { className: 'access-blocked__icon', children: jsxRuntime.jsx(accessBlocked.ReactComponent, {}) }), jsxRuntime.jsx("div", { className: 'access-blocked__content', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_access_blocked.content', children: t('dyn_access_blocked.content', { jurisdiction: country }) }) })] }));
|
|
114
114
|
};
|
|
115
115
|
|
|
116
116
|
exports.AccessBlockedView = AccessBlockedView;
|
|
@@ -106,7 +106,7 @@ const AccessBlockedView = () => {
|
|
|
106
106
|
onResolve: (config) => setCountry(config === null || config === void 0 ? void 0 : config.country),
|
|
107
107
|
retries: 2,
|
|
108
108
|
});
|
|
109
|
-
return (jsxs("div", { className: 'access-blocked__container', children: [jsx("div", { className: 'access-blocked__icon', children: jsx(SvgAccessBlocked, {}) }), jsx("div", { className: 'access-blocked__content', children: jsx(Typography, { variant: 'body_normal', color: 'secondary', children: t('dyn_access_blocked.content', { jurisdiction: country }) }) })] }));
|
|
109
|
+
return (jsxs("div", { className: 'access-blocked__container', children: [jsx("div", { className: 'access-blocked__icon', children: jsx(SvgAccessBlocked, {}) }), jsx("div", { className: 'access-blocked__content', children: jsx(Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_access_blocked.content', children: t('dyn_access_blocked.content', { jurisdiction: country }) }) })] }));
|
|
110
110
|
};
|
|
111
111
|
|
|
112
112
|
export { AccessBlockedView };
|
|
@@ -128,7 +128,7 @@ const ExchangeListItem = ({ disabled = false, exchange, onResetSearchValue, tile
|
|
|
128
128
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
129
129
|
jsxRuntime.jsx(Icon.Icon, { color: 'text-tertiary', size: 'mini', children: jsxRuntime.jsx(stroke.ReactComponent, {}) }), children: connected && (jsxRuntime.jsx(Badge.Badge, { dot: true, variant: 'primary', text:
|
|
130
130
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
131
|
-
jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', children: t('dyn_exchange_list.item.connected') }) })) }));
|
|
131
|
+
jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', copykey: 'dyn_exchange_list.item.connected', children: t('dyn_exchange_list.item.connected') }) })) }));
|
|
132
132
|
return (jsxRuntime.jsx(Tile, { leading: leading, trailing: trailing, name: name.charAt(0).toUpperCase() + name.slice(1), onClick: handleClick }));
|
|
133
133
|
};
|
|
134
134
|
|
|
@@ -124,7 +124,7 @@ const ExchangeListItem = ({ disabled = false, exchange, onResetSearchValue, tile
|
|
|
124
124
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
125
125
|
jsx(Icon, { color: 'text-tertiary', size: 'mini', children: jsx(SvgStroke, {}) }), children: connected && (jsx(Badge, { dot: true, variant: 'primary', text:
|
|
126
126
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
127
|
-
jsx(Typography, { variant: 'body_small', children: t('dyn_exchange_list.item.connected') }) })) }));
|
|
127
|
+
jsx(Typography, { variant: 'body_small', copykey: 'dyn_exchange_list.item.connected', children: t('dyn_exchange_list.item.connected') }) })) }));
|
|
128
128
|
return (jsx(Tile, { leading: leading, trailing: trailing, name: name.charAt(0).toUpperCase() + name.slice(1), onClick: handleClick }));
|
|
129
129
|
};
|
|
130
130
|
|
|
@@ -106,9 +106,9 @@ const GlobalWalletConfirmView = ({ pairingInfo, onConfirm, onCancel }) => {
|
|
|
106
106
|
const handleImageError = () => {
|
|
107
107
|
setImageError(true);
|
|
108
108
|
};
|
|
109
|
-
return (jsxRuntime.jsx("div", { className: 'global-wallet-confirm', children: jsxRuntime.jsx("div", { className: 'popup-content', children: jsxRuntime.jsxs("div", { className: 'wallet-connection-view', children: [!imageError && (jsxRuntime.jsx("img", { src: pairingInfo.icons[0], alt: `${pairingInfo.name} icon`, className: 'dapp-icon', onError: handleImageError })), jsxRuntime.jsx(Typography.Typography, { className: 'connection-title', variant: 'title', font: 'bold', children: t('global_wallet.confirm.description', { name: pairingInfo.name }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', className: 'dapp-url', children: pairingInfo.url }), jsxRuntime.jsxs("div", { className: 'button-group', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'cancel-button', onClick: onCancel, type: 'submit', buttonPadding: 'large', children: t('global_wallet.confirm.cancel_button') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'connect-global-button', onClick: onConfirm, type: 'submit', buttonPadding: 'large', typographyProps: {
|
|
109
|
+
return (jsxRuntime.jsx("div", { className: 'global-wallet-confirm', children: jsxRuntime.jsx("div", { className: 'popup-content', children: jsxRuntime.jsxs("div", { className: 'wallet-connection-view', children: [!imageError && (jsxRuntime.jsx("img", { src: pairingInfo.icons[0], alt: `${pairingInfo.name} icon`, className: 'dapp-icon', onError: handleImageError })), jsxRuntime.jsx(Typography.Typography, { className: 'connection-title', variant: 'title', font: 'bold', copykey: 'global_wallet.confirm.description', children: t('global_wallet.confirm.description', { name: pairingInfo.name }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', className: 'dapp-url', children: pairingInfo.url }), jsxRuntime.jsxs("div", { className: 'button-group', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'cancel-button', onClick: onCancel, type: 'submit', buttonPadding: 'large', copykey: 'global_wallet.confirm.cancel_button', children: t('global_wallet.confirm.cancel_button') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'connect-global-button', onClick: onConfirm, type: 'submit', buttonPadding: 'large', typographyProps: {
|
|
110
110
|
color: 'white',
|
|
111
|
-
}, children: t('global_wallet.confirm.connect_button') })] })] }) }) }));
|
|
111
|
+
}, copykey: 'global_wallet.confirm.connect_button', children: t('global_wallet.confirm.connect_button') })] })] }) }) }));
|
|
112
112
|
};
|
|
113
113
|
|
|
114
114
|
exports.GlobalWalletConfirmView = GlobalWalletConfirmView;
|