From 205e4cc8485c5bb9f4ce1783d4a712283cba5b68 Mon Sep 17 00:00:00 2001 From: Keith Date: Tue, 2 Apr 2024 21:47:44 +0900 Subject: [PATCH] fix: fix digest info of rgbpp tx --- .../TransactionRGBPPDigestTransferAsset.tsx | 1 + src/utils/transfer.ts | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/TransactionItem/TransactionRGBPPDigestModal/TransactionRGBPPDigestTransferAsset.tsx b/src/components/TransactionItem/TransactionRGBPPDigestModal/TransactionRGBPPDigestTransferAsset.tsx index bf99eaa5c..3994a4284 100644 --- a/src/components/TransactionItem/TransactionRGBPPDigestModal/TransactionRGBPPDigestTransferAsset.tsx +++ b/src/components/TransactionItem/TransactionRGBPPDigestModal/TransactionRGBPPDigestTransferAsset.tsx @@ -24,6 +24,7 @@ export const TransactionRGBPPDigestTransferAsset = ({ transfer }: { transfer: Li `${t('udt.unknown_token')} #${transfer.udtInfo.typeHash.substring(transfer.udtInfo.typeHash.length - 4)}` break case 'xudt': { + name = transfer.udtInfo?.displayName || 'xUDT' break } case 'omiga_inscription': { diff --git a/src/utils/transfer.ts b/src/utils/transfer.ts index b74fca2e8..321fab6b8 100644 --- a/src/utils/transfer.ts +++ b/src/utils/transfer.ts @@ -130,10 +130,10 @@ export const getTransfer = (transfer: LiteTransfer.Transfer): TransferRecord => } } const decimal = +transfer.udtInfo.decimal - let item = decimal ? parseUDTAmount(transfer.udtInfo.amount, decimal) : transfer.udtInfo.amount + let amount = decimal ? parseUDTAmount(transfer.udtInfo.amount, decimal) : transfer.udtInfo.amount const diffStatus = getDiffStatus(+transfer.udtInfo.amount) if (diffStatus === 'positive') { - item = `+${item}` + amount = `+${amount}` } return { label: transfer.udtInfo.symbol || 'Unknown', @@ -141,8 +141,8 @@ export const getTransfer = (transfer: LiteTransfer.Transfer): TransferRecord => category: transfer.cellType, capacity: transfer.capacity, asset: { - amount: transfer.udtInfo.amount, - item, + amount, + item: transfer.udtInfo.symbol || 'Unknown', diffStatus, }, }