export = MoneroWalletFull; /** * Implements a Monero wallet using fully client-side WebAssembly bindings to monero-project's wallet2 in C++. * * @extends {MoneroWalletKeys} * @implements {MoneroWallet} * @hideconstructor */ declare class MoneroWalletFull extends MoneroWalletKeys implements MoneroWallet { /** * Check if a wallet exists at a given path. * * @param {string} path - path of the wallet on the file system * @param {fs} - Node.js compatible file system to use (optional, defaults to disk if nodejs) * @return {boolean} true if a wallet exists at the given path, false otherwise */ static walletExists(path: string, fs: any): boolean; /** *

Open an existing wallet using WebAssembly bindings to wallet2.h.

* *

Examples:

* * * let wallet1 = await MoneroWalletFull.openWallet(
*    "./wallets/wallet1",
*    "supersecretpassword",
*    MoneroNetworkType.STAGENET,
*    "http://localhost:38081" // daemon uri
* );

* * let wallet2 = await MoneroWalletFull.openWallet({
*    path: "./wallets/wallet2",
*    password: "supersecretpassword",
*    networkType: MoneroNetworkType.STAGENET,
*    serverUri: "http://localhost:38081", // daemon configuration
*    serverUsername: "superuser",
*    serverPassword: "abctesting123"
* }); *
* * @param {MoneroWalletConfig|object|string} configOrPath - MoneroWalletConfig or equivalent config object or a path to a wallet to open * @param {string} configOrPath.path - path of the wallet to open (optional if 'keysData' provided) * @param {string} configOrPath.password - password of the wallet to open * @param {string|number} configOrPath.networkType - network type of the wallet to open (one of "mainnet", "testnet", "stagenet" or MoneroNetworkType.MAINNET|TESTNET|STAGENET) * @param {Uint8Array} configOrPath.keysData - wallet keys data to open (optional if path provided) * @param {Uint8Array} configOrPath.cacheData - wallet cache data to open (optional) * @param {string} configOrPath.serverUri - uri of the wallet's daemon (optional) * @param {string} configOrPath.serverUsername - username to authenticate with the daemon (optional) * @param {string} configOrPath.serverPassword - password to authenticate with the daemon (optional) * @param {boolean} configOrPath.rejectUnauthorized - reject self-signed server certificates if true (default true) * @param {MoneroRpcConnection|object} configOrPath.server - MoneroRpcConnection or equivalent JS object configuring the daemon connection (optional) * @param {boolean} configOrPath.proxyToWorker - proxies wallet operations to a worker in order to not block the main thread (default true) * @param {fs} configOrPath.fs - Node.js compatible file system to use (defaults to disk or in-memory FS if browser) * @param {string} password - password of the wallet to open * @param {string|number} networkType - network type of the wallet to open * @param {string|MoneroRpcConnection} daemonUriOrConnection - daemon URI or MoneroRpcConnection * @param {boolean} proxyToWorker - proxies wallet operations to a worker in order to not block the main thread (default true) * @param {fs} fs - Node.js compatible file system to use (defaults to disk or in-memory FS if browser) * @return {MoneroWalletFull} the opened wallet */ static openWallet(configOrPath: MoneroWalletConfig | object | string, password: string, networkType: string | number, daemonUriOrConnection: string | MoneroRpcConnection, proxyToWorker: boolean, fs: any): MoneroWalletFull; /** *

Create a wallet using WebAssembly bindings to wallet2.h.

* *

Example:

* * * let wallet = await MoneroWalletFull.createWallet({
*    path: "./test_wallets/wallet1", // leave blank for in-memory wallet
*    password: "supersecretpassword",
*    networkType: MoneroNetworkType.STAGENET,
*    mnemonic: "coexist igloo pamphlet lagoon...",
*    restoreHeight: 1543218,
*    server: new MoneroRpcConnection("http://localhost:38081", "daemon_user", "daemon_password_123"),
* }); *
* * @param {object|MoneroWalletConfig} config - MoneroWalletConfig or equivalent config object * @param {string} config.path - path of the wallet to create (optional, in-memory wallet if not given) * @param {string} config.password - password of the wallet to create * @param {string|number} config.networkType - network type of the wallet to create (one of "mainnet", "testnet", "stagenet" or MoneroNetworkType.MAINNET|TESTNET|STAGENET) * @param {string} config.mnemonic - mnemonic of the wallet to create (optional, random wallet created if neither mnemonic nor keys given) * @param {string} config.seedOffset - the offset used to derive a new seed from the given mnemonic to recover a secret wallet from the mnemonic phrase * @param {string} config.primaryAddress - primary address of the wallet to create (only provide if restoring from keys) * @param {string} config.privateViewKey - private view key of the wallet to create (optional) * @param {string} config.privateSpendKey - private spend key of the wallet to create (optional) * @param {number} config.restoreHeight - block height to start scanning from (defaults to 0 unless generating random wallet) * @param {string} config.language - language of the wallet's mnemonic phrase (defaults to "English" or auto-detected) * @param {number} config.accountLookahead - number of accounts to scan (optional) * @param {number} config.subaddressLookahead - number of subaddresses to scan per account (optional) * @param {string} config.serverUri - uri of the wallet's daemon (optional) * @param {string} config.serverUsername - username to authenticate with the daemon (optional) * @param {string} config.serverPassword - password to authenticate with the daemon (optional) * @param {boolean} config.rejectUnauthorized - reject self-signed server certificates if true (defaults to true) * @param {MoneroRpcConnection|object} config.server - MoneroRpcConnection or equivalent JS object providing daemon configuration (optional) * @param {boolean} config.proxyToWorker - proxies wallet operations to a worker in order to not block the main thread (default true) * @param {fs} config.fs - Node.js compatible file system to use (defaults to disk or in-memory FS if browser) * @return {MoneroWalletFull} the created wallet */ static createWallet(config: object | MoneroWalletConfig): MoneroWalletFull; static _createWalletFromMnemonic(config: any): Promise; static _createWalletFromKeys(config: any): Promise; static _createWalletRandom(config: any): Promise; static _getFs(): any; static _openWalletData(path: any, password: any, networkType: any, keysData: any, cacheData: any, daemonUriOrConnection: any, proxyToWorker: any, fs: any): Promise; static _sanitizeBlock(block: any): any; static _sanitizeTxWallet(tx: any): MoneroTxWallet; static _sanitizeAccount(account: any): any; static _sanitizeSubaddress(subaddress: any): any; static _deserializeBlocks(blocksJsonStr: any): { blocks: any[]; missingTxHashes: any[]; }; static _deserializeTxs(query: any, blocksJsonStr: any, missingTxHashes: any): any[]; static _deserializeTransfers(query: any, blocksJsonStr: any): any[]; static _deserializeOutputs(query: any, blocksJsonStr: any): any[]; static _moveTo(path: any, wallet: any): Promise; static _save(wallet: any): Promise; /** * Internal constructor which is given the memory address of a C++ wallet * instance. * * This method should not be called externally but should be called through * static wallet creation utilities in this class. * * @param {int} cppAddress - address of the wallet instance in C++ * @param {string} path - path of the wallet instance * @param {string} password - password of the wallet instance * @param {FileSystem} fs - node.js-compatible file system to read/write wallet files * @param {boolean} rejectUnauthorized - specifies if unauthorized requests (e.g. self-signed certificates) should be rejected * @param {string} rejectUnauthorizedFnId - unique identifier for http_client_wasm to query rejectUnauthorized */ constructor(cppAddress: int, path: string, password: string, fs: FileSystem, rejectUnauthorized: boolean, rejectUnauthorizedFnId: string); _path: string; _password: string; _listeners: any[]; _fs: any; _isClosed: boolean; _fullListener: WalletFullListener; _fullListenerHandle: number; _rejectUnauthorized: boolean; _rejectUnauthorizedConfigId: string; _syncPeriodInMs: number; /** * Get the maximum height of the peers the wallet's daemon is connected to. * * @return {number} the maximum height of the peers the wallet's daemon is connected to */ getDaemonMaxPeerHeight(): number; /** * Indicates if the wallet's daemon is synced with the network. * * @return {boolean} true if the daemon is synced with the network, false otherwise */ isDaemonSynced(): boolean; /** * Indicates if the wallet is synced with the daemon. * * @return {boolean} true if the wallet is synced with the daemon, false otherwise */ isSynced(): boolean; /** * Get the wallet's network type (mainnet, testnet, or stagenet). * * @return {MoneroNetworkType} the wallet's network type */ getNetworkType(): MoneroNetworkType; /** * Get the height of the first block that the wallet scans. * * @return {number} the height of the first block that the wallet scans */ getSyncHeight(): number; /** * Set the height of the first block that the wallet scans. * * @param {number} syncHeight - height of the first block that the wallet scans */ setSyncHeight(syncHeight: number): Promise; /** * Move the wallet from its current path to the given path. * * @param {string} path - the wallet's destination path */ moveTo(path: string): Promise; setDaemonConnection(uriOrRpcConnection: any): Promise; getDaemonConnection(): Promise; isConnectedToDaemon(): Promise; getVersion(): Promise; getPath(): Promise; getIntegratedAddress(standardAddress: any, paymentId: any): Promise; decodeIntegratedAddress(integratedAddress: any): Promise; getHeight(): Promise; getDaemonHeight(): Promise; getHeightByDate(year: any, month: any, day: any): Promise; /** * Synchronize the wallet with the daemon as a one-time synchronous process. * * @param {MoneroWalletListener|number} listenerOrStartHeight - listener xor start height (defaults to no sync listener, the last synced block) * @param {number} startHeight - startHeight if not given in first arg (defaults to last synced block) * @param {bool} allowConcurrentCalls - allow other wallet methods to be processed simultaneously during sync (default false)

WARNING: enabling this option will crash wallet execution if another call makes a simultaneous network request. TODO: possible to sync wasm network requests in http_client_wasm.cpp? */ sync(listenerOrStartHeight: MoneroWalletListener | number, startHeight: number, allowConcurrentCalls: bool): Promise; startSyncing(syncPeriodInMs: any): Promise; _syncLooper: TaskLooper; scanTxs(txHashes: any): Promise; rescanSpent(): Promise; rescanBlockchain(): Promise; getCirculatingSupply(): Promise; getBlockCap(): Promise; getMaxDestinationAmount(sourceAssetType: any, destinationAssetType: any): Promise; getCollateralRequirements(sourceAssetType: any, destinationAssetType: any, amount: any): Promise; getBalance(accountIdx: any, subaddressIdx: any, assetType: any): Promise; getUnlockedBalance(accountIdx: any, subaddressIdx: any, assetType: any): Promise; getUnauditedBalance(unlocked_only: any): Promise; hasSpendableOldOutputs(): Promise; getAccounts(includeSubaddresses: any, tag: any): Promise; getAccount(accountIdx: any, includeSubaddresses: any): Promise; createAccount(label: any): Promise; getSubaddresses(accountIdx: any, subaddressIndices: any): Promise; createSubaddress(accountIdx: any, label: any): Promise; getTxs(query: any, missingTxHashes: any): Promise; getTransfers(query: any): Promise; getOutputs(query: any): Promise; exportOutputs(all: any): Promise; importOutputs(outputsHex: any): Promise; exportKeyImages(all: any): Promise; importKeyImages(keyImages: any): Promise; getNewKeyImagesFromLastImport(): Promise; freezeOutput(keyImage: any): Promise; thawOutput(keyImage: any): Promise; isOutputFrozen(keyImage: any): Promise; createTxs(config: any): Promise; createAuditTxs(address: any, keep_subaddress: any, priority: any, relay: any): Promise; sweepOutput(config: any): Promise; sweepUnlocked(config: any): Promise; sweepDust(relay: any): Promise; relayTxs(txsOrMetadatas: any): Promise; describeTxSet(txSet: any): Promise; signTxs(unsignedTxHex: any): Promise; submitTxs(signedTxHex: any): Promise; signMessage(message: any, signatureType: any, accountIdx: any, subaddressIdx: any): Promise; verifyMessage(message: any, address: any, signature: any): Promise; getTxKey(txHash: any): Promise; checkTxKey(txHash: any, txKey: any, address: any): Promise; getTxProof(txHash: any, address: any, message: any): Promise; checkTxProof(txHash: any, address: any, message: any, signature: any): Promise; getSpendProof(txHash: any, message: any): Promise; checkSpendProof(txHash: any, message: any, signature: any): Promise; getReserveProofWallet(message: any): Promise; getReserveProofAccount(accountIdx: any, amount: any, message: any): Promise; checkReserveProof(address: any, message: any, signature: any): Promise; getTxNotes(txHashes: any): Promise; setTxNotes(txHashes: any, notes: any): Promise; getAddressBookEntries(entryIndices: any): Promise; addAddressBookEntry(address: any, description: any): Promise; editAddressBookEntry(index: any, setAddress: any, address: any, setDescription: any, description: any): Promise; deleteAddressBookEntry(entryIdx: any): Promise; tagAccounts(tag: any, accountIndices: any): Promise; untagAccounts(accountIndices: any): Promise; getAccountTags(): Promise; setAccountTagLabel(tag: any, label: any): Promise; getPaymentUri(config: any): Promise; parsePaymentUri(uri: any): Promise; getAttribute(key: any): Promise; setAttribute(key: any, val: any): Promise; startMining(numThreads: any, backgroundMining: any, ignoreBattery: any): Promise; isMultisigImportNeeded(): Promise; isMultisig(): Promise; getMultisigInfo(): Promise; prepareMultisig(): Promise; makeMultisig(multisigHexes: any, threshold: any, password: any): Promise; exchangeMultisigKeys(multisigHexes: any, password: any): Promise; exportMultisigHex(): Promise; importMultisigHex(multisigHexes: any): Promise; signMultisigTxHex(multisigTxHex: any): Promise; submitMultisigTxHex(signedMultisigTxHex: any): Promise; /** * Get the wallet's keys and cache data. * * @return {DataView[]} is the keys and cache data respectively */ getData(): DataView[]; changePassword(oldPassword: any, newPassword: any): Promise; save(): Promise; close(save: any): Promise; getNumBlocksToUnlock(...args: any[]): Promise; getTx(...args: any[]): Promise; getIncomingTransfers(...args: any[]): Promise; getOutgoingTransfers(...args: any[]): Promise; createTx(...args: any[]): Promise; relayTx(...args: any[]): Promise; getTxNote(...args: any[]): Promise; setTxNote(...args: any[]): Promise; _backgroundSync(): Promise; _refreshListening(): Promise; /** * Set the path of the wallet on the browser main thread if run as a worker. * * @param {string} browserMainPath - path of the wallet on the browser main thread */ _setBrowserMainPath(browserMainPath: string): void; _browserMainPath: string; } declare namespace MoneroWalletFull { const DEFAULT_SYNC_PERIOD_IN_MS: number; } import MoneroWallet = require("./MoneroWallet"); import MoneroWalletKeys = require("./MoneroWalletKeys"); /** * Receives notifications directly from wasm c++. * * @private */ declare class WalletFullListener { constructor(wallet: any); _wallet: any; onSyncProgress(height: any, startHeight: any, endHeight: any, percentDone: any, message: any): Promise; onNewBlock(height: any): Promise; onBalancesChanged(newBalanceStr: any, newUnlockedBalanceStr: any, newUnauditedBalanceStr: any, newUnlockedUnauditedBalanceStr: any, assetType: any): Promise; onOutputReceived(height: any, txHash: any, amountStr: any, assetType: any, accountIdx: any, subaddressIdx: any, version: any, unlockHeight: any, isLocked: any): Promise; onOutputSpent(height: any, txHash: any, amountStr: any, assetType: any, accountIdxStr: any, subaddressIdxStr: any, version: any): Promise; } import MoneroNetworkType = require("../daemon/model/MoneroNetworkType"); import MoneroWalletListener = require("./model/MoneroWalletListener"); import TaskLooper = require("../common/TaskLooper"); import MoneroWalletConfig = require("./model/MoneroWalletConfig"); import MoneroRpcConnection = require("../common/MoneroRpcConnection"); import MoneroTxWallet = require("./model/MoneroTxWallet");