diff options
Diffstat (limited to 'src/interface/wallet.h')
-rw-r--r-- | src/interface/wallet.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/interface/wallet.h b/src/interface/wallet.h new file mode 100644 index 0000000000..bf68df4e7d --- /dev/null +++ b/src/interface/wallet.h @@ -0,0 +1,35 @@ +// Copyright (c) 2018 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_INTERFACE_WALLET_H +#define BITCOIN_INTERFACE_WALLET_H + +#include <functional> +#include <memory> +#include <string> + +class CWallet; + +namespace interface { + +class Handler; + +//! Interface for accessing a wallet. +class Wallet +{ +public: + virtual ~Wallet() {} + + //! Register handler for show progress messages. + using ShowProgressFn = std::function<void(const std::string& title, int progress)>; + virtual std::unique_ptr<Handler> handleShowProgress(ShowProgressFn fn) = 0; +}; + +//! Return implementation of Wallet interface. This function will be undefined +//! in builds where ENABLE_WALLET is false. +std::unique_ptr<Wallet> MakeWallet(CWallet& wallet); + +} // namespace interface + +#endif // BITCOIN_INTERFACE_WALLET_H |