diff options
author | Jaquee <jaquee.monero@gmail.com> | 2017-01-08 13:17:09 +0100 |
---|---|---|
committer | Jaquee <jaquee.monero@gmail.com> | 2017-01-10 22:49:17 +0100 |
commit | dbb838f4d0f197a97e5e6387ea9b175dbc59613b (patch) | |
tree | 43fbd55c02597f87f8ca1585eabb15a5f5c8fc84 /src/wallet/wallet2_api.h | |
parent | Wallet API: functions for supporting/creating view only wallets (diff) | |
download | monero-dbb838f4d0f197a97e5e6387ea9b175dbc59613b.tar.xz |
GUI cold signing
fix conflict
Diffstat (limited to 'src/wallet/wallet2_api.h')
-rw-r--r-- | src/wallet/wallet2_api.h | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/src/wallet/wallet2_api.h b/src/wallet/wallet2_api.h index d049baac6..96884c346 100644 --- a/src/wallet/wallet2_api.h +++ b/src/wallet/wallet2_api.h @@ -77,7 +77,8 @@ struct PendingTransaction virtual ~PendingTransaction() = 0; virtual int status() const = 0; virtual std::string errorString() const = 0; - virtual bool commit() = 0; + // commit transaction or save to file if filename is provided. + virtual bool commit(const std::string &filename = "", bool overwrite = false) = 0; virtual uint64_t amount() const = 0; virtual uint64_t dust() const = 0; virtual uint64_t fee() const = 0; @@ -90,6 +91,48 @@ struct PendingTransaction }; /** + * @brief Transaction-like interface for sending money + */ +struct UnsignedTransaction +{ + enum Status { + Status_Ok, + Status_Error, + Status_Critical + }; + + enum Priority { + Priority_Low = 1, + Priority_Medium = 2, + Priority_High = 3, + Priority_Last + }; + + virtual ~UnsignedTransaction() = 0; + virtual int status() const = 0; + virtual std::string errorString() const = 0; + virtual std::vector<uint64_t> amount() const = 0; + virtual std::vector<uint64_t> fee() const = 0; + virtual std::vector<uint64_t> mixin() const = 0; + // returns a string with information about all transactions. + virtual std::string confirmationMessage() const = 0; + virtual std::vector<std::string> paymentId() const = 0; + virtual std::vector<std::string> recipientAddress() const = 0; + virtual uint64_t minMixinCount() const = 0; + /*! + * \brief txCount - number of transactions current transaction will be splitted to + * \return + */ + virtual uint64_t txCount() const = 0; + /*! + * @brief sign - Sign txs and saves to file + * @param signedFileName + * return - true on success + */ + virtual bool sign(const std::string &signedFileName) = 0; +}; + +/** * @brief The TransactionInfo - interface for displaying transaction information */ struct TransactionInfo @@ -441,12 +484,27 @@ struct Wallet */ virtual PendingTransaction * createSweepUnmixableTransaction() = 0; + + /*! + * \brief loadUnsignedTx - creates transaction from unsigned tx file + * \return - UnsignedTransaction object. caller is responsible to check UnsignedTransaction::status() + * after object returned + */ + virtual UnsignedTransaction * loadUnsignedTx(const std::string &unsigned_filename) = 0; + + /*! + * \brief submitTransaction - submits transaction in signed tx file + * \return - true on success + */ + virtual bool submitTransaction(const std::string &fileName) = 0; + /*! * \brief disposeTransaction - destroys transaction object * \param t - pointer to the "PendingTransaction" object. Pointer is not valid after function returned; */ virtual void disposeTransaction(PendingTransaction * t) = 0; + virtual TransactionHistory * history() const = 0; virtual AddressBook * addressBook() const = 0; virtual void setListener(WalletListener *) = 0; |