Branch data Line data Source code
1 : : // Copyright (c) 2019-present The Bitcoin Core developers
2 : : // Distributed under the MIT software license, see the accompanying
3 : : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 : :
5 : : #ifndef BITCOIN_WALLET_EXTERNAL_SIGNER_SCRIPTPUBKEYMAN_H
6 : : #define BITCOIN_WALLET_EXTERNAL_SIGNER_SCRIPTPUBKEYMAN_H
7 : :
8 : : #include <wallet/scriptpubkeyman.h>
9 : :
10 : : #include <memory>
11 : : #include <util/result.h>
12 : :
13 : : struct bilingual_str;
14 : :
15 : : namespace wallet {
16 : : class ExternalSignerScriptPubKeyMan : public DescriptorScriptPubKeyMan
17 : : {
18 : : private:
19 [ # # # # : 0 : using DescriptorScriptPubKeyMan::DescriptorScriptPubKeyMan;
# # ]
20 : :
21 : : public:
22 : : static std::unique_ptr<ExternalSignerScriptPubKeyMan> LoadFromStorage(WalletStorage& storage, const uint256& id, WalletDescriptor& descriptor, int64_t keypool_size, const KeyMap& keys, const CryptedKeyMap& ckeys);
23 : : static std::unique_ptr<ExternalSignerScriptPubKeyMan> CreateNew(WalletStorage& storage, WalletBatch& batch, int64_t keypool_size, std::unique_ptr<Descriptor> desc);
24 : :
25 : : static util::Result<ExternalSigner> GetExternalSigner();
26 : :
27 : : /**
28 : : * Display address on the device and verify that the returned value matches.
29 : : * @returns nothing or an error message
30 : : */
31 : : util::Result<void> DisplayAddress(const CTxDestination& dest, const ExternalSigner& signer) const;
32 : :
33 : : std::optional<common::PSBTError> FillPSBT(PartiallySignedTransaction& psbt, const PrecomputedTransactionData& txdata, const common::PSBTFillOptions& options, int* n_signed = nullptr) const override;
34 : : };
35 : : } // namespace wallet
36 : : #endif // BITCOIN_WALLET_EXTERNAL_SIGNER_SCRIPTPUBKEYMAN_H
|