import { ApiPromise } from "@polkadot/api";
import { H256, AccountId } from "@polkadot/types/interfaces";
import { BlockNumber } from "@polkadot/types/interfaces/runtime";
import { Network } from "bitcoinjs-lib";
import { BitcoinUnit, Currency, MonetaryAmount } from "@interlay/monetary-js";
import { InterbtcPrimitivesReplaceReplaceRequest } from "@polkadot/types/lookup";
import { FeeAPI } from "./fee";
import { TransactionAPI } from "./transaction";
import { ElectrsAPI } from "../external";
import { CollateralCurrency, CollateralUnit, ReplaceRequestExt, WrappedCurrency } from "../types";
import { VaultsAPI } from "../parachain";
/**
 * @category BTC Bridge
 */
export interface ReplaceAPI {
    /**
     * @returns The minimum amount of btc that is accepted for replace requests; any lower values would
     * risk the bitcoin client to reject the payment
     */
    getDustValue(): Promise<MonetaryAmount<WrappedCurrency, BitcoinUnit>>;
    /**
     * @returns The time difference in number of blocks between when a replace request is created
     * and required completion time by a vault. The replace period has an upper limit
     * to prevent griefing of vault collateral.
     */
    getReplacePeriod(): Promise<BlockNumber>;
    /**
     * @returns An array containing the replace requests
     */
    list(): Promise<ReplaceRequestExt[]>;
    /**
     * @returns A mapping from the replace request ID to the replace request object
     */
    map(): Promise<Map<H256, ReplaceRequestExt>>;
    /**
     * @param replaceId The ID of the replace request to fetch
     * @returns A replace request object
     */
    getRequestById(replaceId: H256 | string): Promise<ReplaceRequestExt>;
    /**
     * @param amount Amount issued, denoted in Bitcoin, to have replaced by another vault
     * @param collateralCurrency Collateral currency to have replaced
     */
    request(amount: MonetaryAmount<WrappedCurrency, BitcoinUnit>, collateralCurrency: CollateralCurrency): Promise<void>;
    /**
     * Wihdraw a replace request
     * @param amount The amount of wrapped tokens to withdraw from the amount
     * requested to have replaced.
     * @param collateralCurrency Collateral currency of the request
     */
    withdraw(amount: MonetaryAmount<WrappedCurrency, BitcoinUnit>, collateralCurrency: CollateralCurrency): Promise<void>;
    /**
     * Accept a replace request
     * @param oldVault ID of the old vault that to be (possibly partially) replaced
     * @param amount Amount of issued tokens to be replaced
     * @param collateral The collateral for replacement
     * @param btcAddress The address that old-vault should transfer the btc to
     */
    accept(oldVault: AccountId, amount: MonetaryAmount<WrappedCurrency, BitcoinUnit>, collateral: MonetaryAmount<Currency<CollateralUnit>, CollateralUnit>, btcAddress: string): Promise<void>;
    /**
     * Execute a replace request
     * @remarks If `txId` is not set, the `merkleProof` and `rawTx` must both be set.
     *
     * @param requestId The ID generated by the replace request transaction
     * @param btcTxId Bitcoin transaction ID
     */
    execute(requestId: string, btcTxId: string): Promise<void>;
    /**
     * Fetch the replace requests associated with a vault. In the returned requests,
     * the vault is either the replaced or the replacing one.
     *
     * @param vaultAccountId The AccountId of the vault used to filter replace requests
     * @returns An array with replace requests involving said vault
     */
    mapReplaceRequests(vaultAccountId: AccountId): Promise<ReplaceRequestExt[]>;
}
export declare class DefaultReplaceAPI implements ReplaceAPI {
    private api;
    private btcNetwork;
    private electrsAPI;
    private wrappedCurrency;
    private feeAPI;
    private vaultsAPI;
    private transactionAPI;
    constructor(api: ApiPromise, btcNetwork: Network, electrsAPI: ElectrsAPI, wrappedCurrency: WrappedCurrency, feeAPI: FeeAPI, vaultsAPI: VaultsAPI, transactionAPI: TransactionAPI);
    request(amount: MonetaryAmount<WrappedCurrency, BitcoinUnit>, collateralCurrency: CollateralCurrency): Promise<void>;
    withdraw(amount: MonetaryAmount<WrappedCurrency, BitcoinUnit>, collateralCurrency: CollateralCurrency): Promise<void>;
    accept(oldVault: AccountId, amount: MonetaryAmount<WrappedCurrency, BitcoinUnit>, collateral: MonetaryAmount<Currency<CollateralUnit>, CollateralUnit>, btcAddress: string): Promise<void>;
    execute(requestId: string, btcTxId: string): Promise<void>;
    getDustValue(): Promise<MonetaryAmount<WrappedCurrency, BitcoinUnit>>;
    getReplacePeriod(): Promise<BlockNumber>;
    list(): Promise<ReplaceRequestExt[]>;
    map(): Promise<Map<H256, ReplaceRequestExt>>;
    getRequestById(replaceId: H256 | string): Promise<ReplaceRequestExt>;
    mapReplaceRequests(vaultAccountId: AccountId): Promise<ReplaceRequestExt[]>;
    getOldVaultReplaceRequests(vaultAccountId: AccountId): Promise<ReplaceRequestExt[]>;
    getNewVaultReplaceRequests(vaultAccountId: AccountId): Promise<ReplaceRequestExt[]>;
    parseRequestsAsync(requestPairs: [H256, InterbtcPrimitivesReplaceReplaceRequest][]): Promise<[H256, ReplaceRequestExt][]>;
}
