33 if (!result.isArray()) {
34 throw std::runtime_error(
strprintf(
"'%s' received invalid response, expected array of signers",
command));
47 if (fingerprint.
isNull()) {
48 throw std::runtime_error(
strprintf(
"'%s' received invalid response, missing signer fingerprint",
command));
86 for (
const auto& entry : input.hd_keypaths) {
89 for (
const auto& entry : input.m_tap_bip32_paths) {
111 error =
"Unexpected result from signer";
Double ended buffer combining vector and stream-like interfaces.
Enables interaction with an external signing device or service, such as a hardware wallet.
std::string m_chain
Bitcoin mainnet, testnet, etc.
static bool Enumerate(const std::string &command, std::vector< ExternalSigner > &signers, const std::string &chain)
Obtain a list of signers.
UniValue DisplayAddress(const std::string &descriptor) const
Display address on the device.
std::vector< std::string > NetworkArg() const
bool SignTransaction(PartiallySignedTransaction &psbt, std::string &error)
Sign PartiallySignedTransaction on the device.
std::vector< std::string > m_command
The command which handles interaction with the external signer.
UniValue GetDescriptors(int account)
Get receive and change Descriptor(s) from device for a given account.
std::string m_fingerprint
Master key fingerprint of the signer.
ExternalSigner(std::vector< std::string > command, std::string chain, std::string fingerprint, std::string name)
const std::string & get_str() const
const std::string & getValStr() const
static std::vector< std::string > split(const std::string &str, const std::string &delims=" \t")
bool DecodeBase64PSBT(PartiallySignedTransaction &psbt, const std::string &base64_tx, std::string &error)
Decode a base64ed PSBT into a PartiallySignedTransaction.
UniValue RunCommandParseJSON(const std::vector< std::string > &cmd_args, const std::string &str_std_in)
Execute a command which returns JSON, and parse the result.
std::vector< Byte > ParseHex(std::string_view hex_str)
Like TryParseHex, but returns an empty vector on invalid input.
A version of CTransaction with the PSBT format.
std::string EncodeBase64(std::span< const unsigned char > input)
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
V Cat(V v1, V &&v2)
Concatenate two vectors, moving elements.