aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2_api.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/wallet2_api.h')
-rw-r--r--src/wallet/wallet2_api.h65
1 files changed, 64 insertions, 1 deletions
diff --git a/src/wallet/wallet2_api.h b/src/wallet/wallet2_api.h
index 8427ba250..f0a9ea68b 100644
--- a/src/wallet/wallet2_api.h
+++ b/src/wallet/wallet2_api.h
@@ -65,6 +65,12 @@ struct PendingTransaction
virtual uint64_t amount() const = 0;
virtual uint64_t dust() const = 0;
virtual uint64_t fee() const = 0;
+ virtual std::vector<std::string> txid() const = 0;
+ /*!
+ * \brief txCount - number of transactions current transaction will be splitted to
+ * \return
+ */
+ virtual uint64_t txCount() const = 0;
};
/**
@@ -159,6 +165,12 @@ struct Wallet
Status_Error
};
+ enum ConnectionStatus {
+ ConnectionStatus_Disconnected,
+ ConnectionStatus_Connected,
+ ConnectionStatus_WrongVersion
+ };
+
virtual ~Wallet() = 0;
virtual std::string seed() const = 0;
virtual std::string getSeedLanguage() const = 0;
@@ -243,7 +255,7 @@ struct Wallet
* @brief connected - checks if the wallet connected to the daemon
* @return - true if connected
*/
- virtual bool connected() const = 0;
+ virtual ConnectionStatus connected() const = 0;
virtual void setTrustedDaemon(bool arg) = 0;
virtual bool trustedDaemon() const = 0;
virtual uint64_t balance() const = 0;
@@ -324,6 +336,14 @@ struct Wallet
PendingTransaction::Priority = PendingTransaction::Priority_Low) = 0;
/*!
+ * \brief createSweepUnmixableTransaction creates transaction with unmixable outputs.
+ * \return PendingTransaction object. caller is responsible to check PendingTransaction::status()
+ * after object returned
+ */
+
+ virtual PendingTransaction * createSweepUnmixableTransaction() = 0;
+
+ /*!
* \brief disposeTransaction - destroys transaction object
* \param t - pointer to the "PendingTransaction" object. Pointer is not valid after function returned;
*/
@@ -340,6 +360,36 @@ struct Wallet
* \param arg
*/
virtual void setDefaultMixin(uint32_t arg) = 0;
+
+ /*!
+ * \brief setUserNote - attach an arbitrary string note to a txid
+ * \param txid - the transaction id to attach the note to
+ * \param note - the note
+ * \return true if succesful, false otherwise
+ */
+ virtual bool setUserNote(const std::string &txid, const std::string &note) = 0;
+ /*!
+ * \brief getUserNote - return an arbitrary string note attached to a txid
+ * \param txid - the transaction id to attach the note to
+ * \return the attached note, or empty string if there is none
+ */
+ virtual std::string getUserNote(const std::string &txid) const = 0;
+ virtual std::string getTxKey(const std::string &txid) const = 0;
+
+ /*
+ * \brief signMessage - sign a message with the spend private key
+ * \param message - the message to sign (arbitrary byte data)
+ * \return the signature
+ */
+ virtual std::string signMessage(const std::string &message) = 0;
+ /*!
+ * \brief verifySignedMessage - verify a signature matches a given message
+ * \param message - the message (arbitrary byte data)
+ * \param address - the address the signature claims to be made with
+ * \param signature - the signature
+ * \return true if the signature verified, false otherwise
+ */
+ virtual bool verifySignedMessage(const std::string &message, const std::string &addres, const std::string &signature) const = 0;
};
/**
@@ -400,6 +450,19 @@ struct WalletManager
*/
virtual std::vector<std::string> findWallets(const std::string &path) = 0;
+ /*!
+ * \brief checkPayment - checks a payment was made using a txkey
+ * \param address - the address the payment was sent to
+ * \param txid - the transaction id for that payment
+ * \param txkey - the transaction's secret key
+ * \param daemon_address - the address (host and port) to the daemon to request transaction data
+ * \param received - if succesful, will hold the amount of monero received
+ * \param height - if succesful, will hold the height of the transaction (0 if only in the pool)
+ * \param error - if unsuccesful, will hold an error string with more information about the error
+ * \return - true is succesful, false otherwise
+ */
+ virtual bool checkPayment(const std::string &address, const std::string &txid, const std::string &txkey, const std::string &daemon_address, uint64_t &received, uint64_t &height, std::string &error) const = 0;
+
//! returns verbose error string regarding last error;
virtual std::string errorString() const = 0;