diff options
Diffstat (limited to 'src/wallet/wallet2_api.h')
-rw-r--r-- | src/wallet/wallet2_api.h | 21 |
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; + }; |