From 2b88849d1c99cc8084980192d6cdae0ae28f7d39 Mon Sep 17 00:00:00 2001 From: Lyka Labrada Date: Wed, 1 Nov 2023 16:43:21 +0800 Subject: [PATCH 1/2] fix(ui-ux): fix displayed amount in transaction list --- src/shared/transactionDataHelper.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/shared/transactionDataHelper.ts b/src/shared/transactionDataHelper.ts index 1f42a6f5..f5ee20ae 100644 --- a/src/shared/transactionDataHelper.ts +++ b/src/shared/transactionDataHelper.ts @@ -18,17 +18,6 @@ import { getTimeAgo } from "./durationHelper"; * @returns formatted tx data */ export const transformTransactionData = (tx: RawTransactionI): TransactionI => { - // TODO: Revisit the amount/value format once actual tx data is available - const amountIndex = tx.decoded_input?.parameters?.findIndex( - (p) => p.name === "amount" - ); - let dfiAmount = "0"; - if (amountIndex && amountIndex > -1) { - dfiAmount = formatEther( - BigInt((tx.decoded_input?.parameters[amountIndex].value as string) ?? "0") - ); - } - const fromHash = tx.from.hash ?? BURN_ADDRESS_HASH; const toHash = tx.to?.hash ?? tx.created_contract?.hash ?? BURN_ADDRESS_HASH; const isFromContract = tx.from.is_contract; @@ -53,7 +42,7 @@ export const transformTransactionData = (tx: RawTransactionI): TransactionI => { transactionType, type: tx.type, hash: tx.hash, - amount: dfiAmount, + amount: formatEther(BigInt(tx.value ?? "0")), symbol: DFI_TOKEN_SYMBOL, // TODO: Revisit tx symbol from: fromHash, to: toHash, From 32ae44585c64ba54e76358fc41b35edc4bdf88c3 Mon Sep 17 00:00:00 2001 From: Lyka Labrada Date: Wed, 1 Nov 2023 16:44:59 +0800 Subject: [PATCH 2/2] remove resolved todos --- src/pages/block/[id].tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/block/[id].tsx b/src/pages/block/[id].tsx index 7bfe1f4d..2ebf5389 100644 --- a/src/pages/block/[id].tsx +++ b/src/pages/block/[id].tsx @@ -153,14 +153,14 @@ export default function Block({ GWEI_DECIMAL ).toString()} decimalScale={9} - suffix=" Gwei" // TODO: Confirm if this is Gwei, DFI or ETH + suffix=" Gwei" />