/** * Copyright (c) 2018-2023, BOTLabs GmbH. * * This source code is licensed under the BSD 4-Clause "Original" license * found in the LICENSE file in the root directory of this source tree. */ /// import { BN } from '@polkadot/util'; import type { BalanceNumber, BalanceOptions, MetricPrefix } from '@kiltprotocol/types'; export declare const KILT_COIN: BN; export declare const Prefixes: Map; /** * Uses the polkadot.js balance formatter, to convert given BN to a human-readable prefixed number. * * @param amount BN to format. * @param additionalOptions Optional formatting settings, these are defaulted to KILT specific settings. * @returns String representation of the given BN with prefix and unit ('KILT' as default). */ export declare function formatKiltBalance(amount: BalanceNumber, additionalOptions?: BalanceOptions): string; /** * Converts balance from KILT denomination to base unit. * * @param balance Balance in KILT denomination. * @param power Allows modifying conversion. Set to 0 for conversion to base unit, set to <0 for various larger denominations. -15 is KILT denomination. * @returns Converted (redenominated) balance. */ export declare function convertToTxUnit(balance: BN, power: number): BN; export declare const TRANSACTION_FEE: BN; /** * Safely converts the given [[BalanceNumber]] to a string, using the supplied methods, * or if given a string checks for valid number representation. * * @param input [[BalanceNumber]] to convert. * @returns String representation of the given [[BalanceNumber]]. */ export declare function balanceNumberToString(input: BalanceNumber): string; /** * Converts the given [[BalanceNumber]] to the femto KILT equivalent. * * @param input [[BalanceNumber]] to convert. * @param unit Metric prefix of the given [[BalanceNumber]]. * @returns Exact BN representation in femtoKilt, to use in transactions and calculations. */ export declare function toFemtoKilt(input: BalanceNumber, unit?: MetricPrefix): BN; /** * Converts the given [[BalanceNumber]] to a human-readable number with metric prefix and Unit. * This function uses the polkadot formatBalance function, * it's output can therefore be formatted via the polkadot formatting options. * * @param input [[BalanceNumber]] to convert from Femto Kilt. * @param decimals Set the minimum decimal places in the formatted localized output, default is 4. * @param options [[BalanceOptions]] for internationalization and formatting. * @returns String representation of the given [[BalanceNumber]] with unit und metric prefix. */ export declare function fromFemtoKilt(input: BalanceNumber, decimals?: number, options?: BalanceOptions): string;