You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Note this call may take some time if you are not using coinstatsindex.\n",
857
857
{
858
858
{"hash_type", RPCArg::Type::STR, RPCArg::Default{"hash_serialized_2"}, "Which UTXO set hash should be calculated. Options: 'hash_serialized_2' (the legacy algorithm), 'muhash', 'none'."},
859
-
{"hash_or_height", RPCArg::Type::NUM, RPCArg::DefaultHint{"the current best block"}, "The block hash or height of the target height (only available with coinstatsindex).", "", {"", "string or numeric"}},
859
+
{"hash_or_height", RPCArg::Type::NUM, RPCArg::DefaultHint{"the current best block"}, "The block hash or height of the target height (only available with coinstatsindex).", RPCArgOptions{.type_str={"", "string or numeric"}}},
860
860
{"use_index", RPCArg::Type::BOOL, RPCArg::Default{true}, "Use coinstatsindex, if available."},
"\nCompute per block statistics for a given window. All amounts are in satoshis.\n"
1727
1727
"It won't work for some heights with pruning.\n",
1728
1728
{
1729
-
{"hash_or_height", RPCArg::Type::NUM, RPCArg::Optional::NO, "The block hash or height of the target block", "", {"", "string or numeric"}},
1729
+
{"hash_or_height", RPCArg::Type::NUM, RPCArg::Optional::NO, "The block hash or height of the target block", RPCArgOptions{.type_str={"", "string or numeric"}}},
1730
1730
{"stats", RPCArg::Type::ARR, RPCArg::DefaultHint{"all values"}, "Values to plot (see result below)",
Copy file name to clipboardExpand all lines: src/rpc/util.h
+13-15Lines changed: 13 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -137,6 +137,12 @@ enum class OuterType {
137
137
NONE, // Only set on first recursion
138
138
};
139
139
140
+
structRPCArgOptions {
141
+
std::string oneline_description{}; //!< Should be empty unless it is supposed to override the auto-generated summary line
142
+
std::vector<std::string> type_str{}; //!< Should be empty unless it is supposed to override the auto-generated type strings. Vector length is either 0 or 2, m_opts.type_str.at(0) will override the type of the value in a key-value pair, m_opts.type_str.at(1) will override the type in the argument description.
143
+
bool hidden{false}; //!< For testing only
144
+
};
145
+
140
146
structRPCArg {
141
147
enumclassType {
142
148
OBJ,
@@ -169,30 +175,25 @@ struct RPCArg {
169
175
using DefaultHint = std::string;
170
176
using Default = UniValue;
171
177
using Fallback = std::variant<Optional, /* hint for default value */ DefaultHint, /* default constant value */ Default>;
178
+
172
179
const std::string m_names; //!< The name of the arg (can be empty for inner args, can contain multiple aliases separated by | for named request arguments)
173
180
const Type m_type;
174
-
constbool m_hidden;
175
181
const std::vector<RPCArg> m_inner; //!< Only used for arrays or dicts
176
182
const Fallback m_fallback;
177
183
const std::string m_description;
178
-
const std::string m_oneline_description; //!< Should be empty unless it is supposed to override the auto-generated summary line
179
-
const std::vector<std::string> m_type_str; //!< Should be empty unless it is supposed to override the auto-generated type strings. Vector length is either 0 or 2, m_type_str.at(0) will override the type of the value in a key-value pair, m_type_str.at(1) will override the type in the argument description.
Copy file name to clipboardExpand all lines: src/wallet/rpc/backup.cpp
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1266,15 +1266,15 @@ RPCHelpMan importmulti()
1266
1266
{
1267
1267
{"desc", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Descriptor to import. If using descriptor, do not also provide address/scriptPubKey, scripts, or pubkeys"},
1268
1268
{"scriptPubKey", RPCArg::Type::STR, RPCArg::Optional::NO, "Type of scriptPubKey (string for script, json for address). Should not be provided if using a descriptor",
{"range", RPCArg::Type::RANGE, RPCArg::Optional::OMITTED, "If a ranged descriptor is used, this specifies the end or the range (in the form [begin,end]) to import"},
1599
1599
{"next_index", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "If a ranged descriptor is set to active, this specifies the next index to generate addresses from"},
1600
1600
{"timestamp", RPCArg::Type::NUM, RPCArg::Optional::NO, "Time from which to start rescanning the blockchain for this descriptor, in " + UNIX_EPOCH_TIME + "\n"
1601
-
"Use the string \"now\" to substitute the current synced blockchain time.\n"
1602
-
"\"now\" can be specified to bypass scanning, for outputs which are known to never have been used, and\n"
1603
-
"0 can be specified to scan the entire blockchain. Blocks up to 2 hours before the earliest timestamp\n"
1601
+
"Use the string \"now\" to substitute the current synced blockchain time.\n"
1602
+
"\"now\" can be specified to bypass scanning, for outputs which are known to never have been used, and\n"
1603
+
"0 can be specified to scan the entire blockchain. Blocks up to 2 hours before the earliest timestamp\n"
1604
1604
"of all descriptors being imported will be scanned as well as the mempool.",
{"internal", RPCArg::Type::BOOL, RPCArg::Default{false}, "Whether matching outputs should be treated as not incoming payments (e.g. change)"},
1608
1608
{"label", RPCArg::Type::STR, RPCArg::Default{""}, "Label to assign to the address, only allowed with internal=false. Disabled for ranged descriptors"},
Copy file name to clipboardExpand all lines: src/wallet/rpc/spend.cpp
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -317,7 +317,7 @@ RPCHelpMan sendmany()
317
317
"\nSend multiple times. Amounts are double-precision floating point numbers." +
318
318
HELP_REQUIRING_PASSPHRASE,
319
319
{
320
-
{"dummy", RPCArg::Type::STR, RPCArg::Optional::NO, "Must be set to \"\" for backwards compatibility.", "\"\""},
320
+
{"dummy", RPCArg::Type::STR, RPCArg::Optional::NO, "Must be set to \"\" for backwards compatibility.", RPCArgOptions{.oneline_description="\"\""}},
321
321
{"amounts", RPCArg::Type::OBJ_USER_KEYS, RPCArg::Optional::NO, "The addresses and amounts",
322
322
{
323
323
{"address", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "The bitcoin address is the key, the numeric amount (can be string) in " + CURRENCY_UNIT + " is the value"},
{"iswitness", RPCArg::Type::BOOL, RPCArg::DefaultHint{"depends on heuristic tests"}, "Whether the transaction hex is a serialized witness transaction.\n"
780
780
"If iswitness is not present, heuristic tests will be used in decoding.\n"
781
781
"If true, only witness deserialization will be tried.\n"
0 commit comments