import { Hash, EventRecord } from "@polkadot/types/interfaces";
import { ApiTypes, AugmentedEvent } from "@polkadot/api/types";
import type { AnyTuple } from "@polkadot/types/types";
import { ApiPromise } from "@polkadot/api";
import { KeyringPair } from "@polkadot/keyring/types";
import { MonetaryAmount } from "@interlay/monetary-js";
import { InterbtcPrimitivesVaultId } from "@polkadot/types/lookup";
import { BitcoinCoreClient } from "./bitcoin-core-client";
import { Issue, Redeem, WrappedCurrency } from "../types";
import { InterBtcApi } from "../interbtc-api";
export declare const SLEEP_TIME_MS = 1000;
export interface IssueResult {
    request: Issue;
    initialWrappedTokenBalance: MonetaryAmount<WrappedCurrency>;
    finalWrappedTokenBalance: MonetaryAmount<WrappedCurrency>;
}
export declare enum ExecuteRedeem {
    False = 0,
    Manually = 1,
    Auto = 2
}
/**
 * @param events The EventRecord array returned after sending a transaction
 * @param methodToCheck The name of the event method whose existence to check
 * @returns The id associated with the transaction. If the EventRecord array does not
 * contain required events, the function throws an error.
 */
export declare function getRequestIdsFromEvents(events: EventRecord[], eventToFind: AugmentedEvent<ApiTypes, AnyTuple>, api: ApiPromise): Hash[];
/**
 * Given a list of vaults with availabilities (e.g. collateral for issue, tokens
 * for redeem) and an amount to allocate, selects one or more vaults to fulfil
 * the request.
 * If the amount cannot be allocated by a single vault, greedily selects the vault
 * with highest available amount and tries again for the remainder. If at leaast
 * one vault can fulfil a request alone, a random one among them is selected.
 **/
export declare function allocateAmountsToVaults(vaultsWithAvailableAmounts: Map<InterbtcPrimitivesVaultId, MonetaryAmount<WrappedCurrency>>, amountToAllocate: MonetaryAmount<WrappedCurrency>): Map<InterbtcPrimitivesVaultId, MonetaryAmount<WrappedCurrency>>;
export declare function issueSingle(interBtcApi: InterBtcApi, bitcoinCoreClient: BitcoinCoreClient, issuingAccount: KeyringPair, amount: MonetaryAmount<WrappedCurrency>, vaultId?: InterbtcPrimitivesVaultId, autoExecute?: boolean, triggerRefund?: boolean, atomic?: boolean): Promise<IssueResult>;
export declare function sleep(ms: number): Promise<void>;
export declare function redeem(interBtcApi: InterBtcApi, bitcoinCoreClient: BitcoinCoreClient, redeemingAccount: KeyringPair, amount: MonetaryAmount<WrappedCurrency>, vaultId?: InterbtcPrimitivesVaultId, autoExecute?: ExecuteRedeem, atomic?: boolean, timeout?: number, retries?: number): Promise<Redeem>;
export declare function issueAndRedeem(InterBtcApi: InterBtcApi, bitcoinCoreClient: BitcoinCoreClient, account: KeyringPair, vaultId?: InterbtcPrimitivesVaultId, issueAmount?: MonetaryAmount<WrappedCurrency>, redeemAmount?: MonetaryAmount<WrappedCurrency>, autoExecuteIssue?: boolean, autoExecuteRedeem?: ExecuteRedeem, triggerRefund?: boolean, atomic?: boolean): Promise<[Issue, Redeem]>;
