diff --git a/src/wallet/MoneroWallet.cpp b/src/wallet/MoneroWallet.cpp index 1ab6eb9..aea6ea2 100644 --- a/src/wallet/MoneroWallet.cpp +++ b/src/wallet/MoneroWallet.cpp @@ -852,6 +852,11 @@ namespace monero { return vouts; } + vector> MoneroWallet::sendTxs(const MoneroSendRequest& request) { + cout << "MoneroWallet::sendTxs(request)" << endl; + throw runtime_error("not implemented"); + } + void MoneroWallet::save() { cout << "save()" << endl; save("", ""); diff --git a/src/wallet/MoneroWallet.h b/src/wallet/MoneroWallet.h index f050bae..1661fff 100644 --- a/src/wallet/MoneroWallet.h +++ b/src/wallet/MoneroWallet.h @@ -596,15 +596,16 @@ namespace monero { // * @return the key images from the last imported outputs // */ // public List getNewKeyImagesFromLastImport(); -// -// /** -// * Create and relay (depending on configuration) a transaction which -// * transfers funds from this wallet to one or more destination addresses. -// * -// * @param request configures the transaction -// * @return the resulting transaction -// */ -// public MoneroTxWallet send(MoneroSendRequest request); + + /** + * Create one or more transactions which transfer funds from this wallet to + * one or more destinations depending on the given configuration. + * + * @param request configures the transaction + * @return the resulting transaction + */ + vector> sendTxs(const MoneroSendRequest& request); + // // /** // * Create and relay a transaction which transfers funds from this wallet to diff --git a/src/wallet/MoneroWalletModel.cpp b/src/wallet/MoneroWalletModel.cpp index abc45e2..434ac55 100644 --- a/src/wallet/MoneroWalletModel.cpp +++ b/src/wallet/MoneroWalletModel.cpp @@ -371,6 +371,12 @@ namespace monero { return true; } + // ------------------------- MONERO SEND REQUEST ---------------------------- + + boost::property_tree::ptree MoneroSendRequest::toPropertyTree() const { + throw runtime_error("MoneroSendRequest::toPropertyTree() not implemented"); + } + // -------------------------- MONERO INTEGRATED ADDRESS ----------------------------- boost::property_tree::ptree MoneroIntegratedAddress::toPropertyTree() const { diff --git a/src/wallet/MoneroWalletModel.h b/src/wallet/MoneroWalletModel.h index 712bbc4..477313b 100644 --- a/src/wallet/MoneroWalletModel.h +++ b/src/wallet/MoneroWalletModel.h @@ -218,4 +218,40 @@ namespace monero { boost::property_tree::ptree toPropertyTree() const; }; + + /** + * Enumerates Monero network types. + */ + enum MoneroSendPriority : uint8_t { + DEFAULT = 0, + UNIMPORTANT, + NORMAL, + ELEVATED + }; + + /** + * Configures a request to send/sweep funds or create a payment URI. + * + * TODO: allow setAddress(), setAmount() for default destination? + */ + struct MoneroSendRequest : public SerializableStruct { + vector> destinations; + boost::optional paymentId; + boost::optional priority; + boost::optional mixin; + boost::optional ringSize; + boost::optional fee; + boost::optional accountIndex; + vector subaddressIndices; + boost::optional unlockTime; + boost::optional canSplit; + boost::optional doNotRelay; + boost::optional note; + boost::optional recipientName; + boost::optional belowAmount; + boost::optional sweepEachSubaddress; + boost::optional keyImage; + + boost::property_tree::ptree toPropertyTree() const; + }; }