diff --git a/src/navigation/bitpay-id/utils/bitpay-id-utils.ts b/src/navigation/bitpay-id/utils/bitpay-id-utils.ts index c7421d2fb..d6beec140 100644 --- a/src/navigation/bitpay-id/utils/bitpay-id-utils.ts +++ b/src/navigation/bitpay-id/utils/bitpay-id-utils.ts @@ -12,6 +12,15 @@ export function getCoinAndChainFromCurrencyCode(currencyCode: string): { .split('_') .map(item => item.toLowerCase()); if (suffix) { + // Special handling for usdc.e and usdc + if (coin.toLowerCase() === 'usdc' && chainSuffixMap[suffix] === 'matic') { + return {coin: 'usdc.e', chain: chainSuffixMap[suffix]}; + } else if ( + coin.toLowerCase() === 'usdcn' && + chainSuffixMap[suffix] === 'matic' + ) { + return {coin: 'usdc', chain: chainSuffixMap[suffix]}; + } return {coin, chain: chainSuffixMap[suffix]}; } if (SUPPORTED_COINS.includes(coin)) { @@ -36,9 +45,12 @@ export function getCurrencyCodeFromCoinAndChain( ); if (suffix && (coinIsAnotherChain || chain.toLowerCase() !== 'eth')) { // Special handling for usdc.e and usdc - if (coin.toLowerCase() === 'usdc.e') { + if (coin.toLowerCase() === 'usdc.e' && chain.toLowerCase() === 'matic') { return 'USDC_m'; - } else if (coin.toLowerCase() === 'usdc') { + } else if ( + coin.toLowerCase() === 'usdc' && + chain.toLowerCase() === 'matic' + ) { return 'USDCn_m'; } return `${coin.toUpperCase()}_${suffix}`; diff --git a/src/navigation/wallet/screens/send/confirm/PayProConfirm.tsx b/src/navigation/wallet/screens/send/confirm/PayProConfirm.tsx index 1b183d2da..1ba1be36e 100644 --- a/src/navigation/wallet/screens/send/confirm/PayProConfirm.tsx +++ b/src/navigation/wallet/screens/send/confirm/PayProConfirm.tsx @@ -26,7 +26,10 @@ import {sleep} from '../../../../../utils/helper-methods'; import {startOnGoingProcessModal} from '../../../../../store/app/app.effects'; import {dismissOnGoingProcessModal} from '../../../../../store/app/app.actions'; import {BuildPayProWalletSelectorList} from '../../../../../store/wallet/utils/wallet'; -import {GetFeeUnits} from '../../../../../store/wallet/utils/currency'; +import { + GetFeeUnits, + IsERCToken, +} from '../../../../../store/wallet/utils/currency'; import { InfoDescription, InfoHeader, @@ -429,15 +432,21 @@ const PayProConfirm = () => { ) : null} ) : null} - { - dispatch(showConfirmAmountInfoSheet('total')); - }} - /> + {wallet ? ( + { + dispatch(showConfirmAmountInfoSheet('total')); + }} + /> + ) : null} ) : null} @@ -475,7 +484,6 @@ const PayProConfirm = () => { walletId: wallet!.id, key, }); - }} /> diff --git a/src/store/wallet/effects/send/send.ts b/src/store/wallet/effects/send/send.ts index a10c5805c..943ae1b2b 100644 --- a/src/store/wallet/effects/send/send.ts +++ b/src/store/wallet/effects/send/send.ts @@ -461,7 +461,10 @@ export const buildTxDetails = const selectedTransactionCurrency = invoice?.buyerProvidedInfo!.selectedTransactionCurrency || - wallet.currencyAbbreviation.toUpperCase(); + getCurrencyCodeFromCoinAndChain( + wallet.currencyAbbreviation, + wallet.chain, + ); const isOffChain = !proposal; if (invoice && selectedTransactionCurrency) {