fix: prevent double symbol display on swap tx broadcast/status views
All checks were successful
check / check (push) Successful in 22s
All checks were successful
check / check (push) Successful in 22s
For Uniswap swaps, the decoded Amount value includes the token symbol (e.g. '2.0000 USDT'). The tx status view then appended 'ETH' because pendingTxDetails.token remained 'ETH' (router address is not a token). Fix: - Add rawValue (numeric-only) to uniswap decoder's Amount detail - Extract Token In address from decoded details in approval.js to set the correct token/tokenSymbol on pendingTxDetails for swaps - The existing d.rawValue || d.value pattern now picks up the clean numeric value, and symbol comes from tokenSymbol
This commit is contained in:
@@ -445,12 +445,19 @@ function decode(data, toAddress) {
|
||||
const maxUint160 = BigInt(
|
||||
"0xffffffffffffffffffffffffffffffffffffffff",
|
||||
);
|
||||
const rawAmount =
|
||||
inputAmount >= maxUint160
|
||||
? "Unlimited"
|
||||
: formatAmount(inputAmount, inInfo.decimals);
|
||||
const amountStr =
|
||||
inputAmount >= maxUint160
|
||||
? "Unlimited"
|
||||
: formatAmount(inputAmount, inInfo.decimals) +
|
||||
(inSymbol ? " " + inSymbol : "");
|
||||
details.push({ label: "Amount", value: amountStr });
|
||||
: rawAmount + (inSymbol ? " " + inSymbol : "");
|
||||
details.push({
|
||||
label: "Amount",
|
||||
value: amountStr,
|
||||
rawValue: rawAmount,
|
||||
});
|
||||
}
|
||||
|
||||
if (outSymbol) {
|
||||
|
||||
Reference in New Issue
Block a user