@dynamic-labs/sdk-react-core 1.0.0-alpha.5 → 1.0.0-alpha.6

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.
@@ -60,6 +60,7 @@ import '../../components/UserProfile/parts/UserProfileField/components/VerifiedE
60
60
  import '@dynamic-labs/types';
61
61
  import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
62
62
  import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
63
+ import { useFetchChain } from '../../widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.js';
63
64
  import { useFetchCurrency } from '../../widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js';
64
65
  import { useTransactionGas } from './hooks/useTransactionGas/useTransactionGas.js';
65
66
  import { useTransactionTotal } from './hooks/useTransactionTotal/useTransactionTotal.js';
@@ -134,8 +135,10 @@ const TransactionConfirmationView = ({ transaction, mutation, onError, onSuccess
134
135
  isTransactionToAddressLoading ||
135
136
  isTransactionFromAddressLoading ||
136
137
  isGasSponsoredLoading;
137
- const ChainIconComponent = getChainIcon(primaryWallet.chain);
138
- const chainIcon = (jsx(Icon, { size: 'small', children: jsx(ChainIconComponent, {}) }));
138
+ const [chain] = useFetchChain(primaryWallet.connector);
139
+ const chainName = (chain === null || chain === void 0 ? void 0 : chain.name) || primaryWallet.chain;
140
+ const ChainIconComponent = getChainIcon(chainName);
141
+ const chainIcon = (jsx(Icon, { size: 'small', children: (chain === null || chain === void 0 ? void 0 : chain.icon) ? (jsx("img", { src: chain.icon, alt: `${chain.name} icon` })) : (jsx(ChainIconComponent, {})) }));
139
142
  const errorMessage = transactionError && transactionErrorMessage(transactionError);
140
143
  const missingFunds = useMemo(() => {
141
144
  if (balance === undefined || total === undefined)
@@ -159,7 +162,7 @@ const TransactionConfirmationView = ({ transaction, mutation, onError, onSuccess
159
162
  amountLeft,
160
163
  currencySymbol,
161
164
  }) }));
162
- }, [currencySymbol, hasInsufficientFunds, missingFunds, transactionError]);
165
+ }, [currencySymbol, hasInsufficientFunds, missingFunds, t, transactionError]);
163
166
  return (jsxs(TransactionConfirmationPageLayout, { onClickBack: onClickBack, onClickClose: onClickClose, title: title, appOrigin: appOrigin, appName: appName, appLogoUrl: appLogoUrl, isLoading: isLoading, onClickSend: () => send(), displayPoweredByDynamicFooter: displayPoweredByDynamicFooter, disableSendButton: isTransactionLoading || hasInsufficientFunds, error: errorMessage, alert: alert, children: [jsx(TransactionRow, { label: t('dyn_send_transaction.confirmation.data.from'), isLoading: isTransactionFromAddressLoading, title: transactionFromAddress, children: shortenWalletAddress(transactionFromAddress, 4, 4) }), jsx(TransactionRow, { label: t('dyn_send_transaction.confirmation.data.to'), isLoading: isTransactionToAddressLoading, title: transactionToAddress, children: transactionToAddress &&
164
167
  shortenWalletAddress(transactionToAddress, 4, 4) }), jsx(TransactionRow, { label: t('dyn_send_transaction.confirmation.data.amount'), isLoading: isTransactionValueLoading, isEmpty: !transactionValue, title: transactionValue ? formatBigNumber(transactionValue) : undefined, suffix: currencySymbol, icon: chainIcon, dataTestId: 'transaction-amount', children: transactionValue ? formatBigNumber(transactionValue, 10) : 0 }), !isGasSponsored && (jsxs(Fragment, { children: [jsx(TransactionRow, { label: isGasEstimated
165
168
  ? t('dyn_send_transaction.confirmation.data.gas_estimate')