/// import { PathLike } from "fs"; import { EncryptedData } from "./crypto"; import { Mnemonic } from "./mnemonic"; import { UserSecretKey } from "./userKeys"; interface IRandomness { id: string; iv: Buffer; salt: Buffer; } export declare enum UserWalletKind { SecretKey = "secretKey", Mnemonic = "mnemonic" } export declare class UserWallet { private readonly kind; private readonly encryptedData; private readonly publicKeyWhenKindIsSecretKey?; private constructor(); static fromSecretKey({ secretKey, password, randomness, }: { secretKey: UserSecretKey; password: string; randomness?: IRandomness; }): UserWallet; static fromMnemonic({ mnemonic, password, randomness, }: { mnemonic: string; password: string; randomness?: IRandomness; }): UserWallet; static loadSecretKey(filePath: string, password: string, addressIndex?: number): UserSecretKey; static decrypt(keyFileObject: any, password: string, addressIndex?: number): UserSecretKey; /** * Copied from: https://github.com/multiversx/mx-deprecated-core-js/blob/v1.28.0/src/account.js#L42 * Notes: adjustements (code refactoring, no change in logic), in terms of: * - typing (since this is the TypeScript version) * - error handling (in line with sdk-core's error system) * - references to crypto functions * - references to object members * * From an encrypted keyfile, given the password, loads the secret key and the public key. */ static decryptSecretKey(keyFileObject: any, password: string): UserSecretKey; static decryptMnemonic(keyFileObject: any, password: string): Mnemonic; static edFromJSON(keyfileObject: any): EncryptedData; /** * Converts the encrypted keyfile to plain JavaScript object. */ toJSON(addressHrp?: string): any; private toJSONWhenKindIsSecretKey; getCryptoSectionAsJSON(): any; toJSONWhenKindIsMnemonic(): any; save(path: PathLike, addressHrp?: string): void; } export {};