From f8ab8e6a873aa2d6dd56ae95f3e22fea420a219f Mon Sep 17 00:00:00 2001 From: Zishan Mohd Date: Thu, 28 Aug 2025 19:57:22 +0530 Subject: [PATCH 1/8] fix: black screen on IOS --- src/components/Global/SoundPlayer.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/Global/SoundPlayer.tsx b/src/components/Global/SoundPlayer.tsx index 865492738..139586da6 100644 --- a/src/components/Global/SoundPlayer.tsx +++ b/src/components/Global/SoundPlayer.tsx @@ -21,12 +21,9 @@ export const SoundPlayer = ({ sound }: SoundPlayerProps) => { const { deviceType } = useDeviceType() - // Early return for iOS devices - completely disable sound - if (deviceType === DeviceType.IOS) { - return null - } - useEffect(() => { + if (!deviceType || deviceType === DeviceType.IOS) return + const audioSrc = soundMap[sound] if (!audioSrc) return @@ -98,7 +95,7 @@ export const SoundPlayer = ({ sound }: SoundPlayerProps) => { } audioRef.current = null } - }, [sound]) + }, [sound, deviceType]) return null } From 5ef888447673c28ad965d405994e603d6c1f3666 Mon Sep 17 00:00:00 2001 From: Zishan Mohd Date: Thu, 28 Aug 2025 20:04:30 +0530 Subject: [PATCH 2/8] fix: sucess screen showed without paying - add money flow --- src/components/Global/DaimoPayButton/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Global/DaimoPayButton/index.tsx b/src/components/Global/DaimoPayButton/index.tsx index 358b6cc33..6c5da90cc 100644 --- a/src/components/Global/DaimoPayButton/index.tsx +++ b/src/components/Global/DaimoPayButton/index.tsx @@ -108,6 +108,7 @@ export const DaimoPayButton = ({ return ( Date: Thu, 28 Aug 2025 21:39:18 +0530 Subject: [PATCH 3/8] fix currency and double $ in txn history --- src/components/TransactionDetails/TransactionCard.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/TransactionDetails/TransactionCard.tsx b/src/components/TransactionDetails/TransactionCard.tsx index 1b706178b..efeb06e3f 100644 --- a/src/components/TransactionDetails/TransactionCard.tsx +++ b/src/components/TransactionDetails/TransactionCard.tsx @@ -109,6 +109,10 @@ const TransactionCard: React.FC = ({ arsSign = '+' } finalDisplayAmount = `${arsSign}${getDisplayCurrencySymbol('ARS')}${formatNumberForDisplay(transaction.currency.amount, { maxDecimals: defaultDisplayDecimals })}` + } + // keep currency as $ because we will always receive in USDC + else if (transaction.extraDataForDrawer?.originalType === EHistoryEntryType.DEPOSIT) { + finalDisplayAmount = `+$${transaction.amount}` } else { const isStableCoin = transaction.tokenSymbol && STABLE_COINS.includes(transaction.tokenSymbol) const displaySymbol = From 98593e5c3360cc148a70196a605997be72345a1d Mon Sep 17 00:00:00 2001 From: Zishan Mohd Date: Thu, 28 Aug 2025 23:06:55 +0530 Subject: [PATCH 4/8] fix: x-chan token size and add API to get missing token icons --- src/components/Global/DisplayIcon.tsx | 2 +- .../TransactionDetailsReceipt.tsx | 92 +++++++++++++------ .../transactionTransformer.ts | 2 + 3 files changed, 69 insertions(+), 27 deletions(-) diff --git a/src/components/Global/DisplayIcon.tsx b/src/components/Global/DisplayIcon.tsx index 32e9835c0..06907222c 100644 --- a/src/components/Global/DisplayIcon.tsx +++ b/src/components/Global/DisplayIcon.tsx @@ -37,7 +37,7 @@ const DisplayIcon: React.FC = ({ // Fallback to AvatarWithBadge return (
- +
) } diff --git a/src/components/TransactionDetails/TransactionDetailsReceipt.tsx b/src/components/TransactionDetails/TransactionDetailsReceipt.tsx index 3f9f0ccbf..9bd5850c8 100644 --- a/src/components/TransactionDetails/TransactionDetailsReceipt.tsx +++ b/src/components/TransactionDetails/TransactionDetailsReceipt.tsx @@ -55,6 +55,8 @@ export const TransactionDetailsReceipt = ({ const { fetchBalance } = useWallet() const [showBankDetails, setShowBankDetails] = useState(false) const [showCancelLinkModal, setShowCancelLinkModal] = useState(isModalOpen) + const [tokenData, setTokenData] = useState<{ symbol: string; icon: string } | null>(null) + const [isTokenDataLoading, setIsTokenDataLoading] = useState(true) useEffect(() => { setIsModalOpen?.(showCancelLinkModal) @@ -229,6 +231,40 @@ export const TransactionDetailsReceipt = ({ } } + useEffect(() => { + const getTokenDetails = async () => { + if (transaction.tokenDisplayDetails?.tokenIconUrl && transaction.tokenDisplayDetails.tokenSymbol) { + setTokenData({ + symbol: transaction.tokenDisplayDetails.tokenSymbol, + icon: transaction.tokenDisplayDetails.tokenIconUrl, + }) + setIsTokenDataLoading(false) + return + } + + try { + const res = await fetch( + `https://api.coingecko.com/api/v3/coins/${transaction.tokenDisplayDetails?.chainName}/contract/${transaction.tokenAddress}` + ) + const tokenDetails = await res.json() + setTokenData({ + symbol: tokenDetails.symbol, + icon: tokenDetails.image.large, + }) + } catch (e) { + console.error(e) + setTokenData({ + symbol: '', + icon: '', + }) + } finally { + setIsTokenDataLoading(false) + } + } + + getTokenDetails() + }, []) + return (
{/* show qr code at the top if applicable */} @@ -282,33 +318,37 @@ export const TransactionDetailsReceipt = ({ -
- {/* Main token icon */} - - {/* Smaller chain icon, absolutely positioned */} - {transaction.tokenDisplayDetails.chainIconUrl && ( -
- -
- )} + isTokenDataLoading ? ( +
+ ) : ( +
+
+ {/* Main token icon */} + + {/* Smaller chain icon, absolutely positioned */} + {transaction.tokenDisplayDetails.chainIconUrl && ( +
+ +
+ )} +
+ + {tokenData?.symbol.toUpperCase()} on{' '} + {transaction.tokenDisplayDetails.chainName} +
- - {transaction.tokenDisplayDetails.tokenSymbol} on{' '} - {transaction.tokenDisplayDetails.chainName} - -
+ ) } hideBottomBorder={shouldHideBorder('tokenAndNetwork')} /> diff --git a/src/components/TransactionDetails/transactionTransformer.ts b/src/components/TransactionDetails/transactionTransformer.ts index dbd4cd21c..42c47197e 100644 --- a/src/components/TransactionDetails/transactionTransformer.ts +++ b/src/components/TransactionDetails/transactionTransformer.ts @@ -59,6 +59,7 @@ export interface TransactionDetails { cancelledDate?: string | Date txHash?: string explorerUrl?: string + tokenAddress?: string extraDataForDrawer?: { addressExplorerUrl?: string originalType: EHistoryEntryType @@ -416,6 +417,7 @@ export function mapTransactionDataForDrawer(entry: HistoryEntry): MappedTransact txHash: entry.txHash, explorerUrl: explorerUrlWithTx, tokenDisplayDetails, + tokenAddress: entry.tokenAddress, extraDataForDrawer: { addressExplorerUrl, originalType: entry.type as EHistoryEntryType, From 3d556681f7fc8e9e9677dd7fe01f51e4d0cd161d Mon Sep 17 00:00:00 2001 From: Zishan Mohd Date: Thu, 28 Aug 2025 23:49:03 +0530 Subject: [PATCH 5/8] fix: req fulfilment --- src/components/Common/ActionListDaimoPayButton.tsx | 6 ++++-- src/hooks/usePaymentInitiator.ts | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/Common/ActionListDaimoPayButton.tsx b/src/components/Common/ActionListDaimoPayButton.tsx index dffd1aff6..39e2bff86 100644 --- a/src/components/Common/ActionListDaimoPayButton.tsx +++ b/src/components/Common/ActionListDaimoPayButton.tsx @@ -8,6 +8,7 @@ import { useSearchParams } from 'next/navigation' import { InitiatePaymentPayload, usePaymentInitiator } from '@/hooks/usePaymentInitiator' import DaimoPayButton from '../Global/DaimoPayButton' import { ACTION_METHODS } from '@/constants/actionlist.consts' +import { useWallet } from '@/hooks/wallet/useWallet' const ActionListDaimoPayButton = () => { const dispatch = useAppDispatch() @@ -20,6 +21,7 @@ const ActionListDaimoPayButton = () => { price: currencyPrice, } = useCurrency(searchParams.get('currency')) const requestId = searchParams.get('id') + const { address: peanutWalletAddress } = useWallet() const { isProcessing, initiateDaimoPayment, completeDaimoPayment } = usePaymentInitiator() @@ -97,8 +99,8 @@ const ActionListDaimoPayButton = () => { const result = await completeDaimoPayment({ chargeDetails: chargeDetails, txHash: daimoPaymentResponse.txHash as string, - sourceChainId: daimoPaymentResponse.payment.source.chainId, - payerAddress: daimoPaymentResponse.payment.source.payerAddress, + destinationchainId: daimoPaymentResponse.payment.destination.chainId, + payerAddress: peanutWalletAddress ?? daimoPaymentResponse.payment.source.payerAddress, }) if (result.status === 'Success') { diff --git a/src/hooks/usePaymentInitiator.ts b/src/hooks/usePaymentInitiator.ts index 2f888e157..b869b2087 100644 --- a/src/hooks/usePaymentInitiator.ts +++ b/src/hooks/usePaymentInitiator.ts @@ -769,20 +769,20 @@ export const usePaymentInitiator = () => { const completeDaimoPayment = useCallback( async ({ chargeDetails, - sourceChainId, + destinationchainId, txHash, payerAddress, }: { chargeDetails: TRequestChargeResponse txHash: string - sourceChainId: number + destinationchainId: number payerAddress: string }) => { try { setLoadingStep('Updating Payment Status') const payment = await chargesApi.createPayment({ chargeId: chargeDetails.uuid, - chainId: sourceChainId.toString(), + chainId: destinationchainId.toString(), hash: txHash, tokenAddress: chargeDetails.tokenAddress, payerAddress, From e3d12d0678e55001eea92350c9d80a27eb78cc29 Mon Sep 17 00:00:00 2001 From: Zishan Mohd Date: Fri, 29 Aug 2025 00:06:44 +0530 Subject: [PATCH 6/8] add default value to tokenData --- .../TransactionDetailsReceipt.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/TransactionDetails/TransactionDetailsReceipt.tsx b/src/components/TransactionDetails/TransactionDetailsReceipt.tsx index 9bd5850c8..aceea1858 100644 --- a/src/components/TransactionDetails/TransactionDetailsReceipt.tsx +++ b/src/components/TransactionDetails/TransactionDetailsReceipt.tsx @@ -55,7 +55,10 @@ export const TransactionDetailsReceipt = ({ const { fetchBalance } = useWallet() const [showBankDetails, setShowBankDetails] = useState(false) const [showCancelLinkModal, setShowCancelLinkModal] = useState(isModalOpen) - const [tokenData, setTokenData] = useState<{ symbol: string; icon: string } | null>(null) + const [tokenData, setTokenData] = useState<{ symbol: string; icon: string }>({ + symbol: '', + icon: '', + }) const [isTokenDataLoading, setIsTokenDataLoading] = useState(true) useEffect(() => { @@ -325,9 +328,9 @@ export const TransactionDetailsReceipt = ({
{/* Main token icon */} {/* Smaller chain icon, absolutely positioned */} @@ -344,7 +347,7 @@ export const TransactionDetailsReceipt = ({ )}
- {tokenData?.symbol.toUpperCase()} on{' '} + {tokenData.symbol.toUpperCase()} on{' '} {transaction.tokenDisplayDetails.chainName}
From 7b625426536283655c2b09297971b4f7e7de8974 Mon Sep 17 00:00:00 2001 From: Zishan Mohd Date: Fri, 29 Aug 2025 00:09:00 +0530 Subject: [PATCH 7/8] fix: move useeffect above transaction null check --- .../TransactionDetailsReceipt.tsx | 73 ++++++++++--------- 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/src/components/TransactionDetails/TransactionDetailsReceipt.tsx b/src/components/TransactionDetails/TransactionDetailsReceipt.tsx index aceea1858..ca1a36f3c 100644 --- a/src/components/TransactionDetails/TransactionDetailsReceipt.tsx +++ b/src/components/TransactionDetails/TransactionDetailsReceipt.tsx @@ -179,6 +179,45 @@ export const TransactionDetailsReceipt = ({ return false }, [transaction, isPendingSentLink, isPendingRequester, isPendingRequestee]) + useEffect(() => { + const getTokenDetails = async () => { + if (!transaction) { + setIsTokenDataLoading(false) + return + } + + if (transaction.tokenDisplayDetails?.tokenIconUrl && transaction.tokenDisplayDetails.tokenSymbol) { + setTokenData({ + symbol: transaction.tokenDisplayDetails.tokenSymbol, + icon: transaction.tokenDisplayDetails.tokenIconUrl, + }) + setIsTokenDataLoading(false) + return + } + + try { + const res = await fetch( + `https://api.coingecko.com/api/v3/coins/${transaction.tokenDisplayDetails?.chainName}/contract/${transaction.tokenAddress}` + ) + const tokenDetails = await res.json() + setTokenData({ + symbol: tokenDetails.symbol, + icon: tokenDetails.image.large, + }) + } catch (e) { + console.error(e) + setTokenData({ + symbol: '', + icon: '', + }) + } finally { + setIsTokenDataLoading(false) + } + } + + getTokenDetails() + }, []) + if (!transaction) return null // format data for display @@ -234,40 +273,6 @@ export const TransactionDetailsReceipt = ({ } } - useEffect(() => { - const getTokenDetails = async () => { - if (transaction.tokenDisplayDetails?.tokenIconUrl && transaction.tokenDisplayDetails.tokenSymbol) { - setTokenData({ - symbol: transaction.tokenDisplayDetails.tokenSymbol, - icon: transaction.tokenDisplayDetails.tokenIconUrl, - }) - setIsTokenDataLoading(false) - return - } - - try { - const res = await fetch( - `https://api.coingecko.com/api/v3/coins/${transaction.tokenDisplayDetails?.chainName}/contract/${transaction.tokenAddress}` - ) - const tokenDetails = await res.json() - setTokenData({ - symbol: tokenDetails.symbol, - icon: tokenDetails.image.large, - }) - } catch (e) { - console.error(e) - setTokenData({ - symbol: '', - icon: '', - }) - } finally { - setIsTokenDataLoading(false) - } - } - - getTokenDetails() - }, []) - return (
{/* show qr code at the top if applicable */} From 6a96e39597c661c36f89f54343e3ca300728582d Mon Sep 17 00:00:00 2001 From: Zishan Mohd Date: Fri, 29 Aug 2025 00:12:06 +0530 Subject: [PATCH 8/8] format amount --- src/components/TransactionDetails/TransactionCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TransactionDetails/TransactionCard.tsx b/src/components/TransactionDetails/TransactionCard.tsx index efeb06e3f..29694e2bc 100644 --- a/src/components/TransactionDetails/TransactionCard.tsx +++ b/src/components/TransactionDetails/TransactionCard.tsx @@ -112,7 +112,7 @@ const TransactionCard: React.FC = ({ } // keep currency as $ because we will always receive in USDC else if (transaction.extraDataForDrawer?.originalType === EHistoryEntryType.DEPOSIT) { - finalDisplayAmount = `+$${transaction.amount}` + finalDisplayAmount = `+$${formatNumberForDisplay(Math.abs(amount).toString(), { maxDecimals: defaultDisplayDecimals })}` } else { const isStableCoin = transaction.tokenSymbol && STABLE_COINS.includes(transaction.tokenSymbol) const displaySymbol =