Skip to content

An arbitrary-precision Solana token amount library for Typescript

Notifications You must be signed in to change notification settings

m2-labs/token-amount

Repository files navigation

Token Amount

A safe and easy way to deal with amounts of Solana Tokens.

Installation

npm i @m2-labs/token-amount

Usage

import { TokenAmount } from '@m2-labs/token-amount';

const oneDollar = new TokenAmount(1, 'USDC');
const anotherDollar = TokenAmount.fromSubunits(1000000, 'USDC')

const twoDollars = oneDollar.plus(anotherDollar)

Brought to you by M2 Labs

M2 Labs

This project is maintained and funded by M2 Labs, a Web3 product development studio.

About

An arbitrary-precision Solana token amount library for Typescript

Resources

Stars

Watchers

Forks

Packages

No packages published