@polkassembly/util
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

@polkassembly/util

A set of utility functions used in Polkassembly.

Usage

Installation -

yarn add @polkssembly/util

Functions can be imported directly from the package, e.g.

import { getPassingThreshold } from '@polkassembly/util';

Utility functions

  • getPassingThreshold: Get the amount of Aye needed for a referendum to pass.
  • newtonRaphson: This is a fork of scijs/newton-raphson-method that uses bn.js instances instead of plain javascript numbers. It has been simplified and requires to pass the function and its derivative as argument.
  • solveQuadraticEquation: Get the roots of a polynomial function of degree 2 (a*x^2 + b*x + c) where the coeffiscients a, b and c are BN from bn.js.

Package Sidebar

Install

npm i @polkassembly/util

Weekly Downloads

24

Version

0.2.0

License

Apache-2.0

Unpacked Size

48.9 kB

Total Files

19

Last publish

Collaborators

  • tbaut