aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2_api.h
diff options
context:
space:
mode:
authorIlya Kitaev <mbg033@gmail.com>2016-06-23 14:38:22 +0300
committerIlya Kitaev <mbg033@gmail.com>2016-06-23 16:01:41 +0300
commitca6115300315e9d34c0134933345019672d2f0c0 (patch)
tree832b7e2ab6fc82cc2a9071a11cf8b9a26ef9f6b9 /src/wallet/wallet2_api.h
parentPendingTransactionImpl: pointer->reference (diff)
downloadmonero-ca6115300315e9d34c0134933345019672d2f0c0.tar.xz
Wallet: payment id and integrated address
Diffstat (limited to 'src/wallet/wallet2_api.h')
-rw-r--r--src/wallet/wallet2_api.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/wallet/wallet2_api.h b/src/wallet/wallet2_api.h
index de0b50591..c0c3d436a 100644
--- a/src/wallet/wallet2_api.h
+++ b/src/wallet/wallet2_api.h
@@ -135,6 +135,16 @@ struct Wallet
virtual bool setPassword(const std::string &password) = 0;
virtual std::string address() const = 0;
/*!
+ * \brief integratedAddress - returns integrated address for current wallet address and given payment_id.
+ * if passed "payment_id" param is an empty string or not-valid payment id string
+ * (16 characters hexadecimal string) - random payment_id will be generated
+ *
+ * \param payment_id - 16 characters hexadecimal string or empty string if new random payment id needs to be
+ * generated
+ * \return - 106 characters string representing integrated address
+ */
+ virtual std::string integratedAddress(const std::string &payment_id) const = 0;
+ /*!
* \brief store - stores wallet to file.
* \param path - main filename to store wallet to. additionally stores address file and keys file.
* to store to the same file - just pass empty string;
@@ -162,19 +172,22 @@ struct Wallet
static std::string displayAmount(uint64_t amount);
static uint64_t amountFromString(const std::string &amount);
static uint64_t amountFromDouble(double amount);
+ static std::string genPaymentId();
// TODO?
// virtual uint64_t unlockedDustBalance() const = 0;
virtual bool refresh() = 0;
/*!
- * \brief createTransaction creates transaction
+ * \brief createTransaction creates transaction. if dst_addr is an integrated address, payment_id is ignored
* \param dst_addr destination address as string
+ * \param payment_id optional payment_id, can be empty string
* \param amount amount
* \param mixin_count mixin count. if 0 passed, wallet will use default value
* \return PendingTransaction object. caller is responsible to check PendingTransaction::status()
* after object returned
*/
- virtual PendingTransaction * createTransaction(const std::string &dst_addr, uint64_t amount, uint32_t mixin_count) = 0;
+ virtual PendingTransaction * createTransaction(const std::string &dst_addr, const std::string &payment_id,
+ uint64_t amount, uint32_t mixin_count) = 0;
virtual void disposeTransaction(PendingTransaction * t) = 0;
virtual TransactionHistory * history() const = 0;
virtual void setListener(WalletListener *) = 0;