/****************************************************************************** * * (C) 2022 AhnLab Blockchain Company, Inc. All rights reserved. * Any part of this source code can not be copied with any method without * prior written permission from the author or authorized person. * ******************************************************************************/ import BN from 'bn.js'; /** * Checks whether a given balance of ETH, represented as a hex string, is sufficient to pay a value plus a gas fee * * @param {Object} txParams - Contains data about a transaction * @param {string} txParams.gas - The gas for a transaction * @param {string} txParams.gasPrice - The price per gas for the transaction * @param {string} txParams.value - The value of ETH to send * @param {string} hexBalance - A balance of ETH represented as a hex string * @returns {boolean} Whether the balance is greater than or equal to the value plus the value of gas times gasPrice * */ declare function sufficientBalance(txParams: any, hexBalance: any): boolean; /** * Converts a hex string to a BN object * * @param {string} inputHex - A number represented as a hex string * @returns {Object} A BN object * */ declare function hexToBn(inputHex: string): BN; /** * Used to multiply a BN by a fraction * * @param {BN} targetBN - The number to multiply by a fraction * @param {number|string} numerator - The numerator of the fraction multiplier * @param {number|string} denominator - The denominator of the fraction multiplier * @returns {BN} The product of the multiplication * */ declare function BnMultiplyByFraction(targetBN: any, numerator: any, denominator: any): any; /** * Returns an Error if extension.runtime.lastError is present * this is a workaround for the non-standard error object that's used * @returns {Error|undefined} */ declare function checkForError(): any; /** * Prefixes a hex string with '0x' or '-0x' and returns it. Idempotent. * * @param {string} str - The string to prefix. * @returns {string} The prefixed string. */ declare const addHexPrefix: (str: any) => any; /** * Converts a BN object to a hex string with a '0x' prefix * * @param {BN} inputBn - The BN to convert to a hex string * @returns {string} - A '0x' prefixed hex string * */ declare function bnToHex(inputBn: any): any; export { sufficientBalance, hexToBn, BnMultiplyByFraction, checkForError, addHexPrefix, bnToHex };