A safe and easy way to deal with amounts of Solana Tokens.
npm i @m2-labs/token-amount
import { TokenAmount } from '@m2-labs/token-amount';
const oneDollar = new TokenAmount(1, 'USDC');
const anotherDollar = TokenAmount.fromSubunits(1000000, 'USDC')
const twoDollars = oneDollar.plus(anotherDollar)
This project is maintained and funded by M2 Labs, a Web3 product development studio.