diff --git a/src/wallet/MoneroWallet.cpp b/src/wallet/MoneroWallet.cpp index cfdf773..2d7ef54 100644 --- a/src/wallet/MoneroWallet.cpp +++ b/src/wallet/MoneroWallet.cpp @@ -1089,6 +1089,11 @@ namespace monero { return keyImages; } + shared_ptr MoneroWallet::importKeyImages(const vector& keyImages) { + cout << "MoneroWalelt::importKeyImages()" << endl; + throw runtime_error("Not implemented"); + } + vector> MoneroWallet::sendSplit(const MoneroSendRequest& request) { cout << "MoneroWallet::sendSplit(request)" << endl; cout << "MoneroSendRequest: " << request.serialize() << endl; diff --git a/src/wallet/MoneroWallet.h b/src/wallet/MoneroWallet.h index f463b60..b834927 100644 --- a/src/wallet/MoneroWallet.h +++ b/src/wallet/MoneroWallet.h @@ -582,14 +582,14 @@ namespace monero { */ vector> getKeyImages() const; -// /** -// * Import signed key images and verify their spent status. -// * -// * @param keyImages are key images to import and verify (requires hex and signature) -// * @return results of the import -// */ -// public MoneroKeyImageImportResult importKeyImages(List keyImages); -// + /** + * Import signed key images and verify their spent status. + * + * @param keyImages are key images to import and verify (requires hex and signature) + * @return results of the import + */ + shared_ptr importKeyImages(const vector& keyImages); + // /** // * Get new key images from the last imported outputs. // * diff --git a/src/wallet/MoneroWalletModel.cpp b/src/wallet/MoneroWalletModel.cpp index fca48c1..30b6da9 100644 --- a/src/wallet/MoneroWalletModel.cpp +++ b/src/wallet/MoneroWalletModel.cpp @@ -389,7 +389,7 @@ namespace monero { return node; } - // -------------------------- MONERO INTEGRATED ADDRESS ----------------------------- + // ---------------------- MONERO INTEGRATED ADDRESS ------------------------- boost::property_tree::ptree MoneroIntegratedAddress::toPropertyTree() const { boost::property_tree::ptree node; @@ -398,4 +398,14 @@ namespace monero { node.put("integratedAddress", integratedAddress); return node; } + + // -------------------- MONERO KEY IMAGE IMPORT RESULT ---------------------- + + boost::property_tree::ptree MoneroKeyImageImportResult::toPropertyTree() const { + boost::property_tree::ptree node; + if (height != boost::none) node.put("height", *height); + if (spentAmount != boost::none) node.put("spentAmount", *spentAmount); + if (unspentAmount != boost::none) node.put("unspentAmount", *unspentAmount); + return node; + } } diff --git a/src/wallet/MoneroWalletModel.h b/src/wallet/MoneroWalletModel.h index 477313b..466124c 100644 --- a/src/wallet/MoneroWalletModel.h +++ b/src/wallet/MoneroWalletModel.h @@ -254,4 +254,15 @@ namespace monero { boost::property_tree::ptree toPropertyTree() const; }; + + /** + * Models results from importing key images. + */ + struct MoneroKeyImageImportResult : public SerializableStruct { + boost::optional height; + boost::optional spentAmount; + boost::optional unspentAmount; + + boost::property_tree::ptree toPropertyTree() const; + }; }