From 8805d0ce88274d3bf095e48ef3894fd8f9a33a1a Mon Sep 17 00:00:00 2001 From: woodser Date: Sun, 26 May 2019 22:22:58 -0400 Subject: [PATCH] defined MoneroWallet constructors --- src/wallet/MoneroWallet.h | 47 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/src/wallet/MoneroWallet.h b/src/wallet/MoneroWallet.h index 0b1eba8..63385ea 100644 --- a/src/wallet/MoneroWallet.h +++ b/src/wallet/MoneroWallet.h @@ -1,7 +1,11 @@ using namespace std; +using namespace crypto; +using namespace cryptonote; /** * Monero wallet interface. + * + * TODO: daemonConnection is object with uri, username, and password */ class MoneroWallet { @@ -10,10 +14,51 @@ using namespace std; public: /** - * Construct the wallet. TODO + * Construct a wallet with a randomly generated seed. */ MoneroWallet(); + /** + * Construct a wallet with a randomly generated seed. + * + * @param networkType is the wallet's network type (default = MoneroNetworkType.MAINNET) + * @param daemonConnection is connection information to a daemon (default = an unconnected wallet) + * @param language is the wallet and mnemonic's language (default = "English") + */ + MoneroWallet(network_type networkType, string daemonConnection, string language); + + /** + * Construct a wallet from a mnemonic phrase. + * + * @param mnemonic is the mnemonic of the wallet to construct + * @param networkType is the wallet's network type + * @param daemonConnection is connection information to a daemon (default = an unconnected wallet) + * @param restoreHeight is the block height to restore (i.e. scan the chain) from (default = 0) + */ + MoneroWallet(string mnemonic, network_type networkType, string daemonConnection, uint64_t restoreHeight); + + /** + * Construct a wallet from an address, view key, and spend key. + * + * @param address is the address of the wallet to construct + * @param viewKey is the view key of the wallet to construct + * @param spendKey is the spend key of the wallet to construct + * @param networkType is the wallet's network type + * @param daemonConnection is connection information to a daemon (default = an unconnected wallet) + * @param restoreHeight is the block height to restore (i.e. scan the chain) from (default = 0) + * @param language is the wallet and mnemonic's language (default = "English") + */ + MoneroWallet(string address, string viewKey, string spendKey, network_type networkType, string daemonConnection, uint64_t restoreHeight, string language); + + /** + * Construct a wallet by opening a wallet file on disk. + * + * @param path is the path to the wallet file to open + * @param password is the password of the wallet file to open + * @param networkType is the wallet's network type + */ + MoneroWallet(string path, string password, network_type networkType); + /** * Deconstructs the wallet. */