Skip to content

Commit

Permalink
chore: fix sudt change type
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyouxin committed Oct 13, 2023
1 parent b2f17d4 commit 8a5da19
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const getTransferItemTag = (transfer: State.LiteTransfer) => {
return `NFT-${mNftInfo?.className ?? 'Unknown'}`
}
if (cellType === 'udt') {
return udtInfo?.displayName || `Uknown Asset #${udtInfo?.typeHash.substring(udtInfo.typeHash.length - 4)}`
return udtInfo?.symbol || `Uknown Asset #${udtInfo?.typeHash.substring(udtInfo.typeHash.length - 4)}`
}
return 'CKB'
}
Expand Down Expand Up @@ -63,12 +63,13 @@ export const TransactionCompLite: FC<{ isCellbase: boolean }> = ({ isCellbase })
}

const TransferAmount: FC<{ transfer: State.LiteTransfer }> = ({ transfer }) => {
const isUdt = transfer.cellType === 'udt'
const isNft = transfer.cellType === 'm_nft_token'

const transferCapacity = new BigNumber(transfer.capacity)
const transferAmount = new BigNumber(transfer.udtInfo?.amount ?? 0)
const isIncome = transferCapacity.isPositive()
const isIncome = isUdt ? transferAmount.isPositive() : transferCapacity.isPositive()
const decimalPanelType = isIncome ? 'income' : 'payment'
const isUdt = transfer.cellType === 'udt'
const isNft = transfer.cellType === 'm_nft_token'

const amountChange = localeNumberString(shannonToCkb(transferAmount))
const capacityChange = localeNumberString(shannonToCkb(transferCapacity))
Expand Down

0 comments on commit 8a5da19

Please sign in to comment.