24 "\"qrmzys48glkpevp2l4t24jtcltc9hyzx9cep2qffm4\"";
27 const std::map<std::string, UniValueType> &typesExpected,
28 bool fAllowNull,
bool fStrict) {
29 for (
const auto &t : typesExpected) {
31 if (!fAllowNull && v.
isNull()) {
36 if (!(t.second.typeAny || v.
type() == t.second.type ||
37 (fAllowNull && v.
isNull()))) {
38 std::string err =
strprintf(
"Expected type %s for %s, got %s",
46 for (
const std::string &k : o.
getKeys()) {
47 if (typesExpected.count(k) == 0) {
48 std::string err =
strprintf(
"Unexpected key %s", k);
74 std::string strHex(v.
get_str());
75 if (64 != strHex.length()) {
78 strprintf(
"%s must be of length %d (not %d, for '%s')", strName, 64,
79 strHex.length(), strHex));
84 strName +
" must be hexadecimal string (not '" +
101 strName +
" must be hexadecimal string (not '" +
119std::string ShellQuote(
const std::string &s) {
121 result.reserve(s.size() * 2);
122 for (
const char ch : s) {
129 return "'" + result +
"'";
138std::string ShellQuoteIfNeeded(
const std::string &s) {
139 for (
const char ch : s) {
140 if (ch ==
' ' || ch ==
'\'' || ch ==
'"') {
141 return ShellQuote(s);
151 const std::string &args) {
152 return "> bitcoin-cli " + methodname +
" " + args +
"\n";
157 std::string result =
"> bitcoin-cli -named " + methodname;
158 for (
const auto &argpair : args) {
159 const auto &value = argpair.second.isStr() ? argpair.second.get_str()
160 : argpair.second.write();
161 result +=
" " + argpair.first +
"=" + ShellQuoteIfNeeded(value);
168 const std::string &args) {
169 return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", "
170 "\"id\": \"curltest\", "
172 methodname +
"\", \"params\": [" + args +
173 "]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n";
179 for (
const auto ¶m : args) {
180 params.
pushKV(param.first, param.second);
183 return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", "
184 "\"id\": \"curltest\", "
186 methodname +
"\", \"params\": " + params.
write() +
187 "}' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n";
192 if (!
IsHex(hex_in)) {
194 "Invalid public key: " + hex_in);
199 "Invalid public key: " + hex_in);
207 const std::string &addr_in) {
211 "Invalid address: " + addr_in);
216 strprintf(
"%s does not refer to a key", addr_in));
219 if (!keystore.
GetPubKey(key, vchPubKey)) {
222 strprintf(
"no full public key for address %s", addr_in));
226 "Wallet contains an invalid public key");
234 const std::vector<CPubKey> &pubkeys,
237 CScript &script_out) {
242 "a multisignature address must require at least one key to redeem");
244 if ((
int)pubkeys.size() < required) {
246 strprintf(
"not enough keys supplied (got %u keys, "
247 "but need at least %d to redeem)",
248 pubkeys.size(), required));
250 if (pubkeys.size() > 16) {
252 "Number of keys involved in the multisignature "
253 "address creation > 16\nReduce the number");
261 (
strprintf(
"redeemScript exceeds size limit: %d > %d",
266 for (
const CPubKey &pk : pubkeys) {
267 if (!pk.IsCompressed()) {
290 obj.
pushKV(
"isscript",
false);
296 obj.
pushKV(
"isscript",
true);
306 std::vector<std::string> ret;
307 using U = std::underlying_type<TxoutType>::type;
311 return Join(ret,
", ");
334 const std::string &err_string) {
335 if (err_string.length() > 0) {
348 Section(
const std::string &left,
const std::string &right)
370 void Push(
const RPCArg &arg,
const size_t current_indent = 5,
372 const auto indent = std::string(current_indent,
' ');
373 const auto indent_next = std::string(current_indent + 2,
' ');
388 if (is_top_level_arg) {
411 {indent + (push_name ?
"\"" + arg.
GetName() +
"\": " :
"") +
414 for (
const auto &arg_inner : arg.
m_inner) {
420 PushSection({indent +
"}" + (is_top_level_arg ?
"" :
","),
""});
425 left += push_name ?
"\"" + arg.
GetName() +
"\": " :
"";
432 for (
const auto &arg_inner : arg.
m_inner) {
436 PushSection({indent +
"]" + (is_top_level_arg ?
"" :
","),
""});
453 if (s.m_right.empty()) {
459 std::string left = s.m_left;
460 left.resize(pad,
' ');
466 size_t new_line_pos = s.m_right.find_first_of(
'\n');
468 right += s.m_right.substr(begin, new_line_pos - begin);
469 if (new_line_pos == std::string::npos) {
473 right +=
"\n" + std::string(pad,
' ');
474 begin = s.m_right.find_first_not_of(
' ', new_line_pos + 1);
475 if (begin == std::string::npos) {
478 new_line_pos = s.m_right.find_first_of(
'\n', begin + 1);
491 std::move(results),
std::move(examples), nullptr} {}
496 : m_name{
std::move(name_)}, m_fun{
std::move(fun)},
497 m_description{
std::move(description)}, m_args{
std::move(args)},
498 m_results{
std::move(results)}, m_examples{
std::move(examples)} {
502 enum ParamType { POSITIONAL = 1, NAMED = 2, NAMED_ONLY = 4 };
503 std::map<std::string, int> param_names;
505 for (
const auto &arg :
m_args) {
506 std::vector<std::string> names =
SplitString(arg.m_names,
'|');
508 for (
const std::string &
name : names) {
509 auto ¶m_type = param_names[
name];
512 param_type |= POSITIONAL;
515 for (
const auto &inner : arg.m_inner) {
516 std::vector<std::string> inner_names =
518 for (
const std::string &inner_name : inner_names) {
519 auto ¶m_type = param_names[inner_name];
521 inner.m_opts.also_positional);
525 inner.m_opts.also_positional ? NAMED : NAMED_ONLY;
530 if (arg.m_fallback.index() == 2) {
532 switch (std::get<RPCArg::Default>(arg.m_fallback).getType()) {
571 if (r.m_cond.empty()) {
572 result +=
"\nResult:\n";
574 result +=
"\nResult (" + r.m_cond +
"):\n";
577 r.ToSections(sections);
598 throw std::runtime_error(
ToString());
601 for (
size_t i{0}; i <
m_args.size(); ++i) {
602 const auto &arg{
m_args.at(i)};
604 if (!match.isTrue()) {
606 strprintf(
"Position %s (%s)", i + 1, arg.m_names),
610 if (!arg_mismatch.empty()) {
612 arg_mismatch.write(4)));
618 UniValue match{res.MatchesType(ret)};
619 if (match.isTrue()) {
623 mismatch.push_back(match);
625 if (!mismatch.isNull()) {
626 std::string explain{mismatch.empty() ?
"no possible results defined"
627 : mismatch.size() == 1 ? mismatch[0].write(4)
628 : mismatch.write(4)};
630 "Internal bug detected: RPC call \"%s\" returned incorrect "
631 "type:\n%s\n%s %s\nPlease report this issue here: %s\n",
640 size_t num_required_args = 0;
641 for (
size_t n =
m_args.size(); n > 0; --n) {
642 if (!
m_args.at(n - 1).IsOptional()) {
643 num_required_args = n;
647 return num_required_args <= num_args && num_args <=
m_args.size();
651 std::vector<std::pair<std::string, bool>> ret;
652 ret.reserve(
m_args.size());
653 for (
const auto &arg :
m_args) {
655 for (
const auto &inner : arg.m_inner) {
656 ret.emplace_back(inner.m_names,
true);
659 ret.emplace_back(arg.m_names,
false);
669 bool was_optional{
false};
670 for (
const auto &arg :
m_args) {
671 if (arg.m_opts.hidden) {
675 const bool optional = arg.IsOptional();
686 was_optional =
false;
688 ret += arg.ToString(
true);
701 for (
size_t i{0}; i <
m_args.size(); ++i) {
702 const auto &arg =
m_args.at(i);
703 if (arg.m_opts.hidden) {
710 ::ToString(i + 1) +
". " + arg.GetFirstName(),
711 arg.ToDescriptionString(
true));
720 for (
const auto &arg_inner : arg.m_inner) {
722 {arg_inner.GetFirstName(),
723 arg_inner.ToDescriptionString(
true)});
724 named_only_sections.
Push(arg_inner);
730 ret +=
"\nArguments:\n";
733 if (!named_only_sections.
m_sections.empty()) {
734 ret +=
"\nNamed Arguments:\n";
736 ret += named_only_sections.
ToString();
750 auto push_back_arg_info = [&arr](
const std::string &rpc_name,
int pos,
751 const std::string &arg_name,
754 map.push_back(rpc_name);
756 map.push_back(arg_name);
762 for (
int i{0}; i < int(
m_args.size()); ++i) {
763 const auto &arg =
m_args.at(i);
764 std::vector<std::string> arg_names =
SplitString(arg.m_names,
'|');
765 for (
const auto &arg_name : arg_names) {
766 push_back_arg_info(
m_name, i, arg_name, arg.m_type);
768 for (
const auto &inner : arg.m_inner) {
769 std::vector<std::string> inner_names =
771 for (
const std::string &inner_name : inner_names) {
772 push_back_arg_info(
m_name, i, inner_name, inner.m_type);
803 case Type::OBJ_NAMED_PARAMS:
804 case Type::OBJ_USER_KEYS: {
827 if (*exp_type != request.
getType()) {
828 return strprintf(
"JSON value of type %s is not of expected type %s",
868 ret +=
"numeric or string";
872 ret +=
"numeric or array";
882 ret +=
"json object";
893 ", optional, default=" + std::get<RPCArg::DefaultHint>(
m_fallback);
895 ret +=
", optional, default=" +
896 std::get<RPCArg::Default>(
m_fallback).write();
898 switch (std::get<RPCArg::Optional>(
m_fallback)) {
917 ret +=
" Options object that can be used to pass named arguments, "
925 const int current_indent)
const {
927 const std::string indent(current_indent,
' ');
928 const std::string indent_next(current_indent + 2,
' ');
932 const std::string maybe_separator{outer_type !=
OuterType::NONE ?
"," :
""};
935 const std::string maybe_key{
939 const auto Description = [&](
const std::string &type) {
940 return "(" + type + (this->
m_optional ?
", optional" :
"") +
")" +
957 {indent +
"null" + maybe_separator, Description(
"json null")});
962 {indent + maybe_key +
"\"str\"" + maybe_separator,
963 Description(
"string")});
967 sections.
PushSection({indent + maybe_key +
"n" + maybe_separator,
968 Description(
"numeric")});
973 {indent + maybe_key +
"\"hex\"" + maybe_separator,
974 Description(
"string")});
978 sections.
PushSection({indent + maybe_key +
"n" + maybe_separator,
979 Description(
"numeric")});
983 sections.
PushSection({indent + maybe_key +
"xxx" + maybe_separator,
984 Description(
"numeric")});
989 {indent + maybe_key +
"true|false" + maybe_separator,
990 Description(
"boolean")});
996 {indent + maybe_key +
"[", Description(
"json array")});
997 for (
const auto &i :
m_inner) {
1005 sections.
m_sections.back().m_left.pop_back();
1007 sections.
PushSection({indent +
"]" + maybe_separator,
""});
1014 Description(
"empty JSON object")});
1018 {indent + maybe_key +
"{", Description(
"json object")});
1019 for (
const auto &i :
m_inner) {
1029 sections.
m_sections.back().m_left.pop_back();
1031 sections.
PushSection({indent +
"}" + maybe_separator,
""});
1043 return std::nullopt;
1049 case Type::STR_HEX: {
1053 case Type::STR_AMOUNT:
1054 case Type::NUM_TIME: {
1060 case Type::ARR_FIXED:
1083 if (*exp_type != result.
getType()) {
1084 return strprintf(
"returned type is %s, but declared as %s in doc",
1090 for (
size_t i{0}; i < result.
get_array().size(); ++i) {
1096 if (!match.isTrue()) {
1100 if (errors.
empty()) {
1115 for (
size_t i{0}; i < result.
get_obj().size(); ++i) {
1117 if (!match.isTrue()) {
1121 if (errors.
empty()) {
1127 std::set<std::string> doc_keys;
1128 for (
const auto &doc_entry :
m_inner) {
1129 doc_keys.insert(doc_entry.m_key_name);
1131 std::map<std::string, UniValue> result_obj;
1133 for (
const auto &result_entry : result_obj) {
1134 if (doc_keys.find(result_entry.first) == doc_keys.end()) {
1135 errors.
pushKV(result_entry.first,
1136 "key returned that was not in doc");
1140 for (
const auto &doc_entry :
m_inner) {
1141 const auto result_it{result_obj.find(doc_entry.m_key_name)};
1142 if (result_it == result_obj.end()) {
1143 if (!doc_entry.m_optional) {
1145 doc_entry.m_key_name,
1146 "key missing, despite not being optional in doc");
1150 UniValue match{doc_entry.MatchesType(result_it->second)};
1151 if (!match.isTrue()) {
1152 errors.
pushKV(doc_entry.m_key_name, match);
1155 if (errors.
empty()) {
1186 return res +
"\"str\"";
1188 return res +
"\"hex\"";
1192 return res +
"n or [n,n]";
1194 return res +
"amount";
1196 return res +
"bool";
1199 for (
const auto &i :
m_inner) {
1200 res += i.ToString(oneline) +
",";
1202 return res +
"...]";
1212 return res +
"unknown";
1238 return "{" + res +
"}";
1240 return "{" + res +
",...}";
1245 for (
const auto &i :
m_inner) {
1246 res += i.ToString(oneline) +
",";
1248 return "[" + res +
"...]";
1255 if (value.
isNum()) {
1256 return {0, value.
getInt<int64_t>()};
1260 int64_t low = value[0].
getInt<int64_t>();
1261 int64_t high = value[1].
getInt<int64_t>();
1265 "Range specified as [begin,end] must not have begin after end");
1270 "Range must be specified as end or as [begin,end]");
1278 "Range should be greater or equal than 0");
1280 if ((high >> 31) != 0) {
1283 if (high >= low + 1000000) {
1292 std::string desc_str;
1293 std::pair<int64_t, int64_t> range = {0, 1000};
1294 if (scanobject.
isStr()) {
1295 desc_str = scanobject.
get_str();
1296 }
else if (scanobject.
isObject()) {
1298 if (desc_uni.isNull()) {
1301 "Descriptor needs to be provided in scan object");
1303 desc_str = desc_uni.get_str();
1305 if (!range_uni.isNull()) {
1311 "Scan object needs to be either a string or an object");
1315 auto desc =
Parse(desc_str, provider,
error);
1319 if (!desc->IsRange()) {
1323 std::vector<CScript> ret;
1324 for (
int i = range.first; i <= range.second; ++i) {
1325 std::vector<CScript> scripts;
1326 if (!desc->Expand(i, provider, scripts, provider)) {
1329 strprintf(
"Cannot derive script without private keys: '%s'",
1332 std::move(scripts.begin(), scripts.end(), std::back_inserter(ret));
1344 return servicesNames;
bool MoneyRange(const Amount nValue)
static constexpr Amount SATOSHI
#define CHECK_NONFATAL(condition)
Identity function.
#define NONFATAL_UNREACHABLE()
NONFATAL_UNREACHABLE() is a macro that is used to mark unreachable code.
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
A reference to a CKey: the Hash160 of its serialized public key.
An encapsulated public key.
bool IsFullyValid() const
fully validate whether this is a valid public key (more expensive than IsValid())
UniValue operator()(const CNoDestination &dest) const
UniValue operator()(const ScriptHash &scriptID) const
UniValue operator()(const PKHash &keyID) const
Fillable signing provider that keeps keys in an address->secret map.
virtual bool GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const override
enum JSONRPCRequest::Mode mode
const RPCExamples m_examples
RPCHelpMan(std::string name, std::string description, std::vector< RPCArg > args, RPCResults results, RPCExamples examples)
const std::string m_description
bool IsValidNumArgs(size_t num_args) const
If the supplied number of args is neither too small nor too high.
std::function< UniValue(const RPCHelpMan &, const Config &config, const JSONRPCRequest &)> RPCMethodImpl
const RPCMethodImpl m_fun
const RPCResults m_results
UniValue HandleRequest(const Config &config, const JSONRPCRequest &request) const
const std::vector< RPCArg > m_args
std::string ToString() const
UniValue GetArgMap() const
Return the named args that need to be converted from string to another JSON type.
std::vector< std::pair< std::string, bool > > GetArgNames() const
Return list of arguments and whether they are named-only.
void push_back(UniValue val)
const std::string & get_str() const
const UniValue & find_value(std::string_view key) const
enum VType getType() const
std::string write(unsigned int prettyIndent=0, unsigned int indentLevel=0) const
const std::string & getValStr() const
const UniValue & get_obj() const
const std::vector< std::string > & getKeys() const
const UniValue & get_array() const
void pushKV(std::string key, UniValue val)
void getObjMap(std::map< std::string, UniValue > &kv) const
static UniValue Parse(std::string_view raw)
Parse string to UniValue or throw runtime_error if string contains invalid JSON.
std::string FormatFullVersion()
bilingual_str TransactionErrorString(const TransactionError error)
CTxDestination DecodeDestination(const std::string &addr, const CChainParams ¶ms)
bool error(const char *fmt, const Args &...args)
Implement std::hash so RCUPtr can be used as a key for maps or sets.
CTxDestination AddAndGetDestinationForScript(FillableSigningProvider &keystore, const CScript &script, OutputType type)
Get a destination of the requested type (if possible) to the specified script.
std::vector< std::string > serviceFlagsToStr(const uint64_t flags)
Convert service flags (a bitmask of NODE_*) to human readable strings.
ServiceFlags
nServices flags.
UniValue JSONRPCError(int code, const std::string &message)
RPCErrorCode
Bitcoin RPC error codes.
@ RPC_TRANSACTION_ALREADY_IN_CHAIN
@ RPC_TYPE_ERROR
Unexpected type was passed as parameter.
@ RPC_TRANSACTION_REJECTED
@ RPC_TRANSACTION_ERROR
Aliases for backward compatibility.
@ RPC_INVALID_PARAMETER
Invalid, missing or duplicate parameter.
@ RPC_DESERIALIZATION_ERROR
Error parsing or validating structure in raw format.
@ RPC_INVALID_ADDRESS_OR_KEY
Invalid address or key.
@ RPC_CLIENT_P2P_DISABLED
No valid connection manager instance found.
std::pair< int64_t, int64_t > ParseDescriptorRange(const UniValue &value)
Parse a JSON range specified as int64, or [int64, int64].
std::string HelpExampleCli(const std::string &methodname, const std::string &args)
UniValue GetServicesNames(ServiceFlags services)
Returns, given services flags, a list of humanly readable (known) network services.
CTxDestination AddAndGetMultisigDestination(const int required, const std::vector< CPubKey > &pubkeys, OutputType type, FillableSigningProvider &keystore, CScript &script_out)
std::string HelpExampleRpcNamed(const std::string &methodname, const RPCArgList &args)
UniValue JSONRPCTransactionError(TransactionError terr, const std::string &err_string)
Amount AmountFromValue(const UniValue &value)
std::vector< uint8_t > ParseHexV(const UniValue &v, std::string strName)
RPCErrorCode RPCErrorFromTransactionError(TransactionError terr)
const std::string EXAMPLE_ADDRESS
Example CashAddr address used in multiple RPCExamples.
static std::optional< UniValue::VType > ExpectedType(RPCArg::Type type)
std::string HelpExampleRpc(const std::string &methodname, const std::string &args)
std::vector< CScript > EvalDescriptorStringOrObject(const UniValue &scanobject, FlatSigningProvider &provider)
Evaluate a descriptor given as a string, or as a {"desc":...,"range":...} object, with default range ...
const std::string UNIX_EPOCH_TIME
String used to describe UNIX epoch time in documentation, factored out to a constant for consistency.
std::string GetAllOutputTypes()
CPubKey HexToPubKey(const std::string &hex_in)
CPubKey AddrToPubKey(const CChainParams &chainparams, const FillableSigningProvider &keystore, const std::string &addr_in)
uint256 ParseHashO(const UniValue &o, std::string strKey)
uint256 ParseHashV(const UniValue &v, std::string strName)
Utilities: convert hex-encoded values (throws error if not hex).
static std::pair< int64_t, int64_t > ParseRange(const UniValue &value)
void RPCTypeCheckObj(const UniValue &o, const std::map< std::string, UniValueType > &typesExpected, bool fAllowNull, bool fStrict)
Check for expected keys/value types in an Object.
std::string HelpExampleCliNamed(const std::string &methodname, const RPCArgList &args)
UniValue DescribeAddress(const CTxDestination &dest)
std::vector< uint8_t > ParseHexO(const UniValue &o, std::string strKey)
std::vector< std::pair< std::string, UniValue > > RPCArgList
static constexpr bool DEFAULT_RPC_DOC_CHECK
OuterType
Serializing JSON objects depends on the outer type.
static const unsigned int MAX_SCRIPT_ELEMENT_SIZE
CKeyID GetKeyForDestination(const SigningProvider &store, const CTxDestination &dest)
Return the CKeyID of the key involved in a script (if there is a unique one).
CScript GetScriptForMultisig(int nRequired, const std::vector< CPubKey > &keys)
Generate a multisig script.
std::string GetTxnOutputType(TxoutType t)
Get the name of a TxoutType as a string.
bool IsValidDestination(const CTxDestination &dest)
Check whether a CTxDestination is a CNoDestination.
std::variant< CNoDestination, PKHash, ScriptHash > CTxDestination
A txout script template with a specific destination.
auto Join(const std::vector< T > &list, const BaseType &separator, UnaryOp unary_op) -> decltype(unary_op(list.at(0)))
Join a list of items.
std::vector< std::string > SplitString(std::string_view str, char sep)
static const Currency & get()
@ RANGE
Special type that is a NUM or [NUM,NUM].
@ OBJ_USER_KEYS
Special type where the user must set the keys e.g.
@ STR_HEX
Special type that is a STR with only hex chars.
@ AMOUNT
Special type representing a floating point amount (can be either NUM or STR)
@ OBJ_NAMED_PARAMS
Special type that behaves almost exactly like OBJ, defining an options object with a list of pre-defi...
const std::vector< RPCArg > m_inner
Only used for arrays or dicts.
const RPCArgOptions m_opts
const std::string m_names
The name of the arg (can be empty for inner args, can contain multiple aliases separated by | for nam...
const Fallback m_fallback
std::string ToString(bool oneline) const
Return the type string of the argument.
UniValue MatchesType(const UniValue &request) const
Check whether the request JSON type matches.
const std::string m_description
std::string ToDescriptionString(bool is_named_arg) const
Return the description string, including the argument type and whether the argument is required.
std::string GetName() const
Return the name, throws when there are aliases.
std::string GetFirstName() const
Return the first of all aliases.
std::string ToStringObj(bool oneline) const
Return the type string of the argument when it is in an object (dict).
@ OMITTED
The arg is optional for one of two reasons:
std::vector< std::string > type_str
Should be empty unless it is supposed to override the auto-generated type strings.
std::string oneline_description
Should be empty unless it is supposed to override the auto-generated summary line.
std::string ToDescriptionString() const
const std::string m_examples
const std::string m_description
void ToSections(Sections §ions, OuterType outer_type=OuterType::NONE, const int current_indent=0) const
Append the sections of the result.
@ ELISION
Special type to denote elision (...)
@ NUM_TIME
Special numeric to denote unix epoch time.
@ ANY
Special type to disable type checks (for testing only)
@ ARR_FIXED
Special array that has a fixed number of entries.
@ OBJ_DYN
Special dictionary with keys that are not literals.
@ STR_HEX
Special string with only hex chars.
@ STR_AMOUNT
Special string to represent a floating point amount.
const std::vector< RPCResult > m_inner
Only used for arrays or dicts.
UniValue MatchesType(const UniValue &result) const
Check whether the result JSON type matches.
void CheckInnerDoc() const
const std::string m_key_name
Only used for dicts.
const bool m_skip_type_check
std::string ToDescriptionString() const
Return the description string.
const std::vector< RPCResult > m_results
A pair of strings that can be aligned (through padding) with other Sections later on.
Section(const std::string &left, const std::string &right)
const std::string m_right
Keeps track of RPCArgs by transforming them into sections for the purpose of serializing everything t...
void PushSection(const Section &s)
std::vector< Section > m_sections
void Push(const RPCArg &arg, const size_t current_indent=5, const OuterType outer_type=OuterType::NONE)
Recursive helper to translate an RPCArg into sections.
std::string ToString() const
Concatenate all sections with proper padding.
uint256 uint256S(const char *str)
uint256 from const char *.
const char * uvTypeName(UniValue::VType t)
template std::vector< std::byte > ParseHex(std::string_view)
bool ParseFixedPoint(std::string_view val, int decimals, int64_t *amount_out)
Parse number as fixed point according to JSON number syntax.
bool IsHex(std::string_view str)
Returns true if each character in str is a hex character, and has an even number of hex digits.