import { DCoreAssetObject } from './model/asset'; import { BrainKeyInfo, ElGamalKeys, KeyPrivate, KeyPublic } from './model/utils'; export declare class Utils { /** * Format DCT price amount from blockchain format to real and readable formatted string. * * Example: Amount price from blockchain is 1, formatted price 0.00000001 DCT * * @param {number} dctAmount Amount of DCT asset. * @return {string} Formatted amount in string format. */ static formatToReadiblePrice(dctAmount: number): string; /** * Formats amount to DCT precision. * Value is devided by asset's precision factor * Note: Most of amount values are already formatted for this precision format. * * @param {number} amount Amount to be formatted. * @returns {number} DCore formatted amount. */ static formatAmountForDCTAsset(amount: number): number; /** * Formats amount to format with decimal numbers. * Note: Most of amount values are already formatted for this precision format. * * @param {number} amount Amount of asset in DCore network format. * @param {DCoreAssetObject} asset Asset object to format amount to. * @returns {number} Formatted number in format with decimal numbers. */ static formatAmountForAsset(amount: number, asset: DCoreAssetObject): number; /** * Format amount value for DCore, to format without decimal numbers. * * @param {number} amount Amount with decimal numbers to format. * @param {DCoreAssetObject} asset Asset object for formatting. * @returns {number} Formatted number. */ static formatAmountToAsset(amount: number, asset: DCoreAssetObject): number; /** * RIPEMD 160 hash * * @param {Buffer} fromBuffer Buffer to calculate hash from. * @returns {string} RIPEMD160 hash. */ static ripemdHash(fromBuffer: string): string; /** * Generate private and public key from given brain key. * * @param {string} fromBrainKey Brain key to generate keys from. * @return {any[]} [privateKey: KeyPrivate, publicKey: KeyPublic] Keys. */ static generateKeys(fromBrainKey: string): [KeyPrivate, KeyPublic]; /** * Calculate public key from given private key. * * @param {string} privateKey Private key to get public key for. * @return {KeyPublic} KeyPublic object. */ static getPublicKey(privateKey: string): KeyPublic; /** * Create KeyPrivate object from WIF format of private key. * * @param {string} pkWif Private key in WIF(hex) (Wallet Import Format) format. * @return {KeyPrivate} KeyPrivate object. */ static privateKeyFromWif(pkWif: string): KeyPrivate; /** * Create KeyPublic object from string format of public key. * * @param {string} pubKeyString Public key string. * @return {KeyPublic} KeyPublic object. */ static publicKeyFromString(pubKeyString: string): KeyPublic; /** * Get random brain key. * https://docs.decent.ch/developer/group___wallet_a_p_i___account.html#ga4841362854805ef897b8415eb8866424 * * @returns {string} Brain key string. */ static suggestBrainKey(): string; /** * Get brainkey info with brain key, private key and public key. * https://docs.decent.ch/developer/group___wallet_a_p_i___account.html#ga1cca4c087c272e07681b2c6d203b7d74 * * @param {string} brainKey Brain keys string. * @returns {BrainKeyInfo} BrainKeyInfo object. */ static getBrainKeyInfo(brainKey: string): BrainKeyInfo; /** * Normalize brain key for further usage in Utils's methods * * @param {string} brainKey Brain key generated from Utils.suggestBrainKey or from wallet CLI * @returns {string} Normalized brain key */ static normalize(brainKey: string): string; /** * Generate random * @returns {string} */ static generateNonce(): string; /** * Generates El Gamal public key from given El Gamal private key * * @param {string} elGamalPrivate El Gamal private key string. * @returns {string} ElGamal public key string. */ static elGamalPublic(elGamalPrivate: string): string; /** * Generates El Gamal key for content exchange from given private key WIF string * * @param {string} privateKeyWif WIF formatted private key of account for which generating El Gamal key * @returns {string} El Gamal private key string. */ static elGamalPrivate(privateKeyWif: string): string; /** * Calculate El Gamal keys pair from WIF private key * @param {string} privateKeyWif WIF formatted private key of account for which generating El Gamal keys * @returns {ElGamalKeys} ElGamalKeys object. */ static generateElGamalKeys(privateKeyWif: string): ElGamalKeys; /** * Generate random brain key and El Gamal keys from brain key. * * @returns {[BrainKeyInfo , ElGamalKeys]} */ static generateBrainKeyElGamalKey(): [BrainKeyInfo, ElGamalKeys]; /** * Calculate derived private key apart from primary(with sequence number 0). * NOTE: May be used as additional keys when creating account - owner, memo key * * @param {string} brainKey Brain key string. * @param {number} sequence Sequence number to derive private key from it. If selected 0, primary private key is generated. * @returns {KeyPrivate} KeyPrivate object. */ static derivePrivateKey(brainKey: string, sequence: number): KeyPrivate; }