diff --git a/javascript/solana.js/src/mint.ts b/javascript/solana.js/src/mint.ts index a52c924..c03a338 100644 --- a/javascript/solana.js/src/mint.ts +++ b/javascript/solana.js/src/mint.ts @@ -42,7 +42,8 @@ export class Mint { toTokenAmount(amount: number): bigint { const big = new Big(amount); const tokenAmount = big.mul(new Big(10).pow(this.mint.decimals)); - return BigInt(tokenAmount.toString()); + // We need to fix tokenAmount to 0 decimal places because the amount in base units must be an integer. + return BigInt(tokenAmount.toFixed(0)); } toTokenAmountBN(amount: number): BN {