# token-math

> Library to do ERC-20 arithmetic.

Latest version **1.0.0** (published 2021-11-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install token-math
pnpm add token-math
yarn add token-math
bun add token-math
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-11-28 |
| First published | 2021-11-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 152.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | ethanburrell |

## Links

- npm: https://www.npmjs.com/package/token-math
- Repository: https://github.com/ethanburrell/token-math
- Issues: https://github.com/ethanburrell/token-math/issues
- npm.io page: https://npm.io/package/token-math

## Dependencies (1)

- [bignumber.js](https://npm.io/package/bignumber.js.md) ^9.0.1

## Recent versions

- 1.0.0 (latest) — 2021-11-28

## README

# token-math

Package to do ERC-20 arithmetic.

---

This package uses two classes to describe a token and a number of token. A `Token` takes in an `address`, `symbol`, and number of `decimals`. A `Quantity` allows arithmitic to be done on it.
To create a Quantity from a token `const quantity = token.createQuanity(1, true)` to create `1.00` of the token.

---
_Source: https://npm.io/package/token-math · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
