@solocker/safe-bn
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

@solocker/safe-bn

To install

bun install @solocker/safe-bn

Usage

By default safe-bn support 3 decimal places to increase add the optional decimal param

Perform BigNumber mathematical operations

const target = 3124.456;
const safeBnRepresentation = safeBN(target);
// reverse to unSafe after performing mathematical operations
const unSafeRepresentation = unSafe(safeRepresentation);

Convert to Number from hex or BN

/// This unwrap safeBN, note don't pass unSafe output, convert first to save before this
const backToTarget = unSafeToNumber(safeRepresentation);

Package Sidebar

Install

npm i @solocker/safe-bn

Weekly Downloads

1

Version

0.0.2

License

ISC

Unpacked Size

124 kB

Total Files

10

Last publish

Collaborators

  • lyonkvalid