import { AccountId, H256, Permill } from "@polkadot/types/interfaces";
import Big, { BigSource } from "big.js";
import { ApiPromise } from "@polkadot/api";
import type { Struct } from "@polkadot/types";
import { Network } from "bitcoinjs-lib";
import { StorageKey } from "@polkadot/types/primitive/StorageKey";
import { Codec } from "@polkadot/types/types";
import { Moment } from "@polkadot/types/interfaces";
import { Option } from "@polkadot/types/codec";
import { Bytes } from "@polkadot/types-codec";
import { u32 } from "@polkadot/types";
import { InterbtcPrimitivesRedeemRedeemRequest, InterbtcPrimitivesReplaceReplaceRequest, InterbtcPrimitivesIssueIssueRequest, BitcoinAddress, VaultRegistrySystemVault, InterbtcPrimitivesVaultId, InterbtcPrimitivesVaultCurrencyPair, InterbtcPrimitivesCurrencyId } from "@polkadot/types/lookup";
import { SystemVaultExt } from "../types/vault";
import { Issue, Redeem, RedeemStatus, ReplaceRequestExt } from "../types/requestTypes";
import { BalanceWrapper, SignedFixedPoint, UnsignedFixedPoint, VaultId } from "../interfaces";
import { CollateralCurrencyExt, CurrencyExt, WrappedCurrency } from "../types";
import { AssetRegistryAPI, LoansAPI, VaultsAPI } from "../parachain";
/**
 * Converts endianness of a Uint8Array
 * @param bytes Uint8Array, to be converted LE<>BE
 */
export declare function reverseEndianness(bytes: Uint8Array): Uint8Array;
/**
 * Remove the `0x` hex prefix if present
 * @param str
 */
export declare function stripHexPrefix(str: string): string;
/**
 * Ensure the `0x` hex prefix is present
 * @param str
 **/
export declare function addHexPrefix(str: string): string;
/**
 * Ensure a hash value is an encoded H256
 * @param api The polkadot API promise used to encode if necessary
 * @param hash The either H256 or string encoded hash
 **/
export declare function ensureHashEncoded(api: ApiPromise, hash: H256 | string): H256;
/**
 * Reverse the endianness of the given hex string
 * @dev Will remove `0x` prefix if present
 * @param hex
 */
export declare function reverseEndiannessHex(hex: string): string;
/**
 * Converts a Uint8Array to string
 * @dev Will remove `0x` prefix if present
 * @param bytes
 */
export declare function uint8ArrayToString(bytes: Uint8Array): string;
export declare function decodeFixedPointType(x: SignedFixedPoint | UnsignedFixedPoint): Big;
/**
 * Convert Bytes to a string. Will remove `0x` prefix if present.
 * @param bytes Bytes to decode
 * @returns the decoded string
 */
export declare function decodeBytesAsString(bytes: Bytes): string;
export declare function encodeUnsignedFixedPoint(api: ApiPromise, x: Big): UnsignedFixedPoint;
export declare function storageKeyToNthInner<T extends Codec>(s: StorageKey<T[]>, n?: number): T;
export interface DecodedRequest extends Struct {
    readonly btc_address: BitcoinAddress;
}
export interface DecodedRequestExt extends Omit<DecodedRequest, "btc_address"> {
    btc_address: string;
}
export declare function parseSystemVault(assetRegistryApi: AssetRegistryAPI, loansAPI: LoansAPI, vault: VaultRegistrySystemVault, wrappedCurrency: WrappedCurrency, collateralCurrency: CollateralCurrencyExt): Promise<SystemVaultExt>;
export declare function newAccountId(api: ApiPromise, accountId: string): AccountId;
export declare function newVaultId(api: ApiPromise, accountId: string, collateralCurrency: CollateralCurrencyExt, wrappedCurrency: WrappedCurrency): InterbtcPrimitivesVaultId;
export declare function decodeRpcVaultId(api: ApiPromise, assetRegistry: AssetRegistryAPI, loansAPI: LoansAPI, vaultId: VaultId): Promise<InterbtcPrimitivesVaultId>;
export declare function newVaultCurrencyPair(api: ApiPromise, collateralCurrency: CollateralCurrencyExt, wrappedCurrency: WrappedCurrency): InterbtcPrimitivesVaultCurrencyPair;
export declare function newCurrencyId(api: ApiPromise, currency: CurrencyExt): InterbtcPrimitivesCurrencyId;
export declare function newForeignAssetId(api: ApiPromise, id: number): u32;
export declare function newBalanceWrapper(api: ApiPromise, atomicAmount: BigSource): BalanceWrapper;
export declare function parseReplaceRequest(assetRegistry: AssetRegistryAPI, loansAPI: LoansAPI, req: InterbtcPrimitivesReplaceReplaceRequest, network: Network, wrappedCurrency: WrappedCurrency, id: H256 | string): Promise<ReplaceRequestExt>;
export declare function parseIssueRequest(vaultsAPI: VaultsAPI, assetRegistry: AssetRegistryAPI, loansAPI: LoansAPI, req: InterbtcPrimitivesIssueIssueRequest, network: Network, id: H256 | string): Promise<Issue>;
export declare function parseRedeemRequestStatus(req: InterbtcPrimitivesRedeemRedeemRequest, redeemPeriod: number, activeBlockCount: number): RedeemStatus;
export declare function parseRedeemRequest(vaultsAPI: VaultsAPI, assetRegistry: AssetRegistryAPI, loansAPI: LoansAPI, req: InterbtcPrimitivesRedeemRedeemRequest, network: Network, id: H256 | string, redeemPeriod: number, activeBlockCount: number): Promise<Redeem>;
export declare function convertMoment(moment: Moment): Date;
export declare function unwrapRawExchangeRate(option: Option<UnsignedFixedPoint>): UnsignedFixedPoint | undefined;
export declare function encodeVaultId(assetRegistry: AssetRegistryAPI, loansAPI: LoansAPI, id: InterbtcPrimitivesVaultId): Promise<string>;
export declare function queryNominationsMap(assetRegistry: AssetRegistryAPI, loansAPI: LoansAPI, map: Map<InterbtcPrimitivesVaultId, number>, vaultId: InterbtcPrimitivesVaultId): Promise<number | undefined>;
export declare function getSS58Prefix(api: ApiPromise): number;
export declare function decodePermill(amount: Permill, inPercentage?: boolean): Big;
