@dynamic-labs/sdk-react-core 4.70.0 → 4.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +14 -14
- package/src/lib/client/extension/deprecated/mfa/verifyTotpMfaDevice/verifyTotpMfaDevice.d.ts +1 -1
- package/src/lib/client/extension/functions/generateChainingSignature/generateChainingSignature.cjs +15 -0
- package/src/lib/client/extension/functions/generateChainingSignature/generateChainingSignature.d.ts +1 -0
- package/src/lib/client/extension/functions/generateChainingSignature/generateChainingSignature.js +11 -0
- package/src/lib/client/extension/functions/generateSessionKeys/generateSessionKeys.cjs +11 -0
- package/src/lib/client/extension/functions/generateSessionKeys/generateSessionKeys.d.ts +1 -0
- package/src/lib/client/extension/functions/generateSessionKeys/generateSessionKeys.js +7 -0
- package/src/lib/client/extension/functions/getClientSessionNonceHeaders/getClientSessionNonceHeaders.cjs +33 -0
- package/src/lib/client/extension/functions/getClientSessionNonceHeaders/getClientSessionNonceHeaders.d.ts +16 -0
- package/src/lib/client/extension/functions/getClientSessionNonceHeaders/getClientSessionNonceHeaders.js +29 -0
- package/src/lib/client/extension/functions/getSessionKeys/getSessionKeys.d.ts +1 -0
- package/src/lib/client/extension/functions/hasElevatedAccessToken/hasElevatedAccessToken.cjs +5 -9
- package/src/lib/client/extension/functions/hasElevatedAccessToken/hasElevatedAccessToken.d.ts +4 -0
- package/src/lib/client/extension/functions/hasElevatedAccessToken/hasElevatedAccessToken.js +6 -10
- package/src/lib/client/extension/functions/migrateClientSessionKey/migrateClientSessionKey.cjs +51 -0
- package/src/lib/client/extension/functions/migrateClientSessionKey/migrateClientSessionKey.d.ts +1 -0
- package/src/lib/client/extension/functions/migrateClientSessionKey/migrateClientSessionKey.js +47 -0
- package/src/lib/client/extension/hooks/useInitializeSdkClient/getApiHeaders/getApiHeaders.cjs +5 -6
- package/src/lib/client/extension/hooks/useInitializeSdkClient/getApiHeaders/getApiHeaders.js +5 -6
- package/src/lib/client/extension/hooks/useInitializeSdkClient/syncEvents/syncEvents.cjs +12 -0
- package/src/lib/client/extension/hooks/useInitializeSdkClient/syncEvents/syncEvents.js +12 -0
- package/src/lib/client/extension/hooks/useInitializeSdkClient/useInitializeSdkClient.cjs +2 -0
- package/src/lib/client/extension/hooks/useInitializeSdkClient/useInitializeSdkClient.js +2 -0
- package/src/lib/client/extension/index.d.ts +4 -0
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +15 -2
- package/src/lib/components/SendBalanceForm/SendBalanceForm.d.ts +4 -0
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +15 -2
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +25 -3
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +26 -4
- package/src/lib/components/SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.cjs +4 -1
- package/src/lib/components/SendBalancePageLayout/components/TokensBalanceDropdown/TokensBalanceDropdown.js +4 -1
- package/src/lib/components/TransactionCard/SendBalanceTransactionCard.cjs +9 -5
- package/src/lib/components/TransactionCard/SendBalanceTransactionCard.js +9 -5
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +2 -2
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +2 -2
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.cjs +2 -2
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.js +2 -2
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.cjs +2 -2
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.js +2 -2
- package/src/lib/context/DynamicContext/DynamicContext.cjs +0 -3
- package/src/lib/context/DynamicContext/DynamicContext.js +0 -3
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +3 -4
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +3 -4
- package/src/lib/context/DynamicContext/types/DynamicContextProps.d.ts +10 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +0 -2
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +0 -2
- package/src/lib/data/api/api.cjs +1 -1
- package/src/lib/data/api/api.js +1 -1
- package/src/lib/data/api/embeddedWallets/embeddedWallets.cjs +2 -4
- package/src/lib/data/api/embeddedWallets/embeddedWallets.js +2 -4
- package/src/lib/events/deviceRegistration.d.ts +4 -0
- package/src/lib/events/dynamicEvents.cjs +2 -0
- package/src/lib/events/dynamicEvents.d.ts +3 -2
- package/src/lib/events/dynamicEvents.js +2 -0
- package/src/lib/shared/utils/functions/chain/getChainIcon.cjs +1 -0
- package/src/lib/shared/utils/functions/chain/getChainIcon.js +2 -1
- package/src/lib/store/state/dynamicContextProps/defaultDynamicSettings.cjs +2 -0
- package/src/lib/store/state/dynamicContextProps/defaultDynamicSettings.d.ts +3 -3
- package/src/lib/store/state/dynamicContextProps/defaultDynamicSettings.js +2 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/clientSessionKeys/getClientSessionKeys.cjs +0 -88
- package/src/lib/utils/functions/clientSessionKeys/getClientSessionKeys.d.ts +0 -25
- package/src/lib/utils/functions/clientSessionKeys/getClientSessionKeys.js +2 -83
- package/src/lib/utils/functions/compareChains/compareChains.cjs +1 -0
- package/src/lib/utils/functions/compareChains/compareChains.js +1 -0
- package/src/lib/utils/functions/index.d.ts +0 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +0 -2
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +0 -2
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +0 -2
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +0 -2
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs +0 -2
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js +0 -2
- package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.d.ts +2 -2
- package/src/lib/utils/hooks/index.d.ts +0 -1
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +4 -12
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +4 -12
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.cjs +1 -1
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.js +1 -1
- package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.cjs +28 -36
- package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.d.ts +5 -2
- package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.js +29 -37
- package/src/lib/utils/hooks/useNetworkConfigurationsFromProjectSettings/useNetworkConfigurationsFromProjectSettings.cjs +7 -2
- package/src/lib/utils/hooks/useNetworkConfigurationsFromProjectSettings/useNetworkConfigurationsFromProjectSettings.d.ts +2 -1
- package/src/lib/utils/hooks/useNetworkConfigurationsFromProjectSettings/useNetworkConfigurationsFromProjectSettings.js +7 -2
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.cjs +2 -3
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.js +2 -3
- package/src/lib/utils/hooks/useSignInWithPasskey/useSignInWithPasskey.cjs +14 -14
- package/src/lib/utils/hooks/useSignInWithPasskey/useSignInWithPasskey.js +14 -14
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +3 -3
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +3 -3
- package/src/lib/utils/hooks/useStepUpAuthentication/useStepUpAuthentication.cjs +14 -38
- package/src/lib/utils/hooks/useStepUpAuthentication/useStepUpAuthentication.js +14 -38
- package/src/lib/utils/hooks/useStepUpAuthentication/useStepUpAuthentication.types.d.ts +3 -2
- package/src/lib/utils/hooks/useStepUpAuthentication/useStepUpPromptMfa.cjs +4 -1
- package/src/lib/utils/hooks/useStepUpAuthentication/useStepUpPromptMfa.js +4 -1
- package/src/lib/utils/hooks/useStepUpAuthentication/useStepUpPromptReauth.cjs +22 -6
- package/src/lib/utils/hooks/useStepUpAuthentication/useStepUpPromptReauth.js +22 -6
- package/src/lib/utils/hooks/useSyncDeviceRegistrationFlow/useSyncDeviceRegistrationFlow.cjs +5 -1
- package/src/lib/utils/hooks/useSyncDeviceRegistrationFlow/useSyncDeviceRegistrationFlow.js +5 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +0 -2
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +0 -2
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.cjs +1 -1
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.js +1 -1
- package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -2
- package/src/lib/views/EmailVerification/EmailVerification.js +2 -2
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.cjs +2 -2
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.js +2 -2
- package/src/lib/views/StepUpReauthOtpView/StepUpReauthOtpView.cjs +1 -109
- package/src/lib/views/StepUpReauthOtpView/StepUpReauthOtpView.js +1 -109
- package/src/lib/views/StepUpReauthSocialView/StepUpReauthSocialView.cjs +1 -2
- package/src/lib/views/StepUpReauthSocialView/StepUpReauthSocialView.js +1 -2
- package/src/lib/views/StepUpReauthWalletView/StepUpReauthWalletView.cjs +2 -96
- package/src/lib/views/StepUpReauthWalletView/StepUpReauthWalletView.js +2 -96
- package/src/lib/views/WalletList/data.cjs +1 -0
- package/src/lib/views/WalletList/data.d.ts +1 -1
- package/src/lib/views/WalletList/data.js +1 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.cjs +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.d.ts +1 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.cjs +9 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.js +9 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.cjs +2 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.js +2 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/PasskeyCard/PasskeyCard.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/PasskeyCard/PasskeyCard.js +1 -1
- package/src/lib/widgets/DynamicWidget/helpers/helpers.cjs +22 -0
- package/src/lib/widgets/DynamicWidget/helpers/helpers.js +22 -0
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/EmbeddedWalletExportSection/EmbeddedWalletExportSection.cjs +60 -5
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/EmbeddedWalletExportSection/EmbeddedWalletExportSection.js +61 -6
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.cjs +12 -54
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.js +12 -54
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysMfaWidgetView/ManagePasskeysMfaWidgetView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysMfaWidgetView/ManagePasskeysMfaWidgetView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.js +2 -2
- package/src/lib/data/api/externalAuth/externalAuth.cjs +0 -66
- package/src/lib/data/api/externalAuth/externalAuth.js +0 -62
- package/src/lib/utils/functions/clientSessionKeys/constants.cjs +0 -8
- package/src/lib/utils/functions/clientSessionKeys/constants.js +0 -4
- package/src/lib/utils/hooks/useClientSessionKeys/index.d.ts +0 -1
- package/src/lib/utils/hooks/useClientSessionKeys/useClientSessionKeys.cjs +0 -101
- package/src/lib/utils/hooks/useClientSessionKeys/useClientSessionKeys.d.ts +0 -4
- package/src/lib/utils/hooks/useClientSessionKeys/useClientSessionKeys.js +0 -97
|
@@ -135,7 +135,9 @@ const getDisplayErrorMessage = (errors, t, field, decimals) => {
|
|
|
135
135
|
}
|
|
136
136
|
return '';
|
|
137
137
|
};
|
|
138
|
-
const SendBalanceForm = ({ initialValues, onSubmit, decimals = 18, validateAddress = () => true, validateAmount = () => true, currentToken, transaction, tokenBalances, setCurrentToken, isLoading,
|
|
138
|
+
const SendBalanceForm = ({ initialValues, onSubmit, decimals = 18, validateAddress = () => true, validateAmount = () => true, currentToken, transaction, tokenBalances, setCurrentToken, isLoading,
|
|
139
|
+
// Tempo-specific props
|
|
140
|
+
isTempo = false, feeTokenOptions, currentFeeToken, setCurrentFeeToken, }) => {
|
|
139
141
|
const { t } = useTranslation();
|
|
140
142
|
const { showFiat } = useInternalDynamicContext();
|
|
141
143
|
const floatingValueRef = useRef(null);
|
|
@@ -190,7 +192,18 @@ const SendBalanceForm = ({ initialValues, onSubmit, decimals = 18, validateAddre
|
|
|
190
192
|
paddingLeft: `${leftSymbolPadding}px`,
|
|
191
193
|
} }), 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 }), t('dyn_send_transaction.data.symbol_available', {
|
|
192
194
|
symbol: currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol,
|
|
193
|
-
})] }) }),
|
|
195
|
+
})] }) }), isTempo &&
|
|
196
|
+
feeTokenOptions &&
|
|
197
|
+
feeTokenOptions.length > 0 &&
|
|
198
|
+
setCurrentFeeToken && (jsxs("div", { className: 'send-balance-form__fee-token-container', children: [jsx(Typography, { variant: 'body_small', weight: 'regular', color: 'secondary', style: { marginBottom: '8px' }, children: t('dyn_send_transaction.data.fee_token_label') }), jsx("select", { className: 'send-balance-form__fee-token-select', value: (currentFeeToken === null || currentFeeToken === void 0 ? void 0 : currentFeeToken.address) || '', onChange: ({ target: { value } }) => {
|
|
199
|
+
const selected = feeTokenOptions.find((token) => token.address === value);
|
|
200
|
+
if (selected) {
|
|
201
|
+
setCurrentFeeToken(selected);
|
|
202
|
+
}
|
|
203
|
+
}, children: feeTokenOptions.map((token) => {
|
|
204
|
+
var _a;
|
|
205
|
+
return (jsxs("option", { value: token.address, children: [token.symbol, " (", ((_a = token.balance) === null || _a === void 0 ? void 0 : _a.toLocaleString()) || 0, ' ', "available)"] }, token.address));
|
|
206
|
+
}) })] })), 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'] &&
|
|
194
207
|
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') })] }));
|
|
195
208
|
} }));
|
|
196
209
|
};
|
|
@@ -123,7 +123,7 @@ require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
|
123
123
|
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
124
124
|
|
|
125
125
|
const SendBalancePageLayout = ({ error, onClickClose, onClickBack, onSubmit, displayPoweredByDynamicFooter = false, transaction, networkCurrencyDecimals, tokenBalances, currentToken, setCurrentToken, isLoading, isNativeToken, }) => {
|
|
126
|
-
var _a;
|
|
126
|
+
var _a, _b;
|
|
127
127
|
const { t } = reactI18next.useTranslation();
|
|
128
128
|
const { primaryWallet, projectSettings, overrides } = useInternalDynamicContext.useInternalDynamicContext();
|
|
129
129
|
const networkInfo = useNetworkConfigurationsFromProjectSettings.useNetworkConfigurationsFromProjectSettings({
|
|
@@ -132,6 +132,21 @@ const SendBalancePageLayout = ({ error, onClickClose, onClickBack, onSubmit, dis
|
|
|
132
132
|
});
|
|
133
133
|
const walletConnector = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
|
|
134
134
|
const { chain } = useFetchChain.useFetchChain(walletConnector);
|
|
135
|
+
// Tempo-specific: detect Tempo chain and manage fee token state
|
|
136
|
+
const isTempo = ((_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.connectedChain) === 'TEMPO';
|
|
137
|
+
const [currentFeeToken, setCurrentFeeToken] = React.useState(undefined);
|
|
138
|
+
// Initialize fee token to first available token for Tempo
|
|
139
|
+
// Also reset if current token is no longer in the list (stale after refresh)
|
|
140
|
+
React.useEffect(() => {
|
|
141
|
+
if (isTempo && tokenBalances && tokenBalances.length > 0) {
|
|
142
|
+
const currentTokenStillExists = currentFeeToken
|
|
143
|
+
? tokenBalances.some((token) => token.address === currentFeeToken.address)
|
|
144
|
+
: false;
|
|
145
|
+
if (!currentFeeToken || !currentTokenStillExists) {
|
|
146
|
+
setCurrentFeeToken(tokenBalances[0]);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}, [isTempo, tokenBalances, currentFeeToken]);
|
|
135
150
|
const closeButton = onClickClose && (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: onClickClose, "data-testid": 'close-button', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
|
|
136
151
|
const backButton = onClickBack && (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }));
|
|
137
152
|
const { data: balance } = usePromise.usePromise(() => transaction.getBalance(), {
|
|
@@ -191,7 +206,9 @@ const SendBalancePageLayout = ({ error, onClickClose, onClickBack, onSubmit, dis
|
|
|
191
206
|
? transaction.formatNonNativeToken(transaction.nonNativeValue, transaction.nonNativeDecimal)
|
|
192
207
|
: '';
|
|
193
208
|
};
|
|
194
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, trailing: closeButton, alignContent: 'bottom', children: jsxRuntime.jsx("div", { className: 'send-balance-page-layout__header-content', children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_send_transaction.data.send', children: t('dyn_send_transaction.data.send') }) }) }), jsxRuntime.jsxs("div", { className: 'send-balance-page-layout__body', children: [jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}), children: error && (jsxRuntime.jsx("div", { className: 'send-balance-page-layout__error', children: jsxRuntime.jsx(Alert.Alert, { icon: 'error', variant: 'error', children: error }) })) }), jsxRuntime.jsx(SendBalanceForm.SendBalanceForm, { tokenBalances: tokenBalances, setCurrentToken: setCurrentToken, isLoading: isLoading,
|
|
209
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, trailing: closeButton, alignContent: 'bottom', children: jsxRuntime.jsx("div", { className: 'send-balance-page-layout__header-content', children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_send_transaction.data.send', children: t('dyn_send_transaction.data.send') }) }) }), jsxRuntime.jsxs("div", { className: 'send-balance-page-layout__body', children: [jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}), children: error && (jsxRuntime.jsx("div", { className: 'send-balance-page-layout__error', children: jsxRuntime.jsx(Alert.Alert, { icon: 'error', variant: 'error', children: error }) })) }), jsxRuntime.jsx(SendBalanceForm.SendBalanceForm, { tokenBalances: tokenBalances, setCurrentToken: setCurrentToken, isLoading: isLoading,
|
|
210
|
+
// Tempo-specific props
|
|
211
|
+
isTempo: isTempo, feeTokenOptions: isTempo ? tokenBalances : undefined, currentFeeToken: currentFeeToken, setCurrentFeeToken: setCurrentFeeToken, onSubmit: ({ amount, recipient }) => {
|
|
195
212
|
if (isNativeToken) {
|
|
196
213
|
transaction.value = transaction.parse(amount);
|
|
197
214
|
}
|
|
@@ -202,10 +219,15 @@ const SendBalancePageLayout = ({ error, onClickClose, onClickBack, onSubmit, dis
|
|
|
202
219
|
transaction.nonNativeDecimal = currentToken === null || currentToken === void 0 ? void 0 : currentToken.decimals;
|
|
203
220
|
}
|
|
204
221
|
transaction.to = recipient;
|
|
222
|
+
// Tempo-specific: set fee token address and symbol
|
|
223
|
+
if (isTempo && (currentFeeToken === null || currentFeeToken === void 0 ? void 0 : currentFeeToken.address)) {
|
|
224
|
+
transaction.feeTokenAddress = currentFeeToken.address;
|
|
225
|
+
transaction.feeTokenSymbol = currentFeeToken.symbol;
|
|
226
|
+
}
|
|
205
227
|
onSubmit();
|
|
206
228
|
}, initialValues: {
|
|
207
229
|
amount: getAmount(),
|
|
208
|
-
recipient: (
|
|
230
|
+
recipient: (_b = transaction.to) !== null && _b !== void 0 ? _b : '',
|
|
209
231
|
}, decimals: isNativeToken ? networkCurrencyDecimals : currentToken === null || currentToken === void 0 ? void 0 : currentToken.decimals, validateAddress: (value) => {
|
|
210
232
|
if (!value)
|
|
211
233
|
return true;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
-
import { useEffect } from 'react';
|
|
4
|
+
import { useState, useEffect } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
7
7
|
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
@@ -119,7 +119,7 @@ import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
119
119
|
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
120
120
|
|
|
121
121
|
const SendBalancePageLayout = ({ error, onClickClose, onClickBack, onSubmit, displayPoweredByDynamicFooter = false, transaction, networkCurrencyDecimals, tokenBalances, currentToken, setCurrentToken, isLoading, isNativeToken, }) => {
|
|
122
|
-
var _a;
|
|
122
|
+
var _a, _b;
|
|
123
123
|
const { t } = useTranslation();
|
|
124
124
|
const { primaryWallet, projectSettings, overrides } = useInternalDynamicContext();
|
|
125
125
|
const networkInfo = useNetworkConfigurationsFromProjectSettings({
|
|
@@ -128,6 +128,21 @@ const SendBalancePageLayout = ({ error, onClickClose, onClickBack, onSubmit, dis
|
|
|
128
128
|
});
|
|
129
129
|
const walletConnector = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
|
|
130
130
|
const { chain } = useFetchChain(walletConnector);
|
|
131
|
+
// Tempo-specific: detect Tempo chain and manage fee token state
|
|
132
|
+
const isTempo = ((_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.connectedChain) === 'TEMPO';
|
|
133
|
+
const [currentFeeToken, setCurrentFeeToken] = useState(undefined);
|
|
134
|
+
// Initialize fee token to first available token for Tempo
|
|
135
|
+
// Also reset if current token is no longer in the list (stale after refresh)
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
if (isTempo && tokenBalances && tokenBalances.length > 0) {
|
|
138
|
+
const currentTokenStillExists = currentFeeToken
|
|
139
|
+
? tokenBalances.some((token) => token.address === currentFeeToken.address)
|
|
140
|
+
: false;
|
|
141
|
+
if (!currentFeeToken || !currentTokenStillExists) {
|
|
142
|
+
setCurrentFeeToken(tokenBalances[0]);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}, [isTempo, tokenBalances, currentFeeToken]);
|
|
131
146
|
const closeButton = onClickClose && (jsx(IconButton, { type: 'button', onClick: onClickClose, "data-testid": 'close-button', children: jsx(SvgClose, {}) }));
|
|
132
147
|
const backButton = onClickBack && (jsx(IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsx(SvgArrowLeft, {}) }));
|
|
133
148
|
const { data: balance } = usePromise(() => transaction.getBalance(), {
|
|
@@ -187,7 +202,9 @@ const SendBalancePageLayout = ({ error, onClickClose, onClickBack, onSubmit, dis
|
|
|
187
202
|
? transaction.formatNonNativeToken(transaction.nonNativeValue, transaction.nonNativeDecimal)
|
|
188
203
|
: '';
|
|
189
204
|
};
|
|
190
|
-
return (jsxs(Fragment, { children: [jsx(ModalHeader, { leading: backButton, trailing: closeButton, alignContent: 'bottom', children: jsx("div", { className: 'send-balance-page-layout__header-content', children: jsx(Typography, { variant: 'title', color: 'primary', copykey: 'dyn_send_transaction.data.send', children: t('dyn_send_transaction.data.send') }) }) }), jsxs("div", { className: 'send-balance-page-layout__body', children: [jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, {}), children: error && (jsx("div", { className: 'send-balance-page-layout__error', children: jsx(Alert, { icon: 'error', variant: 'error', children: error }) })) }), jsx(SendBalanceForm, { tokenBalances: tokenBalances, setCurrentToken: setCurrentToken, isLoading: isLoading,
|
|
205
|
+
return (jsxs(Fragment, { children: [jsx(ModalHeader, { leading: backButton, trailing: closeButton, alignContent: 'bottom', children: jsx("div", { className: 'send-balance-page-layout__header-content', children: jsx(Typography, { variant: 'title', color: 'primary', copykey: 'dyn_send_transaction.data.send', children: t('dyn_send_transaction.data.send') }) }) }), jsxs("div", { className: 'send-balance-page-layout__body', children: [jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, {}), children: error && (jsx("div", { className: 'send-balance-page-layout__error', children: jsx(Alert, { icon: 'error', variant: 'error', children: error }) })) }), jsx(SendBalanceForm, { tokenBalances: tokenBalances, setCurrentToken: setCurrentToken, isLoading: isLoading,
|
|
206
|
+
// Tempo-specific props
|
|
207
|
+
isTempo: isTempo, feeTokenOptions: isTempo ? tokenBalances : undefined, currentFeeToken: currentFeeToken, setCurrentFeeToken: setCurrentFeeToken, onSubmit: ({ amount, recipient }) => {
|
|
191
208
|
if (isNativeToken) {
|
|
192
209
|
transaction.value = transaction.parse(amount);
|
|
193
210
|
}
|
|
@@ -198,10 +215,15 @@ const SendBalancePageLayout = ({ error, onClickClose, onClickBack, onSubmit, dis
|
|
|
198
215
|
transaction.nonNativeDecimal = currentToken === null || currentToken === void 0 ? void 0 : currentToken.decimals;
|
|
199
216
|
}
|
|
200
217
|
transaction.to = recipient;
|
|
218
|
+
// Tempo-specific: set fee token address and symbol
|
|
219
|
+
if (isTempo && (currentFeeToken === null || currentFeeToken === void 0 ? void 0 : currentFeeToken.address)) {
|
|
220
|
+
transaction.feeTokenAddress = currentFeeToken.address;
|
|
221
|
+
transaction.feeTokenSymbol = currentFeeToken.symbol;
|
|
222
|
+
}
|
|
201
223
|
onSubmit();
|
|
202
224
|
}, initialValues: {
|
|
203
225
|
amount: getAmount(),
|
|
204
|
-
recipient: (
|
|
226
|
+
recipient: (_b = transaction.to) !== null && _b !== void 0 ? _b : '',
|
|
205
227
|
}, decimals: isNativeToken ? networkCurrencyDecimals : currentToken === null || currentToken === void 0 ? void 0 : currentToken.decimals, validateAddress: (value) => {
|
|
206
228
|
if (!value)
|
|
207
229
|
return true;
|
|
@@ -78,6 +78,7 @@ require('../../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
|
78
78
|
require('../../../IconButton/IconButton.cjs');
|
|
79
79
|
require('../../../../utils/hooks/useGetMfaToken/useGetMfaToken.cjs');
|
|
80
80
|
require('../../../MenuList/Dropdown/Dropdown.cjs');
|
|
81
|
+
var Image = require('../../../Image/Image.cjs');
|
|
81
82
|
require('formik');
|
|
82
83
|
require('../../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
|
|
83
84
|
var sendBalances = require('../../../../store/state/sendBalances.cjs');
|
|
@@ -192,7 +193,9 @@ const TokensBalanceDropdown = ({ tokenBalances, currentToken, setCurrentToken, i
|
|
|
192
193
|
if (isLoading) {
|
|
193
194
|
return jsxRuntime.jsx(Skeleton.Skeleton, {});
|
|
194
195
|
}
|
|
195
|
-
const tokenLogo = (token, size) => (token === null || token === void 0 ? void 0 : token.logoURI
|
|
196
|
+
const tokenLogo = (token, size) => (jsxRuntime.jsx(Image.Image, { src: token === null || token === void 0 ? void 0 : token.logoURI, alt: token === null || token === void 0 ? void 0 : token.name, className: 'token-balance-item__icon', dataTestId: 'token-balance-item-icon', fallback:
|
|
197
|
+
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
198
|
+
jsxRuntime.jsx("div", { className: 'token-balance-item__skeleton-icon', "data-testid": 'token-balance-item__skeleton-icon', style: { height: `${size}px`, width: `${size}px` } }) }));
|
|
196
199
|
return (jsxRuntime.jsxs("div", { className: 'tokens-balance-dropdown', ref: anchorRef, onClick: () => setIsDropdownOpen(!isDropdownOpen), "data-testid": 'tokens-balance-dropdown', children: [!isLoading && (jsxRuntime.jsxs("div", { className: 'tokens-balance-dropdown__selected', children: [tokenLogo(currentToken, '20'), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', children: currentToken === null || currentToken === void 0 ? void 0 : currentToken.name }), jsxRuntime.jsx(Icon.Icon, { color: 'text-primary', size: 'small', className: classNames.classNames('evm-network-control__arrow-icon', {
|
|
197
200
|
'evm-network-control__arrow-icon--active': isDropdownOpen,
|
|
198
201
|
}), children: jsxRuntime.jsx(stroke.ReactComponent, {}) })] })), jsxRuntime.jsx(MenuList.MenuList, { className: 'tokens-balance-dropdown__menu_list', isOpen: isDropdownOpen, popperProps: {
|
|
@@ -74,6 +74,7 @@ import '../../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
|
74
74
|
import '../../../IconButton/IconButton.js';
|
|
75
75
|
import '../../../../utils/hooks/useGetMfaToken/useGetMfaToken.js';
|
|
76
76
|
import '../../../MenuList/Dropdown/Dropdown.js';
|
|
77
|
+
import { Image } from '../../../Image/Image.js';
|
|
77
78
|
import 'formik';
|
|
78
79
|
import '../../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.js';
|
|
79
80
|
import { setSendBalanceVariable } from '../../../../store/state/sendBalances.js';
|
|
@@ -188,7 +189,9 @@ const TokensBalanceDropdown = ({ tokenBalances, currentToken, setCurrentToken, i
|
|
|
188
189
|
if (isLoading) {
|
|
189
190
|
return jsx(Skeleton, {});
|
|
190
191
|
}
|
|
191
|
-
const tokenLogo = (token, size) => (token === null || token === void 0 ? void 0 : token.logoURI
|
|
192
|
+
const tokenLogo = (token, size) => (jsx(Image, { src: token === null || token === void 0 ? void 0 : token.logoURI, alt: token === null || token === void 0 ? void 0 : token.name, className: 'token-balance-item__icon', dataTestId: 'token-balance-item-icon', fallback:
|
|
193
|
+
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
194
|
+
jsx("div", { className: 'token-balance-item__skeleton-icon', "data-testid": 'token-balance-item__skeleton-icon', style: { height: `${size}px`, width: `${size}px` } }) }));
|
|
192
195
|
return (jsxs("div", { className: 'tokens-balance-dropdown', ref: anchorRef, onClick: () => setIsDropdownOpen(!isDropdownOpen), "data-testid": 'tokens-balance-dropdown', children: [!isLoading && (jsxs("div", { className: 'tokens-balance-dropdown__selected', children: [tokenLogo(currentToken, '20'), jsx(Typography, { variant: 'body_normal', color: 'primary', children: currentToken === null || currentToken === void 0 ? void 0 : currentToken.name }), jsx(Icon, { color: 'text-primary', size: 'small', className: classNames('evm-network-control__arrow-icon', {
|
|
193
196
|
'evm-network-control__arrow-icon--active': isDropdownOpen,
|
|
194
197
|
}), children: jsx(SvgStroke, {}) })] })), jsx(MenuList, { className: 'tokens-balance-dropdown__menu_list', isOpen: isDropdownOpen, popperProps: {
|
|
@@ -120,7 +120,7 @@ require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
|
120
120
|
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
121
121
|
|
|
122
122
|
const SendBalanceTransactionCard = ({ transaction, currentToken, currencySymbol, valueRounded, transactionValue, isGasSponsored, gasFiatValue, totalGasFiatValue, currency, total, t, onFeeUpdate, }) => {
|
|
123
|
-
var _a, _b;
|
|
123
|
+
var _a, _b, _c;
|
|
124
124
|
const { primaryWallet, projectSettings, overrides } = useInternalDynamicContext.useInternalDynamicContext();
|
|
125
125
|
const networkInfo = useNetworkConfigurationsFromProjectSettings.useNetworkConfigurationsFromProjectSettings({
|
|
126
126
|
evmNetworksOverrides: overrides === null || overrides === void 0 ? void 0 : overrides.evmNetworks,
|
|
@@ -136,15 +136,17 @@ const SendBalanceTransactionCard = ({ transaction, currentToken, currencySymbol,
|
|
|
136
136
|
const isBitcoinTransaction = transaction.chain === 'BTC' ||
|
|
137
137
|
((_b = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _b === void 0 ? void 0 : _b.connectedChain) === 'BTC' ||
|
|
138
138
|
((primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) && walletConnectorCore.isBitcoinConnector(primaryWallet.connector));
|
|
139
|
+
// Check if this is a Tempo transaction (for fee token display)
|
|
140
|
+
const isTempoTransaction = ((_c = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _c === void 0 ? void 0 : _c.connectedChain) === 'TEMPO';
|
|
139
141
|
const bitcoinTransaction = transaction;
|
|
140
142
|
const [feePriority, setFeePriority] = React.useState((bitcoinTransaction === null || bitcoinTransaction === void 0 ? void 0 : bitcoinTransaction.feePriority) || 'medium');
|
|
141
143
|
const handleFeePriorityChange = React.useCallback((newPriority) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
142
|
-
var
|
|
144
|
+
var _d;
|
|
143
145
|
if (!isBitcoinTransaction || feePriority === newPriority) {
|
|
144
146
|
return;
|
|
145
147
|
}
|
|
146
148
|
setFeePriority(newPriority);
|
|
147
|
-
yield ((
|
|
149
|
+
yield ((_d = bitcoinTransaction.updateFeePriority) === null || _d === void 0 ? void 0 : _d.call(bitcoinTransaction, newPriority));
|
|
148
150
|
onFeeUpdate === null || onFeeUpdate === void 0 ? void 0 : onFeeUpdate();
|
|
149
151
|
}), [isBitcoinTransaction, feePriority, bitcoinTransaction, onFeeUpdate]);
|
|
150
152
|
const renderTransferDetails = () => (jsxRuntime.jsx("div", { className: 'transaction-card', children: jsxRuntime.jsx("div", { className: 'transaction-card__assets-container', children: jsxRuntime.jsx("div", { className: 'transaction-card__out', children: jsxRuntime.jsxs("div", { className: 'transaction-card__info-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', children: t('dyn_send_transaction.confirmation.data.transfer.send') }), jsxRuntime.jsxs("div", { className: 'transaction-card__amount-symbol', children: [jsxRuntime.jsxs("div", { className: 'transaction-card__token-info', children: [jsxRuntime.jsxs("div", { className: 'transaction-card__token-row', children: [jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', color: 'error-1', "data-testid": 'transaction-transfer-amount', children: ["-", valueRounded ||
|
|
@@ -154,7 +156,7 @@ const SendBalanceTransactionCard = ({ transaction, currentToken, currencySymbol,
|
|
|
154
156
|
})
|
|
155
157
|
: '')] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', children: currencySymbol })] }), transactionValue && (jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', color: 'error-1', "data-testid": 'transaction-transfer-amount-fiat', children: ["$", utils.getDisplayFiatPrice(Number(transactionValue) || Number(valueRounded) || 0, currentToken)] }))] }), jsxRuntime.jsx("div", { className: 'transaction-card__icon', children: jsxRuntime.jsx("div", { className: 'transaction-card__icon__container', children: jsxRuntime.jsx("img", { src: (currentToken === null || currentToken === void 0 ? void 0 : currentToken.logoURI) ||
|
|
156
158
|
(networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.nativeCurrency.iconUrl), alt: currencySymbol, width: 32, height: 32, className: 'transaction-card__icon__container__main' }) }) })] })] }) }) }) }));
|
|
157
|
-
const renderTransactionDetails = () => (jsxRuntime.jsx("div", { className: 'transaction-card', children: jsxRuntime.jsxs("div", { className: 'transaction-card__details', children: [jsxRuntime.jsxs("div", { className: 'transaction-card__row', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.destination', children: t('dyn_send_transaction.confirmation.data.destination') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-destination', children: shortenWalletAddress.shortenWalletAddress(transaction.to) })] }), !isGasSponsored && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: 'transaction-card__divider' }), jsxRuntime.jsxs("div", { className: 'transaction-card__row', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', "data-testid": 'transaction-network', copykey: 'dyn_send_transaction.confirmation.data.network', children: t('dyn_send_transaction.confirmation.data.network') }), jsxRuntime.jsxs("div", { className: 'transaction-card__network-info', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', children: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.name) ||
|
|
159
|
+
const renderTransactionDetails = () => (jsxRuntime.jsx("div", { className: 'transaction-card', children: jsxRuntime.jsxs("div", { className: 'transaction-card__details', children: [jsxRuntime.jsxs("div", { className: 'transaction-card__row', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.destination', children: t('dyn_send_transaction.confirmation.data.destination') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-destination', children: shortenWalletAddress.shortenWalletAddress(transaction.to) })] }), (!isGasSponsored || isTempoTransaction) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: 'transaction-card__divider' }), jsxRuntime.jsxs("div", { className: 'transaction-card__row', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', "data-testid": 'transaction-network', copykey: 'dyn_send_transaction.confirmation.data.network', children: t('dyn_send_transaction.confirmation.data.network') }), jsxRuntime.jsxs("div", { className: 'transaction-card__network-info', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', children: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.name) ||
|
|
158
160
|
(isBitcoinTransaction ? 'Bitcoin' : 'Ethereum') }), jsxRuntime.jsx("img", { src: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.iconUrls[0]) || (chain === null || chain === void 0 ? void 0 : chain.icon), alt: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.name) ||
|
|
159
161
|
(isBitcoinTransaction ? 'Bitcoin' : 'Network icon'), width: 16, height: 16, className: 'transaction-card__network-icon' })] })] }), isBitcoinTransaction && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: 'transaction-card__divider' }), jsxRuntime.jsxs("div", { className: 'transaction-card__row', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.fee_priority', children: "Fee Priority" }), jsxRuntime.jsxs("div", { className: 'transaction-card__value', style: {
|
|
160
162
|
alignItems: 'center',
|
|
@@ -180,7 +182,9 @@ const SendBalanceTransactionCard = ({ transaction, currentToken, currencySymbol,
|
|
|
180
182
|
pointerEvents: 'none',
|
|
181
183
|
position: 'absolute',
|
|
182
184
|
right: 0,
|
|
183
|
-
}, children: jsxRuntime.jsx(Icon.Icon, { size: 'small', children: jsxRuntime.jsx(chevronDown.ReactComponent, {}) }) })] })] })] })), jsxRuntime.jsx("div", { className: 'transaction-card__divider' }), jsxRuntime.jsxs("div", { className: 'transaction-card__row', children: [jsxRuntime.jsxs("div", { className: 'transaction-card__label-with-tooltip', children: [jsxRuntime.
|
|
185
|
+
}, children: jsxRuntime.jsx(Icon.Icon, { size: 'small', children: jsxRuntime.jsx(chevronDown.ReactComponent, {}) }) })] })] })] })), jsxRuntime.jsx("div", { className: 'transaction-card__divider' }), jsxRuntime.jsxs("div", { className: 'transaction-card__row', children: [jsxRuntime.jsxs("div", { className: 'transaction-card__label-with-tooltip', children: [jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.gas_estimate', children: [t('dyn_send_transaction.confirmation.data.gas_estimate'), isTempoTransaction && transaction.feeTokenSymbol && (jsxRuntime.jsxs("span", { style: { fontWeight: 'normal' }, children: [' ', "(in ", transaction.feeTokenSymbol, ")"] }))] }), jsxRuntime.jsx(Tooltip.Tooltip, { content: isTempoTransaction && transaction.feeTokenSymbol
|
|
186
|
+
? `Network fees paid in ${transaction.feeTokenSymbol}`
|
|
187
|
+
: 'Network fees are paid to process your transaction', className: 'transaction-confirmation', children: jsxRuntime.jsx(Icon.Icon, { size: 'small', className: 'fee-tooltip', children: jsxRuntime.jsx(tooltip.ReactComponent, {}) }) })] }), jsxRuntime.jsx("div", { className: 'transaction-card__value', children: (currentToken === null || currentToken === void 0 ? void 0 : currentToken.price) ? (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-estimated-gas-fee', children: Number(gasFiatValue) <= 0.01
|
|
184
188
|
? '<$0.01'
|
|
185
189
|
: `$${gasFiatValue}` })) : (jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-estimated-gas-fee', children: [transaction.fee.gas
|
|
186
190
|
? transaction.format(transaction.fee.gas, {
|
|
@@ -116,7 +116,7 @@ import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
116
116
|
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
117
117
|
|
|
118
118
|
const SendBalanceTransactionCard = ({ transaction, currentToken, currencySymbol, valueRounded, transactionValue, isGasSponsored, gasFiatValue, totalGasFiatValue, currency, total, t, onFeeUpdate, }) => {
|
|
119
|
-
var _a, _b;
|
|
119
|
+
var _a, _b, _c;
|
|
120
120
|
const { primaryWallet, projectSettings, overrides } = useInternalDynamicContext();
|
|
121
121
|
const networkInfo = useNetworkConfigurationsFromProjectSettings({
|
|
122
122
|
evmNetworksOverrides: overrides === null || overrides === void 0 ? void 0 : overrides.evmNetworks,
|
|
@@ -132,15 +132,17 @@ const SendBalanceTransactionCard = ({ transaction, currentToken, currencySymbol,
|
|
|
132
132
|
const isBitcoinTransaction = transaction.chain === 'BTC' ||
|
|
133
133
|
((_b = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _b === void 0 ? void 0 : _b.connectedChain) === 'BTC' ||
|
|
134
134
|
((primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) && isBitcoinConnector(primaryWallet.connector));
|
|
135
|
+
// Check if this is a Tempo transaction (for fee token display)
|
|
136
|
+
const isTempoTransaction = ((_c = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _c === void 0 ? void 0 : _c.connectedChain) === 'TEMPO';
|
|
135
137
|
const bitcoinTransaction = transaction;
|
|
136
138
|
const [feePriority, setFeePriority] = useState((bitcoinTransaction === null || bitcoinTransaction === void 0 ? void 0 : bitcoinTransaction.feePriority) || 'medium');
|
|
137
139
|
const handleFeePriorityChange = useCallback((newPriority) => __awaiter(void 0, void 0, void 0, function* () {
|
|
138
|
-
var
|
|
140
|
+
var _d;
|
|
139
141
|
if (!isBitcoinTransaction || feePriority === newPriority) {
|
|
140
142
|
return;
|
|
141
143
|
}
|
|
142
144
|
setFeePriority(newPriority);
|
|
143
|
-
yield ((
|
|
145
|
+
yield ((_d = bitcoinTransaction.updateFeePriority) === null || _d === void 0 ? void 0 : _d.call(bitcoinTransaction, newPriority));
|
|
144
146
|
onFeeUpdate === null || onFeeUpdate === void 0 ? void 0 : onFeeUpdate();
|
|
145
147
|
}), [isBitcoinTransaction, feePriority, bitcoinTransaction, onFeeUpdate]);
|
|
146
148
|
const renderTransferDetails = () => (jsx("div", { className: 'transaction-card', children: jsx("div", { className: 'transaction-card__assets-container', children: jsx("div", { className: 'transaction-card__out', children: jsxs("div", { className: 'transaction-card__info-container', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', children: t('dyn_send_transaction.confirmation.data.transfer.send') }), jsxs("div", { className: 'transaction-card__amount-symbol', children: [jsxs("div", { className: 'transaction-card__token-info', children: [jsxs("div", { className: 'transaction-card__token-row', children: [jsxs(Typography, { variant: 'body_normal', color: 'error-1', "data-testid": 'transaction-transfer-amount', children: ["-", valueRounded ||
|
|
@@ -150,7 +152,7 @@ const SendBalanceTransactionCard = ({ transaction, currentToken, currencySymbol,
|
|
|
150
152
|
})
|
|
151
153
|
: '')] }), jsx(Typography, { variant: 'body_normal', color: 'secondary', children: currencySymbol })] }), transactionValue && (jsxs(Typography, { variant: 'body_small', color: 'error-1', "data-testid": 'transaction-transfer-amount-fiat', children: ["$", getDisplayFiatPrice(Number(transactionValue) || Number(valueRounded) || 0, currentToken)] }))] }), jsx("div", { className: 'transaction-card__icon', children: jsx("div", { className: 'transaction-card__icon__container', children: jsx("img", { src: (currentToken === null || currentToken === void 0 ? void 0 : currentToken.logoURI) ||
|
|
152
154
|
(networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.nativeCurrency.iconUrl), alt: currencySymbol, width: 32, height: 32, className: 'transaction-card__icon__container__main' }) }) })] })] }) }) }) }));
|
|
153
|
-
const renderTransactionDetails = () => (jsx("div", { className: 'transaction-card', children: jsxs("div", { className: 'transaction-card__details', children: [jsxs("div", { className: 'transaction-card__row', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.destination', children: t('dyn_send_transaction.confirmation.data.destination') }), jsx(Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-destination', children: shortenWalletAddress(transaction.to) })] }), !isGasSponsored && (jsxs(Fragment, { children: [jsx("div", { className: 'transaction-card__divider' }), jsxs("div", { className: 'transaction-card__row', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', "data-testid": 'transaction-network', copykey: 'dyn_send_transaction.confirmation.data.network', children: t('dyn_send_transaction.confirmation.data.network') }), jsxs("div", { className: 'transaction-card__network-info', children: [jsx(Typography, { variant: 'body_normal', color: 'primary', children: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.name) ||
|
|
155
|
+
const renderTransactionDetails = () => (jsx("div", { className: 'transaction-card', children: jsxs("div", { className: 'transaction-card__details', children: [jsxs("div", { className: 'transaction-card__row', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.destination', children: t('dyn_send_transaction.confirmation.data.destination') }), jsx(Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-destination', children: shortenWalletAddress(transaction.to) })] }), (!isGasSponsored || isTempoTransaction) && (jsxs(Fragment, { children: [jsx("div", { className: 'transaction-card__divider' }), jsxs("div", { className: 'transaction-card__row', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', "data-testid": 'transaction-network', copykey: 'dyn_send_transaction.confirmation.data.network', children: t('dyn_send_transaction.confirmation.data.network') }), jsxs("div", { className: 'transaction-card__network-info', children: [jsx(Typography, { variant: 'body_normal', color: 'primary', children: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.name) ||
|
|
154
156
|
(isBitcoinTransaction ? 'Bitcoin' : 'Ethereum') }), jsx("img", { src: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.iconUrls[0]) || (chain === null || chain === void 0 ? void 0 : chain.icon), alt: (networkInfoEntry === null || networkInfoEntry === void 0 ? void 0 : networkInfoEntry.name) ||
|
|
155
157
|
(isBitcoinTransaction ? 'Bitcoin' : 'Network icon'), width: 16, height: 16, className: 'transaction-card__network-icon' })] })] }), isBitcoinTransaction && (jsxs(Fragment, { children: [jsx("div", { className: 'transaction-card__divider' }), jsxs("div", { className: 'transaction-card__row', children: [jsx(Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.fee_priority', children: "Fee Priority" }), jsxs("div", { className: 'transaction-card__value', style: {
|
|
156
158
|
alignItems: 'center',
|
|
@@ -176,7 +178,9 @@ const SendBalanceTransactionCard = ({ transaction, currentToken, currencySymbol,
|
|
|
176
178
|
pointerEvents: 'none',
|
|
177
179
|
position: 'absolute',
|
|
178
180
|
right: 0,
|
|
179
|
-
}, children: jsx(Icon, { size: 'small', children: jsx(SvgChevronDown, {}) }) })] })] })] })), jsx("div", { className: 'transaction-card__divider' }), jsxs("div", { className: 'transaction-card__row', children: [jsxs("div", { className: 'transaction-card__label-with-tooltip', children: [
|
|
181
|
+
}, children: jsx(Icon, { size: 'small', children: jsx(SvgChevronDown, {}) }) })] })] })] })), jsx("div", { className: 'transaction-card__divider' }), jsxs("div", { className: 'transaction-card__row', children: [jsxs("div", { className: 'transaction-card__label-with-tooltip', children: [jsxs(Typography, { variant: 'body_normal', color: 'secondary', copykey: 'dyn_send_transaction.confirmation.data.gas_estimate', children: [t('dyn_send_transaction.confirmation.data.gas_estimate'), isTempoTransaction && transaction.feeTokenSymbol && (jsxs("span", { style: { fontWeight: 'normal' }, children: [' ', "(in ", transaction.feeTokenSymbol, ")"] }))] }), jsx(Tooltip, { content: isTempoTransaction && transaction.feeTokenSymbol
|
|
182
|
+
? `Network fees paid in ${transaction.feeTokenSymbol}`
|
|
183
|
+
: 'Network fees are paid to process your transaction', className: 'transaction-confirmation', children: jsx(Icon, { size: 'small', className: 'fee-tooltip', children: jsx(SvgTooltip, {}) }) })] }), jsx("div", { className: 'transaction-card__value', children: (currentToken === null || currentToken === void 0 ? void 0 : currentToken.price) ? (jsx(Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-estimated-gas-fee', children: Number(gasFiatValue) <= 0.01
|
|
180
184
|
? '<$0.01'
|
|
181
185
|
: `$${gasFiatValue}` })) : (jsxs(Typography, { variant: 'body_normal', color: 'primary', "data-testid": 'transaction-estimated-gas-fee', children: [transaction.fee.gas
|
|
182
186
|
? transaction.format(transaction.fee.gas, {
|
package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs
CHANGED
|
@@ -133,7 +133,7 @@ const UserProfileSocialAccount = ({ provider, }) => {
|
|
|
133
133
|
(connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.id) === (user === null || user === void 0 ? void 0 : user.lastVerifiedCredentialId);
|
|
134
134
|
const handleSocialAccountButton = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
135
135
|
if (isProviderLinked) {
|
|
136
|
-
if (isStepUpRequired({ scope: sdkApiCore.TokenScope.Credentialunlink })) {
|
|
136
|
+
if (yield isStepUpRequired({ scope: sdkApiCore.TokenScope.Credentialunlink })) {
|
|
137
137
|
try {
|
|
138
138
|
yield promptStepUpAuth({
|
|
139
139
|
requestedScopes: [sdkApiCore.TokenScope.Credentialunlink],
|
|
@@ -146,7 +146,7 @@ const UserProfileSocialAccount = ({ provider, }) => {
|
|
|
146
146
|
unlinkSocialAccount(provider);
|
|
147
147
|
}
|
|
148
148
|
else {
|
|
149
|
-
if (isStepUpRequired({ scope: sdkApiCore.TokenScope.Credentiallink })) {
|
|
149
|
+
if (yield isStepUpRequired({ scope: sdkApiCore.TokenScope.Credentiallink })) {
|
|
150
150
|
try {
|
|
151
151
|
yield promptStepUpAuth({
|
|
152
152
|
requestedScopes: [sdkApiCore.TokenScope.Credentiallink],
|
package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js
CHANGED
|
@@ -129,7 +129,7 @@ const UserProfileSocialAccount = ({ provider, }) => {
|
|
|
129
129
|
(connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.id) === (user === null || user === void 0 ? void 0 : user.lastVerifiedCredentialId);
|
|
130
130
|
const handleSocialAccountButton = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
131
131
|
if (isProviderLinked) {
|
|
132
|
-
if (isStepUpRequired({ scope: TokenScope.Credentialunlink })) {
|
|
132
|
+
if (yield isStepUpRequired({ scope: TokenScope.Credentialunlink })) {
|
|
133
133
|
try {
|
|
134
134
|
yield promptStepUpAuth({
|
|
135
135
|
requestedScopes: [TokenScope.Credentialunlink],
|
|
@@ -142,7 +142,7 @@ const UserProfileSocialAccount = ({ provider, }) => {
|
|
|
142
142
|
unlinkSocialAccount(provider);
|
|
143
143
|
}
|
|
144
144
|
else {
|
|
145
|
-
if (isStepUpRequired({ scope: TokenScope.Credentiallink })) {
|
|
145
|
+
if (yield isStepUpRequired({ scope: TokenScope.Credentiallink })) {
|
|
146
146
|
try {
|
|
147
147
|
yield promptStepUpAuth({
|
|
148
148
|
requestedScopes: [TokenScope.Credentiallink],
|
|
@@ -28,10 +28,10 @@ require('@dynamic-labs/locale');
|
|
|
28
28
|
require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
29
29
|
require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
30
30
|
require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
31
|
-
var getClientSessionKeys = require('../../../utils/functions/clientSessionKeys/getClientSessionKeys.cjs');
|
|
32
31
|
require('../../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.cjs');
|
|
33
32
|
require('../../../events/dynamicEvents.cjs');
|
|
34
33
|
var storeTokenAndUser = require('../../../client/extension/storeTokenAndUser/storeTokenAndUser.cjs');
|
|
34
|
+
var generateSessionKeys = require('../../../client/extension/functions/generateSessionKeys/generateSessionKeys.cjs');
|
|
35
35
|
|
|
36
36
|
const createEmailHandler = (environmentId, { shouldRegisterSessionKeysOnSignin, generateSessionKey, }) => (email$1, captchaToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
37
37
|
const createEmailVerificationResponse = yield email.createEmailVerification({
|
|
@@ -57,7 +57,7 @@ const createEmailHandler = (environmentId, { shouldRegisterSessionKeysOnSignin,
|
|
|
57
57
|
const keypair = yield generateSessionKey();
|
|
58
58
|
sessionPublicKey = keypair.publicKey;
|
|
59
59
|
}
|
|
60
|
-
yield
|
|
60
|
+
yield generateSessionKeys.generateSessionKeys();
|
|
61
61
|
const response = yield email.signInWithEmailVerification({
|
|
62
62
|
captchaToken,
|
|
63
63
|
environmentId,
|
|
@@ -24,10 +24,10 @@ import '@dynamic-labs/locale';
|
|
|
24
24
|
import '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
25
25
|
import '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
26
26
|
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
27
|
-
import { generateClientSessionKeys } from '../../../utils/functions/clientSessionKeys/getClientSessionKeys.js';
|
|
28
27
|
import '../../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
|
|
29
28
|
import '../../../events/dynamicEvents.js';
|
|
30
29
|
import { storeTokenAndUser } from '../../../client/extension/storeTokenAndUser/storeTokenAndUser.js';
|
|
30
|
+
import { generateSessionKeys } from '../../../client/extension/functions/generateSessionKeys/generateSessionKeys.js';
|
|
31
31
|
|
|
32
32
|
const createEmailHandler = (environmentId, { shouldRegisterSessionKeysOnSignin, generateSessionKey, }) => (email, captchaToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
33
|
const createEmailVerificationResponse = yield createEmailVerification({
|
|
@@ -53,7 +53,7 @@ const createEmailHandler = (environmentId, { shouldRegisterSessionKeysOnSignin,
|
|
|
53
53
|
const keypair = yield generateSessionKey();
|
|
54
54
|
sessionPublicKey = keypair.publicKey;
|
|
55
55
|
}
|
|
56
|
-
yield
|
|
56
|
+
yield generateSessionKeys();
|
|
57
57
|
const response = yield signInWithEmailVerification({
|
|
58
58
|
captchaToken,
|
|
59
59
|
environmentId,
|
|
@@ -27,10 +27,10 @@ var sms = require('../../../data/api/sms/sms.cjs');
|
|
|
27
27
|
require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
28
28
|
require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
29
29
|
require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
30
|
-
var getClientSessionKeys = require('../../../utils/functions/clientSessionKeys/getClientSessionKeys.cjs');
|
|
31
30
|
require('../../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.cjs');
|
|
32
31
|
require('../../../events/dynamicEvents.cjs');
|
|
33
32
|
var storeTokenAndUser = require('../../../client/extension/storeTokenAndUser/storeTokenAndUser.cjs');
|
|
33
|
+
var generateSessionKeys = require('../../../client/extension/functions/generateSessionKeys/generateSessionKeys.cjs');
|
|
34
34
|
|
|
35
35
|
const createSmsHandler = (environmentId, { shouldRegisterSessionKeysOnSignin, generateSessionKey, }) => (phone, captchaToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
36
36
|
const { verificationUUID } = yield sms.createSmsVerification({
|
|
@@ -48,7 +48,7 @@ const createSmsHandler = (environmentId, { shouldRegisterSessionKeysOnSignin, ge
|
|
|
48
48
|
const keypair = yield generateSessionKey();
|
|
49
49
|
sessionPublicKey = keypair.publicKey;
|
|
50
50
|
}
|
|
51
|
-
yield
|
|
51
|
+
yield generateSessionKeys.generateSessionKeys();
|
|
52
52
|
const response = yield sms.signInWithSmsVerification({
|
|
53
53
|
captchaToken,
|
|
54
54
|
environmentId,
|
|
@@ -23,10 +23,10 @@ import { createSmsVerification, signInWithSmsVerification } from '../../../data/
|
|
|
23
23
|
import '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
24
24
|
import '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
25
25
|
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
26
|
-
import { generateClientSessionKeys } from '../../../utils/functions/clientSessionKeys/getClientSessionKeys.js';
|
|
27
26
|
import '../../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
|
|
28
27
|
import '../../../events/dynamicEvents.js';
|
|
29
28
|
import { storeTokenAndUser } from '../../../client/extension/storeTokenAndUser/storeTokenAndUser.js';
|
|
29
|
+
import { generateSessionKeys } from '../../../client/extension/functions/generateSessionKeys/generateSessionKeys.js';
|
|
30
30
|
|
|
31
31
|
const createSmsHandler = (environmentId, { shouldRegisterSessionKeysOnSignin, generateSessionKey, }) => (phone, captchaToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
32
|
const { verificationUUID } = yield createSmsVerification({
|
|
@@ -44,7 +44,7 @@ const createSmsHandler = (environmentId, { shouldRegisterSessionKeysOnSignin, ge
|
|
|
44
44
|
const keypair = yield generateSessionKey();
|
|
45
45
|
sessionPublicKey = keypair.publicKey;
|
|
46
46
|
}
|
|
47
|
-
yield
|
|
47
|
+
yield generateSessionKeys();
|
|
48
48
|
const response = yield signInWithSmsVerification({
|
|
49
49
|
captchaToken,
|
|
50
50
|
environmentId,
|
|
@@ -88,7 +88,6 @@ require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
|
88
88
|
var useEndUserWarning = require('../../utils/hooks/useEndUserWarning/useEndUserWarning.cjs');
|
|
89
89
|
var useDeviceFingerprint = require('../../utils/hooks/useDeviceFingerprint/useDeviceFingerprint.cjs');
|
|
90
90
|
var useAggregateWalletEvents = require('../../utils/hooks/useAggregateWalletEvents/useAggregateWalletEvents.cjs');
|
|
91
|
-
var useClientSessionKeys = require('../../utils/hooks/useClientSessionKeys/useClientSessionKeys.cjs');
|
|
92
91
|
require('../../utils/hooks/useGetMfaToken/useGetMfaToken.cjs');
|
|
93
92
|
var OnrampContext = require('../OnrampContext/OnrampContext.cjs');
|
|
94
93
|
require('../../../index.cjs');
|
|
@@ -238,8 +237,6 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
238
237
|
}
|
|
239
238
|
// Calculates and stores a device fingerprint
|
|
240
239
|
useDeviceFingerprint.useDeviceFingerprint();
|
|
241
|
-
// Generate client session keys
|
|
242
|
-
useClientSessionKeys.useClientSessionKeys();
|
|
243
240
|
const isAuthenticated = Boolean(user);
|
|
244
241
|
const [qrcodeUri, setQrcodeUri] = React.useState('');
|
|
245
242
|
const [desktopUri, setDesktopUri] = React.useState('');
|
|
@@ -84,7 +84,6 @@ import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
84
84
|
import { useEndUserWarning } from '../../utils/hooks/useEndUserWarning/useEndUserWarning.js';
|
|
85
85
|
import { useDeviceFingerprint } from '../../utils/hooks/useDeviceFingerprint/useDeviceFingerprint.js';
|
|
86
86
|
import { useAggregateWalletEvents } from '../../utils/hooks/useAggregateWalletEvents/useAggregateWalletEvents.js';
|
|
87
|
-
import { useClientSessionKeys } from '../../utils/hooks/useClientSessionKeys/useClientSessionKeys.js';
|
|
88
87
|
import '../../utils/hooks/useGetMfaToken/useGetMfaToken.js';
|
|
89
88
|
import { OnrampContextProvider } from '../OnrampContext/OnrampContext.js';
|
|
90
89
|
import '../../../index.js';
|
|
@@ -234,8 +233,6 @@ const InnerDynamicContextProvider = (props) => {
|
|
|
234
233
|
}
|
|
235
234
|
// Calculates and stores a device fingerprint
|
|
236
235
|
useDeviceFingerprint();
|
|
237
|
-
// Generate client session keys
|
|
238
|
-
useClientSessionKeys();
|
|
239
236
|
const isAuthenticated = Boolean(user);
|
|
240
237
|
const [qrcodeUri, setQrcodeUri] = useState('');
|
|
241
238
|
const [desktopUri, setDesktopUri] = useState('');
|
|
@@ -35,7 +35,6 @@ require('../../../../config/ApiEndpoint.cjs');
|
|
|
35
35
|
require('../../../../events/dynamicEvents.cjs');
|
|
36
36
|
require('@dynamic-labs/locale');
|
|
37
37
|
require('../../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
38
|
-
var getClientSessionKeys = require('../../../../utils/functions/clientSessionKeys/getClientSessionKeys.cjs');
|
|
39
38
|
require('../../../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.cjs');
|
|
40
39
|
require('../../../AccessDeniedContext/AccessDeniedContext.cjs');
|
|
41
40
|
require('../../../AccountExistsContext/AccountExistsContext.cjs');
|
|
@@ -136,7 +135,6 @@ const useHandleLogout = (params) => {
|
|
|
136
135
|
utils.StorageService.removeItem(localStorage.EXCHANGE_PICKER_SEARCH_KEY);
|
|
137
136
|
utils.StorageService.removeItem(localStorage.PHANTOM_SIGNATURE_STATE);
|
|
138
137
|
utils.StorageService.removeItem(localStorage.DELEGATION_STATE);
|
|
139
|
-
getClientSessionKeys.clearClientSessionKeys();
|
|
140
138
|
authMode.setAuthMode(p.initialAuthenticationMode);
|
|
141
139
|
p.setShowAuthFlow(false, {
|
|
142
140
|
emitCancelAuth: false,
|
|
@@ -162,9 +160,10 @@ const useHandleLogout = (params) => {
|
|
|
162
160
|
}), [logoutReactSdk]);
|
|
163
161
|
/** Trigger a logout when the SDK failed to load data from storage */
|
|
164
162
|
React.useEffect(() => {
|
|
165
|
-
|
|
163
|
+
const handler = () => logout();
|
|
164
|
+
utils.StorageService.events.on('parseFailure', handler);
|
|
166
165
|
return () => {
|
|
167
|
-
utils.StorageService.events.off('parseFailure',
|
|
166
|
+
utils.StorageService.events.off('parseFailure', handler);
|
|
168
167
|
};
|
|
169
168
|
}, [logout]);
|
|
170
169
|
/** Allows triggering a logout from anywhere in the code */
|
|
@@ -31,7 +31,6 @@ import '../../../../config/ApiEndpoint.js';
|
|
|
31
31
|
import '../../../../events/dynamicEvents.js';
|
|
32
32
|
import '@dynamic-labs/locale';
|
|
33
33
|
import '../../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
34
|
-
import { clearClientSessionKeys } from '../../../../utils/functions/clientSessionKeys/getClientSessionKeys.js';
|
|
35
34
|
import '../../../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
|
|
36
35
|
import '../../../AccessDeniedContext/AccessDeniedContext.js';
|
|
37
36
|
import '../../../AccountExistsContext/AccountExistsContext.js';
|
|
@@ -132,7 +131,6 @@ const useHandleLogout = (params) => {
|
|
|
132
131
|
StorageService.removeItem(EXCHANGE_PICKER_SEARCH_KEY);
|
|
133
132
|
StorageService.removeItem(PHANTOM_SIGNATURE_STATE);
|
|
134
133
|
StorageService.removeItem(DELEGATION_STATE);
|
|
135
|
-
clearClientSessionKeys();
|
|
136
134
|
setAuthMode(p.initialAuthenticationMode);
|
|
137
135
|
p.setShowAuthFlow(false, {
|
|
138
136
|
emitCancelAuth: false,
|
|
@@ -158,9 +156,10 @@ const useHandleLogout = (params) => {
|
|
|
158
156
|
}), [logoutReactSdk]);
|
|
159
157
|
/** Trigger a logout when the SDK failed to load data from storage */
|
|
160
158
|
useEffect(() => {
|
|
161
|
-
|
|
159
|
+
const handler = () => logout$1();
|
|
160
|
+
StorageService.events.on('parseFailure', handler);
|
|
162
161
|
return () => {
|
|
163
|
-
StorageService.events.off('parseFailure',
|
|
162
|
+
StorageService.events.off('parseFailure', handler);
|
|
164
163
|
};
|
|
165
164
|
}, [logout$1]);
|
|
166
165
|
/** Allows triggering a logout from anywhere in the code */
|
|
@@ -105,6 +105,16 @@ export interface DynamicContextProps {
|
|
|
105
105
|
* Hidden tokens will not count towards the user's total balance.
|
|
106
106
|
*/
|
|
107
107
|
tokensFilter?: (tokens: TokenBalance[]) => TokenBalance[];
|
|
108
|
+
/**
|
|
109
|
+
* Controls the device registration modal behavior.
|
|
110
|
+
* When set to { enabled: false }, the SDK will not automatically show the
|
|
111
|
+
* device registration modal. Customers can build their own headless experience
|
|
112
|
+
* using `isDeviceRegistrationRequired` from @dynamic-labs-sdk/client.
|
|
113
|
+
* @default { enabled: true }
|
|
114
|
+
*/
|
|
115
|
+
deviceRegistrationModal?: {
|
|
116
|
+
enabled: boolean;
|
|
117
|
+
};
|
|
108
118
|
transactionConfirmation?: TransactionConfirmationSettings;
|
|
109
119
|
/**
|
|
110
120
|
* If true, the Metamask SDK will be used to connect to the wallet.
|