From 4bbbdd8bc17fe57c04c008e398cdcaaacaedbc18 Mon Sep 17 00:00:00 2001 From: tiendn Date: Fri, 17 Mar 2023 15:17:25 +0700 Subject: [PATCH] fix: update Create tag token --- utils/evm.ts | 9 +++++++-- views/transactions/TransactionRowContent.tsx | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/utils/evm.ts b/utils/evm.ts index 289986da..aae0a06d 100644 --- a/utils/evm.ts +++ b/utils/evm.ts @@ -22,21 +22,26 @@ export const evmConvertTokenTransferToTransactionRow = ( ): TransactionRowProps[] => { const rows: TransactionRowProps[] = [] for (let item of items) { + const isCreate = item.fromAddress === ZERO_ADDRESS && item.toAddress === ZERO_ADDRESS const isMint = item.fromAddress === ZERO_ADDRESS const isBurn = item.toAddress === ZERO_ADDRESS - const labelStatus = (isMint && 'Mint') || (isBurn && 'Burn') + const labelStatus = (isCreate && 'Create') || (isMint && 'Mint') || (isBurn && 'Burn') const isNft = isERC721(item.tokenType) + const value = isNft ? '1' : formatUnits(item.amount || '0', item.decimals) + rows.push({ style: 'inject', blockNumber: blockHeight, updatedAt: blockTime, - value: isNft ? '1' : formatUnits(item.amount || '0', item.decimals), + value, valueCurrency: item.tokenSymbol?.toUpperCase(), hash: hash, status, from: item.fromAddress, + fromName: item.fromAddressName, to: item.toAddress, + toName: item.toAddressName, labelStatus, type: 'MsgEthereumTx' }) diff --git a/views/transactions/TransactionRowContent.tsx b/views/transactions/TransactionRowContent.tsx index a7115a7f..d646c412 100644 --- a/views/transactions/TransactionRowContent.tsx +++ b/views/transactions/TransactionRowContent.tsx @@ -100,6 +100,7 @@ export default function TransactionRowContent({ )} + {(fromName || toName) &&
} {(to || contractAddress) && ( <>