Skip to content

Commit

Permalink
Merge branch 'plugin-chainbase' of https://github.com/chainbase-labs/…
Browse files Browse the repository at this point in the history
…eliza-dev into plugin-chainbase
lxcong committed Jan 21, 2025
2 parents 078acd7 + 51d8d15 commit 0db2f56
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/plugin-chainbase/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TokenWithBalance } from "./types";

export function formatTokenBalance(token: TokenWithBalance) {
const balanceDecimal = parseInt(token.balance, 16);
const balanceDecimal = BigInt(`0x${token.balance}`);
const amount = token.decimals
? balanceDecimal / Math.pow(10, token.decimals)
: balanceDecimal;
? Number(balanceDecimal) / Math.pow(10, token.decimals)
: Number(balanceDecimal);

const formattedAmount =
amount >= 1

0 comments on commit 0db2f56

Please sign in to comment.