Bitcoin Core  27.99.0
P2P Digital Currency
external_signer.h
Go to the documentation of this file.
1 // Copyright (c) 2018-2021 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_EXTERNAL_SIGNER_H
6 #define BITCOIN_EXTERNAL_SIGNER_H
7 
8 #include <common/system.h>
9 #include <univalue.h>
10 
11 #include <string>
12 #include <vector>
13 
15 
19 {
20 private:
22  std::string m_command;
23 
25  std::string m_chain;
26 
27  std::string NetworkArg() const;
28 
29 public:
34  ExternalSigner(const std::string& command, const std::string chain, const std::string& fingerprint, const std::string name);
35 
37  std::string m_fingerprint;
38 
40  std::string m_name;
41 
47  static bool Enumerate(const std::string& command, std::vector<ExternalSigner>& signers, const std::string chain);
48 
52  UniValue DisplayAddress(const std::string& descriptor) const;
53 
58  UniValue GetDescriptors(const int account);
59 
63  bool SignTransaction(PartiallySignedTransaction& psbt, std::string& error);
64 };
65 
66 #endif // BITCOIN_EXTERNAL_SIGNER_H
const auto command
Enables interaction with an external signing device or service, such as a hardware wallet.
std::string m_chain
Bitcoin mainnet, testnet, etc.
UniValue DisplayAddress(const std::string &descriptor) const
Display address on the device.
UniValue GetDescriptors(const int account)
Get receive and change Descriptor(s) from device for a given account.
bool SignTransaction(PartiallySignedTransaction &psbt, std::string &error)
Sign PartiallySignedTransaction on the device.
std::string NetworkArg() const
std::string m_name
Name of signer.
std::string m_fingerprint
Master key fingerprint of the signer.
std::string m_command
The command which handles interaction with the external signer.
static bool Enumerate(const std::string &command, std::vector< ExternalSigner > &signers, const std::string chain)
Obtain a list of signers.
ExternalSigner(const std::string &command, const std::string chain, const std::string &fingerprint, const std::string name)
const char * name
Definition: rest.cpp:50
A version of CTransaction with the PSBT format.
Definition: psbt.h:947