1.0.1 • Published 2 years ago

@astroport/math v1.0.1

Weekly downloads
-
License
GPL-3
Repository
github
Last release
2 years 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

2 years ago

1.0.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.5.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago