From a6144fbb72c01efca50b25d6bac50e36d4970dfa Mon Sep 17 00:00:00 2001 From: Jonathan Tzeng Date: Thu, 18 Jun 2026 16:07:40 -0700 Subject: [PATCH] Fix EVM token swap pending metadata showing 0 For Thorchain and Maya EVM token swaps (e.g. USDT to ETH) the spend target nativeAmount was set to 0, so the recorded transaction amount and its fiat and percentage metadata displayed 0 while the swap was pending. Use the actual token amount for the spend target; the broadcast contract call is unchanged because the currency engine forces zero parent-currency value for token contract calls. --- CHANGELOG.md | 2 ++ src/swap/defi/thorchain/thorchainCommon.ts | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c28d796..b88669da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- fixed: (Thorchain/Maya) Show the correct from-amount in pending swap transaction metadata for EVM token swaps (e.g. USDT to ETH) instead of 0. + ## 2.48.0 (2026-06-16) - added: (Rango) Sonic support diff --git a/src/swap/defi/thorchain/thorchainCommon.ts b/src/swap/defi/thorchain/thorchainCommon.ts index 414f5aa8..8dbf59b5 100644 --- a/src/swap/defi/thorchain/thorchainCommon.ts +++ b/src/swap/defi/thorchain/thorchainCommon.ts @@ -699,7 +699,6 @@ export function makeThorchainBasedPlugin( } = calcResponse let { memo } = calcResponse - let ethNativeAmount = fromNativeAmount let publicAddress = thorAddress const preTxs: EdgeTransaction[] = [] let memoType: EdgeMemo['type'] @@ -744,9 +743,6 @@ export function makeThorchainBasedPlugin( ) assetAddress = sourceTokenContractAddress - // Token transactions send no ETH (or other EVM mainnet coin) - ethNativeAmount = '0' - const approvalTxs = await createEvmApprovalEdgeTransactions({ request, approvalAmount: nativeAmount, @@ -902,7 +898,13 @@ export function makeThorchainBasedPlugin( ], spendTargets: [ { - nativeAmount: ethNativeAmount, + // The amount spent from the wallet, always denominated in the + // from-asset. For EVM token swaps this is the token amount even though + // the router contract call sends zero parent-currency value (the + // currency engine forces value to 0 for token contract calls). Using + // the token amount here keeps the pending transaction metadata + // (amount, fiat, percent) correct instead of showing 0. + nativeAmount: fromNativeAmount, publicAddress } ],