Bitcoin Core  31.0.0
P2P Digital Currency
external_signer.h
Go to the documentation of this file.
1 // Copyright (c) 2018-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_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::vector<std::string> m_command;
23 
25  std::string m_chain;
26 
27  std::vector<std::string> NetworkArg() const;
28 
29 public:
34  ExternalSigner(std::vector<std::string> command, std::string chain, std::string fingerprint, 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(int account);
59 
63  bool SignTransaction(PartiallySignedTransaction& psbt, std::string& error);
64 };
65 
66 #endif // BITCOIN_EXTERNAL_SIGNER_H
Enables interaction with an external signing device or service, such as a hardware wallet...
UniValue GetDescriptors(int account)
Get receive and change Descriptor(s) from device for a given account.
A version of CTransaction with the PSBT format.
Definition: psbt.h:1138
std::string m_fingerprint
Master key fingerprint of the signer.
std::string m_name
Name of signer.
std::string m_chain
Bitcoin mainnet, testnet, etc.
std::vector< std::string > NetworkArg() const
UniValue DisplayAddress(const std::string &descriptor) const
Display address on the device.
const char * name
Definition: rest.cpp:48
ExternalSigner(std::vector< std::string > command, std::string chain, std::string fingerprint, std::string name)
std::vector< std::string > m_command
The command which handles interaction with the external signer.
const auto command
bool SignTransaction(PartiallySignedTransaction &psbt, std::string &error)
Sign PartiallySignedTransaction on the device.
static bool Enumerate(const std::string &command, std::vector< ExternalSigner > &signers, const std::string &chain)
Obtain a list of signers.