import { Transaction } from "@interlay/esplora-btc-api";
import { Bitcoin, BitcoinUnit, Currency, ExchangeRate, UnitList } from "@interlay/monetary-js";
import { Keyring } from "@polkadot/api";
import { ApiTypes, AugmentedEvent } from "@polkadot/api/types";
import { KeyringPair } from "@polkadot/keyring/types";
import { AnyTuple } from "@polkadot/types/types";
import Big from "big.js";
import { BitcoinCoreClient, InterBtcApi, CollateralUnit, OracleAPI, VaultStatusExt } from "../../src";
export declare const SLEEP_TIME_MS = 1000;
export declare const BITCOIN_BLOCK_TIME_IN_MS: number;
export declare function sleep(ms: number): Promise<void>;
export declare function wait_success<R>(call: () => Promise<R>): Promise<R>;
export declare function callWithExchangeRate<C extends CollateralUnit>(oracleAPI: OracleAPI, exchangeRate: ExchangeRate<Bitcoin, BitcoinUnit, Currency<C>, C>, fn: () => Promise<void>): Promise<void>;
export declare function callWith(InterBtcApi: InterBtcApi, key: KeyringPair, call: () => Promise<void>): Promise<void>;
export declare function sudo(InterBtcApi: InterBtcApi, call: () => Promise<void>): Promise<void>;
export declare function makeRandomBitcoinAddress(): string;
export declare function makeRandomPolkadotKeyPair(keyring: Keyring): KeyringPair;
export declare function runWhileMiningBTCBlocks(bitcoinCoreClient: BitcoinCoreClient, fn: () => Promise<void>): Promise<void>;
export declare const vaultStatusToLabel: (status: VaultStatusExt) => string;
export declare const getExchangeRateValueToSetForTesting: <U extends UnitList>(_collateralCurrency: Currency<U>) => Big;
/**
 * Returns the vsize (virtual size) of the given transaction.
 *
 * The vsize is calculated by dividing the weight by 4 and rounding up to the next integer.
 * See also https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#Transaction_size_calculations
 * @param transaction the transaction to calculate the vsize of
 * @returns the vsize of the transaction
 */
export declare const calculateBtcTxVsize: (transaction: Transaction) => Big;
export declare enum RbfEstimateMode {
    unset = "unset",
    economical = "economical",
    conservative = "conservative"
}
export interface RbfOptions {
    conf_target?: number;
    fee_rate?: string | number;
    replaceable?: boolean;
    estimate_mode?: RbfEstimateMode;
}
export interface RbfResponse {
    psbt?: string;
    txid?: string;
    origfee: number;
    fee: number;
    errors: string[];
}
/**
 * Tries to bump fees (replace by fee) on a given bitcoin transaction, using the "bumpfee" RPC call.
 * See also: https://developer.bitcoin.org/reference/rpc/bumpfee.html .
 *
 * Default options are set to calculate a replacement fee aiming for 72 blocks (~12 hours), using and economical estimate mode.
 *
 * @param bitcoinCoreClient the bitcoin core client to make the call with
 * @param txId the transaction id
 * @param options (optional) custom options to pass with "bumpfee" command, default: {conf_target: 72, estimate_mode: "economical"}
 */
export declare const bumpFeesForBtcTx: (bitcoinCoreClient: BitcoinCoreClient, txId: string, options?: RbfOptions) => Promise<RbfResponse>;
/**
 * Wait for an event to show up as finalized.
 *
 * This method will only subscribe to new blocks once called and then look for a specific event.
 * Contrary to @see {@link DefaultTransactionAPI.waitForEvent} which looks at all past events
 * and may return due to older events using the same name.
 *
 * Note: This method checks the parent blocks in case the event we are looking for
 * was finalized in a block just before this method was called.
 *
 * @param interBtcApi the api to use for querying
 * @param event the event to wait for, eg. `api.events.assetRegistry.RegisteredAsset`
 */
export declare const waitForFinalizedEvent: <T extends AnyTuple>(interBtcApi: InterBtcApi, event: AugmentedEvent<ApiTypes, T, unknown>) => Promise<void>;
/**
 * Wait for an event to show up on chain (unfinalized).
 *
 * This method will only subscribe to new blocks once called and then look for a specific event.
 * Contrary to @see {@link DefaultTransactionAPI.waitForEvent} which looks at all past events
 * and may return due to older events using the same name.
 *
 * Note: This method checks the parent blocks in case the event we are looking for
 * was finalized in a block just before this method was called.
 *
 * @param interBtcApi the api to use for querying
 * @param event the event to wait for, eg. `api.events.assetRegistry.RegisteredAsset`
 */
export declare const waitForIncludedEvent: <T extends AnyTuple>(interBtcApi: InterBtcApi, event: AugmentedEvent<ApiTypes, T, unknown>) => Promise<void>;
/**
 * Wait for an event to show up on chain.
 *
 * This method will only subscribe to new blocks once called and then look for a specific event.
 *
 * Note: This method checks the parent blocks in case the event we are looking for
 * was finalized/included in a block just before this method was called.
 * @param interBtcApi the api to use for querying
 * @param event the event to wait for, eg. `api.events.assetRegistry.RegisteredAsset`
 * @param finalized [optional] true to wait for finalized event, false (default) to only wait for included event
 * @param timeoutMs [optional] a timeout in milliseconds to wait for the event. Rejects if not found before timeout. Default: no timeout
 * @returns a promise that resolves when the event is found, and if a timeout is provided, rejects if not found before timeout.
 */
export declare const waitForEvent: <T extends AnyTuple>(interBtcApi: InterBtcApi, event: AugmentedEvent<ApiTypes, T, unknown>, finalized?: boolean, timeoutMs?: number | undefined) => Promise<boolean>;
