import { Codec } from '@polkadot/types/types'; import { Fixed18 } from './fixed-18'; /** * @name calcCommunalBonded * @description bonded token balance belong to the liqiud token holders */ export declare const calcCommunalBonded: (totalBonded: Fixed18, nextEraClaimedUnbonded: Fixed18) => Fixed18; /** * @name calcCommunalTotal * @description total bonded token balance (includ bonded, free(unbonded), unbonding) */ export declare const calcCommunalTotal: (communalBonded: Fixed18, communalFree: Fixed18, unbondingToFree: Fixed18) => Fixed18; /** * @name calcCommunalBondedRatio * @param {Fixed18} communalBonded - bonded token balance belone to the liqiud token holders * @param {Fixed18} commuanlTotal - total Bonded token balance (includ Bonded, free(Unbonded), unbonding) */ export declare const calcCommunalBondedRatio: (communalBonded: Fixed18, commuanlTotal: Fixed18) => Fixed18; /** * @name calcLiquidExchangeRate * @description calculate liquid exhchange rate * @param {Fixed18} liquidTokenIssuance - liquid token issuance * @param {Fixed18} commuanlTotal - total brnded token balance (includ bonded, free(unbonded), unbonding) * @param {Fixed18} defaultExchangeRate - default exchange rate */ export declare const calcLiquidExchangeRate: (liquidTokenIssuance: Fixed18, commuanlTotal: Fixed18, defaultExchangeRate: Fixed18) => Fixed18; /** * @name calcClaimFeeRatio * @description calculate claim fee ratio * @param {Fixed18} maxClaimFee - max claim fee * @param {number} targetEra - target era * @param {number} bondingDuration - bonding duration era */ export declare const calcClaimFeeRatio: (targetEra: number, currentEra: number, maxClaimFee: Fixed18, bondingDuration: number) => Fixed18; /** * @name calcClaimFee * @description calculate claim fee * @param {Fixed18} amount - claim amount * @param {Fixed18} maxClaimFee - max claim fee * @param {number} targetEra - target era * @param {number} bondingDuration - bonding duration era */ export declare const calcClaimFee: (amount: Fixed18, targetEra: number, currentEra: number, maxClaimFee: Fixed18, bondingDuration: number) => Fixed18; interface StakingPoolParams { totalBonded: Fixed18 | Codec; communalFree: Fixed18 | Codec; unbondingToFree: Fixed18 | Codec; nextEraClaimedUnbonded: Fixed18 | Codec; liquidTokenIssuance: Fixed18 | Codec; defaultExchangeRate: Fixed18 | Codec; maxClaimFee: Fixed18 | Codec; bondingDuration: number | Codec; currentEra: number | Codec; } /** * @class StakingPoolHelper * @classdesc support more structured api, include staking pool properties and derived properties */ export declare class StakingPoolHelper { totalBonded: Fixed18; communalFree: Fixed18; unbondingToFree: Fixed18; nextEraClaimedUnbonded: Fixed18; liquidTokenIssuance: Fixed18; defaultExchangeRate: Fixed18; maxClaimFee: Fixed18; bondingDuration: number; currentEra: number; constructor(params: StakingPoolParams); get communalBonded(): Fixed18; get communalTotal(): Fixed18; get communalBondedRatio(): Fixed18; get liquidExchangeRate(): Fixed18; convertToLiquid(amount: Fixed18): Fixed18; claimFeeRatio(era: number): Fixed18; claimFee(amount: Fixed18, era: number): Fixed18; } export {};