import { ApiPromise } from "@polkadot/api";
import Big from "big.js";
import { Bitcoin, BitcoinUnit, Currency, ExchangeRate, MonetaryAmount } from "@interlay/monetary-js";
import { InterbtcPrimitivesOracleKey } from "@polkadot/types/lookup";
import { TransactionAPI } from "./transaction";
import { CurrencyUnit, WrappedCurrency } from "../types/currency";
import { FeeEstimationType } from "../types/oracleTypes";
export declare const DEFAULT_FEED_NAME = "DOT/BTC";
export declare const DEFAULT_INCLUSION_TIME: FeeEstimationType;
/**
 * @category BTC Bridge
 */
export interface OracleAPI {
    /**
     * @param currency The collateral currency as a `Monetary.js` object
     * @param wrappedCurrency The wrapped currency to use in the returned exchange rate type, defaults to `Bitcoin`
     * @returns The exchange rate between Bitcoin and the provided collateral currency
     */
    getExchangeRate<C extends CurrencyUnit>(collateralCurrency: Currency<C>, wrappedCurrency?: Currency<BitcoinUnit>): Promise<ExchangeRate<Currency<BitcoinUnit>, BitcoinUnit, Currency<C>, C>>;
    /**
     * Obtains the current fees for BTC transactions, in satoshi/byte.
     * @returns Big value for the current inclusion fees.
     */
    getBitcoinFees(): Promise<Big>;
    /**
     * @returns Last exchange rate time
     */
    getValidUntil<U extends CurrencyUnit>(counterCurrency: Currency<U>): Promise<Date>;
    /**
     * @returns A map from the oracle's account id to its name
     */
    getSourcesById(): Promise<Map<string, string>>;
    /**
     * @returns Boolean value indicating whether the oracle is online
     */
    isOnline(): Promise<boolean>;
    /**
     * Send a transaction to set the exchange rate between Bitcoin and a collateral currency
     * @param exchangeRate The rate to set
     */
    setExchangeRate<C extends CurrencyUnit>(exchangeRate: ExchangeRate<Bitcoin, BitcoinUnit, Currency<C>, C>): Promise<void>;
    /**
     * Send a transaction to set the current fee estimate for BTC transactions
     * @param fees Estimated Satoshis per bytes to get a transaction included
     */
    setBitcoinFees(fees: Big): Promise<void>;
    /**
     * @param amount The amount of wrapped tokens to convert
     * @param currency A `Monetary.js` object
     * @returns Converted value
     */
    convertWrappedToCurrency<C extends CurrencyUnit>(amount: MonetaryAmount<Currency<BitcoinUnit>, BitcoinUnit>, currency: Currency<C>): Promise<MonetaryAmount<Currency<C>, C>>;
    /**
     * @param amount The amount of collateral tokens to convert
     * @returns Converted value
     */
    convertCollateralToWrapped<C extends CurrencyUnit>(amount: MonetaryAmount<Currency<C>, C>): Promise<MonetaryAmount<Currency<BitcoinUnit>, BitcoinUnit>>;
    /**
     * @returns The period of time (in milliseconds) after an oracle's last submission
     * during which it is considered online
     */
    getOnlineTimeout(): Promise<number>;
    /**
     * @param key A key defining an exchange rate or a BTC network fee estimate
     * @returns Whether the oracle entr for the given key has been updated
     */
    getRawValuesUpdated(key: InterbtcPrimitivesOracleKey): Promise<boolean>;
    /**
     * @param type The fee estimate type whose update is awaited
     * @remark Awaits an oracle update to the BTC inclusion fee
     */
    waitForFeeEstimateUpdate(type?: FeeEstimationType): Promise<void>;
    /**
     * @param exchangeRate The exchange rate whose counter currency to await an update for
     * (with respect to BTC)
     * @remark Awaits an oracle update to the exchange rate
     */
    waitForExchangeRateUpdate<C extends CurrencyUnit, U extends BitcoinUnit>(exchangeRate: ExchangeRate<Currency<U>, U, Currency<C>, C>): Promise<void>;
}
export declare class DefaultOracleAPI implements OracleAPI {
    private api;
    private wrappedCurrency;
    private transactionAPI;
    constructor(api: ApiPromise, wrappedCurrency: WrappedCurrency, transactionAPI: TransactionAPI);
    getExchangeRate<C extends CurrencyUnit>(collateralCurrency: Currency<C>): Promise<ExchangeRate<Currency<BitcoinUnit>, BitcoinUnit, Currency<C>, C>>;
    convertWrappedToCurrency<C extends CurrencyUnit>(amount: MonetaryAmount<Currency<BitcoinUnit>, BitcoinUnit>, currency: Currency<C>): Promise<MonetaryAmount<Currency<C>, C>>;
    convertCollateralToWrapped<C extends CurrencyUnit>(amount: MonetaryAmount<Currency<C>, C>): Promise<MonetaryAmount<Currency<BitcoinUnit>, BitcoinUnit>>;
    getOnlineTimeout(): Promise<number>;
    setExchangeRate<C extends CurrencyUnit>(exchangeRate: ExchangeRate<Bitcoin, BitcoinUnit, Currency<C>, C>): Promise<void>;
    getBitcoinFees(): Promise<Big>;
    setBitcoinFees(fees: Big): Promise<void>;
    getSourcesById(): Promise<Map<string, string>>;
    getValidUntil<U extends CurrencyUnit>(counterCurrency: Currency<U>): Promise<Date>;
    isOnline(): Promise<boolean>;
    getRawValuesUpdated(key: InterbtcPrimitivesOracleKey): Promise<boolean>;
    waitForFeeEstimateUpdate(type?: FeeEstimationType): Promise<void>;
    waitForExchangeRateUpdate<C extends CurrencyUnit, U extends BitcoinUnit>(exchangeRate: ExchangeRate<Currency<U>, U, Currency<C>, C>): Promise<void>;
    private hasOracleError;
}
