1.0.1 • Published 5 months ago

@astroport/math v1.0.1

Weekly downloads
-
License
GPL-3
Repository
github
Last release
5 months ago

Astroport Math

NPM version Build npm-typescriptLicense]github-license-url

A collection of math functions extracted from Astroport smart contracts to be used with WASM in TypeScript/NodeJS.

Generate WASM

make build

Run tests

make run-tests

Usage

import { xyk_swap } from '@astroport/math';

const swap = JSON.parse(xyk_swap(
  "1000000",
  "0",
  JSON.stringify(["1000000000", "1000000000000"]),
  "0.003"
));
// {
//   "return_amount": "999999",
//   "spread_amount": "1",
//   "commission_amount": "32"
// }
1.0.1

5 months ago

1.0.0

6 months ago

0.5.0

9 months ago

0.4.0

9 months ago

0.5.1

9 months ago

0.3.0

11 months ago

0.2.0

12 months ago

0.1.0

12 months ago