diff --git a/src/wallet/MoneroWallet.cpp b/src/wallet/MoneroWallet.cpp index ce057ac..3bc4132 100644 --- a/src/wallet/MoneroWallet.cpp +++ b/src/wallet/MoneroWallet.cpp @@ -246,6 +246,35 @@ namespace monero { return syncAux(&startHeight, nullptr, &listener); } + // rescanBlockchain + + // isMultisigImportNeeded + + list MoneroWallet::getAccounts() const { + cout << "getAccounts()" << endl; + throw runtime_error("Not implemented"); + } + + list MoneroWallet::getAccounts(const bool includeSubaddresses) const { + throw runtime_error("Not implemented"); + } + + list MoneroWallet::getAccounts(const string tag) const { + throw runtime_error("Not implemented"); + } + + list MoneroWallet::getAccounts(const bool includeSubaddresses, const string tag) const { + throw runtime_error("Not implemented"); + } + + MoneroAccount MoneroWallet::getAccount(const uint32_t accountIdx) const { + throw runtime_error("Not implemented"); + } + + MoneroAccount MoneroWallet::getAccount(const uint32_t accountIdx, const bool includeSubaddresses) const { + throw runtime_error("Not implemented"); + } + string MoneroWallet::getAddress(uint32_t accountIdx, uint32_t subaddressIdx) const { return wallet2->get_subaddress_as_str({accountIdx, subaddressIdx}); } diff --git a/src/wallet/MoneroWallet.h b/src/wallet/MoneroWallet.h index 4ec974f..b893c5e 100644 --- a/src/wallet/MoneroWallet.h +++ b/src/wallet/MoneroWallet.h @@ -40,6 +40,34 @@ namespace monero { // TODO }; + /** + * Models a Monero subaddress. + */ + struct MoneroSubaddress { + uint32_t accountIndex; + uint32_t index; + string address; + string label; + uint64_t balance; + uint64_t unlockedBalance; + uint32_t numUnspentOutputs; + bool isUsed; + uint32_t numBlocksToUnlock; + }; + + /** + * Models a Monero account. + */ + struct MoneroAccount { + uint32_t index; + string primaryAddress; + string label; + uint64_t balance; + uint64_t unlockedBalance; + string tag; + vector subaddresses; + }; + // --------------------------------- LISTENERS ------------------------------ // class i_wallet2_callback @@ -304,55 +332,55 @@ namespace monero { // * @return true if importing multisig data is needed for returning a correct balance, false otherwise // */ // public boolean isMultisigImportNeeded(); -// -// /** -// * Get all accounts. -// * -// * @return List are all accounts within the wallet -// */ -// public List getAccounts(); -// -// /** -// * Get all accounts. -// * -// * @param includeSubaddresses specifies if subaddresses should be included -// * @return List are all accounts -// */ -// public List getAccounts(boolean includeSubaddresses); -// -// /** -// * Get accounts with a given tag. -// * -// * @param tag is the tag for filtering accounts, all accounts if null -// * @return List are all accounts for the wallet with the given tag -// */ -// public List getAccounts(String tag); -// -// /** -// * Get accounts with a given tag. -// * -// * @param includeSubaddresses specifies if subaddresses should be included -// * @param tag is the tag for filtering accounts, all accounts if null -// * @return List are all accounts for the wallet with the given tag -// */ -// public List getAccounts(boolean includeSubaddresses, String tag); -// -// /** -// * Get an account without subaddress information. -// * -// * @param accountIdx specifies the account to get -// * @return the retrieved account -// */ -// public MoneroAccount getAccount(int accountIdx); -// -// /** -// * Get an account. -// * -// * @param accountIdx specifies the account to get -// * @param includeSubaddresses specifies if subaddresses should be included -// * @return the retrieved account -// */ -// public MoneroAccount getAccount(int accountIdx, boolean includeSubaddresses); + + /** + * Get all accounts. + * + * @return List are all accounts within the wallet + */ + list getAccounts() const; + + /** + * Get all accounts. + * + * @param includeSubaddresses specifies if subaddresses should be included + * @return List are all accounts + */ + list getAccounts(const bool includeSubaddresses) const; + + /** + * Get accounts with a given tag. + * + * @param tag is the tag for filtering accounts, all accounts if null + * @return List are all accounts for the wallet with the given tag + */ + list getAccounts(const string tag) const; + + /** + * Get accounts with a given tag. + * + * @param includeSubaddresses specifies if subaddresses should be included + * @param tag is the tag for filtering accounts, all accounts if null + * @return List are all accounts for the wallet with the given tag + */ + list getAccounts(const bool includeSubaddresses, const string tag) const; + + /** + * Get an account without subaddress information. + * + * @param accountIdx specifies the account to get + * @return the retrieved account + */ + MoneroAccount getAccount(const uint32_t accountIdx) const; + + /** + * Get an account. + * + * @param accountIdx specifies the account to get + * @param includeSubaddresses specifies if subaddresses should be included + * @return the retrieved account + */ + MoneroAccount getAccount(const uint32_t accountIdx, const bool includeSubaddresses) const; // // /** // * Create a new account without a label.