import { MonetaryAmount } from "@interlay/monetary-js";
import { ApiPromise } from "@polkadot/api";
import { AccountId } from "@polkadot/types/interfaces";
import BN from "bn.js";
import Big from "big.js";
import { GovernanceCurrency, StakedBalance, VotingCurrency } from "../types";
import { SystemAPI } from "./system";
import { TransactionAPI } from ".";
/**
 * @category BTC Bridge
 */
export interface EscrowAPI {
    /**
     * @param accountId Account whose voting balance to fetch
     * @param blockNumber The number of block to query state at
     * @returns The voting balance
     * @remarks Logic is duplicated from Escrow pallet in the parachain
     */
    votingBalance(accountId: AccountId, blockNumber?: number): Promise<MonetaryAmount<GovernanceCurrency>>;
    /**
     * @param blockNumber The number of block to query state at
     * @returns The voting balance
     * @remarks
     * - Expect poor performance from this function as more blocks are appended to the parachain.
     * It is not recommended to call this directly, but rather to query through the indexer (currently `interbtc-index`).
     * - Logic is duplicated from Escrow pallet in the parachain
     */
    totalVotingSupply(blockNumber?: number): Promise<MonetaryAmount<GovernanceCurrency>>;
    /**
     * @param amount Governance token amount to lock (e.g. KINT or INTR)
     * @param unlockHeight Block number to lock until
     * @remarks The amount can't be less than the max period (`getMaxPeriod` getter) to prevent rounding errors
     */
    createLock(amount: MonetaryAmount<GovernanceCurrency>, unlockHeight: number): Promise<void>;
    /**
     * @param accountId ID of the user whose stake to fetch
     * @returns The staked amount and end block
     */
    getStakedBalance(accountId: AccountId): Promise<StakedBalance>;
    /**
     * @returns The total amount of locked governance tokens
     * @remarks
     * - Expect poor performance from this function as more blocks are appended to the parachain.
     * It is not recommended to call this directly, but rather to query through interbtc-squid once implemented.
     */
    getTotalStakedBalance(): Promise<MonetaryAmount<GovernanceCurrency>>;
    /**
     * @remarks Withdraws all locked governance currency
     */
    withdraw(): Promise<void>;
    /**
     * @returns All future times are rounded by this.
     */
    getSpan(): Promise<BN>;
    /**
     * @returns The maximum time for locks.
     */
    getMaxPeriod(): Promise<BN>;
    /**
     * @remarks Withdraws stake-to-vote rewards
     */
    withdrawRewards(): Promise<void>;
    /**
     * @param amount Governance token amount to lock (e.g. KINT or INTR)
     */
    increaseAmount(amount: MonetaryAmount<GovernanceCurrency>): Promise<void>;
    /**
     * @param amount Governance token amount to lock (e.g. KINT or INTR)
     */
    increaseUnlockHeight(unlockHeight: number): Promise<void>;
    /**
     * @param accountId User account ID
     * @returns The rewards that can be withdrawn by the account
     * @remarks Implements https://spec.interlay.io/spec/reward.html#computereward
     */
    getRewards(accountId: AccountId): Promise<MonetaryAmount<GovernanceCurrency>>;
    /**
     * @param accountId User account ID
     * @param amountToLock New amount to add to the current stake
     * @param blockLockTimeExtension Amount of blocks the stake will be locked for
     * @returns The estimated reward, as amount and percentage (APY)
     */
    getRewardEstimate(accountId: AccountId, amountToLock?: MonetaryAmount<GovernanceCurrency>, blockLockTimeExtension?: number): Promise<{
        amount: MonetaryAmount<GovernanceCurrency>;
        apy: Big;
    }>;
}
export declare class DefaultEscrowAPI implements EscrowAPI {
    private api;
    private governanceCurrency;
    private systemAPI;
    private transactionAPI;
    constructor(api: ApiPromise, governanceCurrency: GovernanceCurrency, systemAPI: SystemAPI, transactionAPI: TransactionAPI);
    createLock(amount: MonetaryAmount<GovernanceCurrency>, unlockHeight: number): Promise<void>;
    withdraw(): Promise<void>;
    withdrawRewards(): Promise<void>;
    increaseAmount(amount: MonetaryAmount<GovernanceCurrency>): Promise<void>;
    increaseUnlockHeight(unlockHeight: number): Promise<void>;
    getRewards(accountId: AccountId): Promise<MonetaryAmount<GovernanceCurrency>>;
    getRewardEstimate(accountId: AccountId, amountToLock?: MonetaryAmount<GovernanceCurrency>, blockLockTimeExtension?: number): Promise<{
        amount: MonetaryAmount<GovernanceCurrency>;
        apy: Big;
    }>;
    getEscrowStake(accountId: AccountId): Promise<Big>;
    getEscrowTotalStake(): Promise<Big>;
    getRewardTally(accountId: AccountId): Promise<Big>;
    getRewardPerToken(): Promise<Big>;
    getRewardPerBlock(): Promise<MonetaryAmount<GovernanceCurrency>>;
    getStakedBalance(accountId: AccountId): Promise<StakedBalance>;
    getTotalStakedBalance(): Promise<MonetaryAmount<GovernanceCurrency>>;
    votingBalance(accountId: AccountId, blockNumber?: number): Promise<MonetaryAmount<GovernanceCurrency>>;
    private rawBalanceAt;
    totalVotingSupply(blockNumber?: number): Promise<MonetaryAmount<VotingCurrency>>;
    private totalVotingSupplyAt;
    private findBlockEpoch;
    private rawSupplyAt;
    getSpan(): Promise<BN>;
    getMaxPeriod(): Promise<BN>;
    private roundHeight;
    private getSlopeChange;
    private saturatingSub;
}
