@polkassembly/util
Version:
Set of utility functions for Polkassembly and more.
26 lines (25 loc) • 961 B
TypeScript
import BN from 'bn.js';
import { FailingThresholdResult, PassingThresholdResult, VoteThreshold } from './types';
interface ThresholdBase {
totalIssuance: BN;
threshold: VoteThreshold;
}
interface getPassingThresholdParamsType extends ThresholdBase {
nays: BN;
naysWithoutConviction: BN;
}
interface getFailingThresholdParamsType extends ThresholdBase {
ayes: BN;
ayesWithoutConviction: BN;
}
/**
* @name getFailingThreshold
* @summary Calculates amount of nays needed for a referendum to fail
**/
export declare function getFailingThreshold({ ayes, ayesWithoutConviction, totalIssuance, threshold }: getFailingThresholdParamsType): FailingThresholdResult;
/**
* @name getPassingThreshold
* @summary Calculates amount of ayes needed for a referendum to pass
**/
export declare function getPassingThreshold({ nays, naysWithoutConviction, totalIssuance, threshold }: getPassingThresholdParamsType): PassingThresholdResult;
export {};