Skip to content

Commit

Permalink
fix: quantity of native tokens in hex (#960)
Browse files Browse the repository at this point in the history
  • Loading branch information
VmMad authored Jan 18, 2024
1 parent a3ed15c commit 5e3f847
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ const AssetsTable: React.FC<AssetsTableProps> = ({ networkId, outputs, setTokenC
) {
for (const token of (output as CommonOutput).nativeTokens ?? []) {
const existingToken = theTokens.find((t) => t.id === token.id);
// Convert to BigInt again in case the amount is hex
const amount = BigInt(token.amount);
if (existingToken) {
existingToken.amount += token.amount;
existingToken.amount += amount;
} else {
theTokens.push({ id: token.id, amount: token.amount });
theTokens.push({ id: token.id, amount });
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ const TokenInfoSection: React.FC<TokenInfoSectionProps> = ({ tokenId, tokenSchem

const simpleTokenScheme = tokenScheme as SimpleTokenScheme;

const maximumSupply = formatNumberWithCommas(simpleTokenScheme.maximumSupply);
const mintedTokens = formatNumberWithCommas(simpleTokenScheme.mintedTokens);
const meltedTokens = formatNumberWithCommas(simpleTokenScheme.meltedTokens);
const maximumSupply = formatNumberWithCommas(BigInt(simpleTokenScheme.maximumSupply));
const mintedTokens = formatNumberWithCommas(BigInt(simpleTokenScheme.mintedTokens));
const meltedTokens = formatNumberWithCommas(BigInt(simpleTokenScheme.meltedTokens));

return (
<div className="token-info">
Expand Down

0 comments on commit 5e3f847

Please sign in to comment.