aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2_api.h
diff options
context:
space:
mode:
authorIlya Kitaev <mbg033@gmail.com>2016-04-05 15:24:44 +0300
committerIlya Kitaev <mbg033@gmail.com>2016-06-23 15:49:54 +0300
commit951f3b5d83d0c0c5a1ca2f2bd36cf5659600a44a (patch)
tree62eb07f84060e63e07b65e103608c38490155a09 /src/wallet/wallet2_api.h
parentWallet::transfer in progress (diff)
downloadmonero-951f3b5d83d0c0c5a1ca2f2bd36cf5659600a44a.tar.xz
Wallet::createTransaction API introduced
Transaction API continued TODOs for Transaction/Transfer interface
Diffstat (limited to '')
-rw-r--r--src/wallet/wallet2_api.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/wallet/wallet2_api.h b/src/wallet/wallet2_api.h
index 662264f50..56a91bfbb 100644
--- a/src/wallet/wallet2_api.h
+++ b/src/wallet/wallet2_api.h
@@ -39,16 +39,19 @@ namespace Bitmonero {
/**
* @brief Transaction interface
*/
-struct Transaction
+struct PendingTransaction
{
enum Status {
Status_Ok,
Status_Error
};
-
+ virtual ~PendingTransaction() = 0;
virtual int status() const = 0;
virtual std::string errorString() const = 0;
virtual bool commit() = 0;
+ virtual uint64_t amount() const = 0;
+ virtual uint64_t dust() const = 0;
+ virtual uint64_t fee() const = 0;
};
/**
@@ -57,17 +60,12 @@ struct Transaction
*/
struct Wallet
{
- // TODO define wallet interface (decide what needed from wallet2)
enum Status {
Status_Ok,
Status_Error
};
- struct Listener
- {
- // TODO
- };
virtual ~Wallet() = 0;
virtual std::string seed() const = 0;
@@ -85,12 +83,15 @@ struct Wallet
virtual bool connectToDaemon() = 0;
virtual uint64_t balance() const = 0;
virtual uint64_t unlockedBalance() const = 0;
- virtual std::string displayAmount(uint64_t amount) const = 0;
+ static std::string displayAmount(uint64_t amount);
// TODO?
// virtual uint64_t unlockedDustBalance() const = 0;
virtual bool refresh() = 0;
- // TODO transfer
- virtual bool transfer(const std::string &dst_addr, uint64_t amount) = 0;
+ virtual PendingTransaction * createTransaction(const std::string &dst_addr, uint64_t amount) = 0;
+ virtual void disposeTransaction(PendingTransaction * t) = 0;
+ // TODO
+ virtual void getPayments() const;
+
};