///
Create a client connected to monero-wallet-rpc (for internal use).
* * @param {string|string[]|object|MoneroRpcConnection} uriOrConfig - uri of monero-wallet-rpc or terminal parameters or JS config object or MoneroRpcConnection * @param {string} uriOrConfig.uri - uri of monero-wallet-rpc * @param {string} uriOrConfig.username - username to authenticate with monero-wallet-rpc (optional) * @param {string} uriOrConfig.password - password to authenticate with monero-wallet-rpc (optional) * @param {boolean} uriOrConfig.rejectUnauthorized - rejects self-signed certificates if true (default true) * @param {string} username - username to authenticate with monero-wallet-rpc (optional) * @param {string} password - password to authenticate with monero-wallet-rpc (optional) * @param {boolean} rejectUnauthorized - rejects self-signed certificates if true (default true) * @return {MoneroWalletRpc} the wallet RPC client */ static _connectToWalletRpc(uriOrConfig: string | string[] | object | MoneroRpcConnection, username: string, password: string, rejectUnauthorized: boolean, ...args: any[]): MoneroWalletRpc; static _startWalletRpcProcess(cmd: any): PromiseConstruct a wallet RPC client (for internal use).
* * @param {string|object|MoneroRpcConnection|string[]} uriOrConfig - uri of monero-wallet-rpc or JS config object or MoneroRpcConnection or command line parameters to run a monero-wallet-rpc process internally * @param {string} uriOrConfig.uri - uri of monero-wallet-rpc * @param {string} uriOrConfig.username - username to authenticate with monero-wallet-rpc (optional) * @param {string} uriOrConfig.password - password to authenticate with monero-wallet-rpc (optional) * @param {boolean} uriOrConfig.rejectUnauthorized - rejects self-signed certificates if true (default true) * @param {string} username - username to authenticate with monero-wallet-rpc (optional) * @param {string} password - password to authenticate with monero-wallet-rpc (optional) * @param {boolean} rejectUnauthorized - rejects self-signed certificates if true (default true) */ constructor(uriOrConfig: string | object | MoneroRpcConnection | string[], username: string, password: string, rejectUnauthorized: boolean); config: any; rpc: MoneroRpcConnection; addressCache: {}; syncPeriodInMs: number; listeners: any[]; /** * Get the internal process running monero-wallet-rpc. * * @return the process running monero-wallet-rpc, undefined if not created from new process */ getProcess(): any; /** * Stop the internal process running monero-wallet-rpc, if applicable. */ stopProcess(): PromiseOpen an existing wallet on the monero-wallet-rpc server.
* *Example:
*
*
* let wallet = new MoneroWalletRpc("http://localhost:38084", "rpc_user", "abc123");
*
* @param {string|object|MoneroWalletConfig} pathOrConfig - the wallet's name or configuration to open
* @param {string} pathOrConfig.path - path of the wallet to create (optional, in-memory wallet if not given)
* @param {string} pathOrConfig.password - password of the wallet to create
* @param {string} pathOrConfig.serverUri - uri of a daemon to use (optional, monero-wallet-rpc usually started with daemon config)
* @param {string} pathOrConfig.serverUsername - username to authenticate with the daemon (optional)
* @param {string} pathOrConfig.serverPassword - password to authenticate with the daemon (optional)
* @param {boolean} pathOrConfig.rejectUnauthorized - reject self-signed server certificates if true (defaults to true)
* @param {MoneroRpcConnection|object} pathOrConfig.server - MoneroRpcConnection or equivalent JS object providing daemon configuration (optional)
* @param {string} password is the wallet's password
* @return {MoneroWalletRpc} this wallet client
*/
openWallet(pathOrConfig: string | object | MoneroWalletConfig, password: string): MoneroWalletRpc;
path: any;
/**
*
* await wallet.openWallet("mywallet1", "supersecretpassword");
* await wallet.openWallet({
* path: "mywallet2",
* password: "supersecretpassword",
* serverUri: "http://locahost:38081",
* rejectUnauthorized: false
* });
*
Create and open a wallet on the monero-wallet-rpc server.
* *
Example:
*
*
* // construct client to monero-wallet-rpc
*
* @param {object|MoneroWalletConfig} config - MoneroWalletConfig or equivalent JS 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} 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 {string} config.serverUri - uri of a daemon to use (optional, monero-wallet-rpc usually started with daemon config)
* @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.saveCurrent - specifies if the current RPC wallet should be saved before being closed (default true)
* @return {MoneroWalletRpc} this wallet client
*/
createWallet(config: object | MoneroWalletConfig): MoneroWalletRpc;
/**
* Create and open a new wallet with a randomly generated seed on the RPC server.
*
* @param {string} name - name of the wallet file to create
* @param {string} password - wallet's password
* @param {string} language - language for the wallet's mnemonic phrase
* @return {MoneroWalletRpc} this wallet client
*/
_createWalletRandom(name: string, password: string, language: string): MoneroWalletRpc;
/**
* Create and open a wallet from an existing mnemonic phrase on the RPC server,
* closing the currently open wallet if applicable.
*
* @param {string} name - name of the wallet to create on the RPC server
* @param {string} password - wallet's password
* @param {string} mnemonic - mnemonic of the wallet to construct
* @param {int} restoreHeight - block height to restore from (default = 0)
* @param {string} language - language of the mnemonic in case the old language is invalid
* @param {string} seedOffset - offset used to derive a new seed from the given mnemonic to recover a secret wallet from the mnemonic phrase
* @param {boolean} saveCurrent - specifies if the current RPC wallet should be saved before being closed
* @return {MoneroWalletRpc} this wallet client
*/
_createWalletFromMnemonic(name: string, password: string, mnemonic: string, restoreHeight: int, language: string, seedOffset: string, saveCurrent: boolean): MoneroWalletRpc;
/**
* Create a wallet on the RPC server from an address, view key, and (optionally) spend key.
*
* @param name - name of the wallet to create on the RPC server
* @param password - password encrypt the wallet
* @param networkType - wallet's network type
* @param address - address of the wallet to construct
* @param viewKey - view key of the wallet to construct
* @param spendKey - spend key of the wallet to construct or null to create a view-only wallet
* @param restoreHeight - block height to restore (i.e. scan the chain) from (default = 0)
* @param language - wallet and mnemonic's language (default = "English")
* @return {MoneroWalletRpc} this wallet client
*/
_createWalletFromKeys(name: any, password: any, address: any, viewKey: any, spendKey: any, restoreHeight: any, language: any, saveCurrent: any): MoneroWalletRpc;
_handleCreateWalletError(name: any, err: any): void;
isViewOnly(): Promise
* let walletRpc = new MoneroWalletRpc("http://localhost:38084", "rpc_user", "abc123");
*
* // create and open wallet on monero-wallet-rpc
* await walletRpc.createWallet({
* path: "mywallet",
* password: "abc123",
* mnemonic: "coexist igloo pamphlet lagoon...",
* restoreHeight: 1543218l
* });
*