@@ -92,13 +92,10 @@ static UniValue getnetworkhashps(const JSONRPCRequest& request)
92
92
" Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.\n "
93
93
" Pass in [height] to estimate the network speed at the time when a certain block was found.\n " ,
94
94
{
95
- {" nblocks" , RPCArg::Type::NUM, true },
96
- {" height" , RPCArg::Type::NUM, true },
95
+ {" nblocks" , RPCArg::Type::NUM, /* opt */ true , /* default_val */ " 120 " , " The number of blocks, or -1 for blocks since last difficulty change. " },
96
+ {" height" , RPCArg::Type::NUM, /* opt */ true , /* default_val */ " -1 " , " To estimate at the time of the given height. " },
97
97
}}
98
98
.ToString () +
99
- " \n Arguments:\n "
100
- " 1. nblocks (numeric, optional, default=120) The number of blocks, or -1 for blocks since last difficulty change.\n "
101
- " 2. height (numeric, optional, default=-1) To estimate at the time of the given height.\n "
102
99
" \n Result:\n "
103
100
" x (numeric) Hashes per second estimated\n "
104
101
" \n Examples:\n "
@@ -165,15 +162,11 @@ static UniValue generatetoaddress(const JSONRPCRequest& request)
165
162
RPCHelpMan{" generatetoaddress" ,
166
163
" \n Mine blocks immediately to a specified address (before the RPC call returns)\n " ,
167
164
{
168
- {" nblocks" , RPCArg::Type::NUM, false },
169
- {" address" , RPCArg::Type::STR, false },
170
- {" maxtries" , RPCArg::Type::NUM, true },
165
+ {" nblocks" , RPCArg::Type::NUM, /* opt */ false , /* default_val */ " " , " How many blocks are generated immediately. " },
166
+ {" address" , RPCArg::Type::STR, /* opt */ false , /* default_val */ " " , " The address to send the newly generated bitcoin to. " },
167
+ {" maxtries" , RPCArg::Type::NUM, /* opt */ true , /* default_val */ " 1000000 " , " How many iterations to try. " },
171
168
}}
172
169
.ToString () +
173
- " \n Arguments:\n "
174
- " 1. nblocks (numeric, required) How many blocks are generated immediately.\n "
175
- " 2. address (string, required) The address to send the newly generated bitcoin to.\n "
176
- " 3. maxtries (numeric, optional) How many iterations to try (default = 1000000).\n "
177
170
" \n Result:\n "
178
171
" [ blockhashes ] (array) hashes of blocks generated\n "
179
172
" \n Examples:\n "
@@ -247,19 +240,15 @@ static UniValue prioritisetransaction(const JSONRPCRequest& request)
247
240
RPCHelpMan{" prioritisetransaction" ,
248
241
" Accepts the transaction into mined blocks at a higher (or lower) priority\n " ,
249
242
{
250
- {" txid" , RPCArg::Type::STR, false },
251
- {" dummy" , RPCArg::Type::NUM, false },
252
- {" fee_delta" , RPCArg::Type::NUM, false },
253
- }}
254
- .ToString () +
255
- " \n Arguments:\n "
256
- " 1. \" txid\" (string, required) The transaction id.\n "
257
- " 2. dummy (numeric, optional) API-Compatibility for previous API. Must be zero or null.\n "
258
- " DEPRECATED. For forward compatibility use named arguments and omit this parameter.\n "
259
- " 3. fee_delta (numeric, required) The fee value (in satoshis) to add (or subtract, if negative).\n "
243
+ {" txid" , RPCArg::Type::STR_HEX, /* opt */ false , /* default_val */ " " , " The transaction id." },
244
+ {" dummy" , RPCArg::Type::NUM, /* opt */ false , /* default_val */ " " , " API-Compatibility for previous API. Must be zero or null.\n "
245
+ " DEPRECATED. For forward compatibility use named arguments and omit this parameter." },
246
+ {" fee_delta" , RPCArg::Type::NUM, /* opt */ false , /* default_val */ " " , " The fee value (in satoshis) to add (or subtract, if negative).\n "
260
247
" Note, that this value is not a fee rate. It is a value to modify absolute fee of the TX.\n "
261
248
" The fee is not actually paid, only the algorithm for selecting transactions into a block\n "
262
- " considers the transaction as it would have paid a higher (or lower) fee.\n "
249
+ " considers the transaction as it would have paid a higher (or lower) fee." },
250
+ }}
251
+ .ToString () +
263
252
" \n Result:\n "
264
253
" true (boolean) Returns true\n "
265
254
" \n Examples:\n "
@@ -322,38 +311,23 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
322
311
" https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes\n "
323
312
" https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki\n " ,
324
313
{
325
- {" template_request" , RPCArg::Type::OBJ,
314
+ {" template_request" , RPCArg::Type::OBJ, /* opt */ true , /* default_val */ " " , " A json object in the following spec " ,
326
315
{
327
- {" mode" , RPCArg::Type::STR, true },
328
- {" capabilities" , RPCArg::Type::ARR,
316
+ {" mode" , RPCArg::Type::STR, /* opt */ true , /* default_val */ " " , " This must be set to \" template \" , \" proposal \" (see BIP 23), or omitted " },
317
+ {" capabilities" , RPCArg::Type::ARR, /* opt */ true , /* default_val */ " " , " A list of strings " ,
329
318
{
330
- {" support" , RPCArg::Type::STR, true },
319
+ {" support" , RPCArg::Type::STR, /* opt */ true , /* default_val */ " " , " client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid' " },
331
320
},
332
- true },
333
- {" rules" , RPCArg::Type::ARR,
321
+ },
322
+ {" rules" , RPCArg::Type::ARR, /* opt */ true , /* default_val */ " " , " A list of strings " ,
334
323
{
335
- {" support" , RPCArg::Type::STR, true },
324
+ {" support" , RPCArg::Type::STR, /* opt */ true , /* default_val */ " " , " client side supported softfork deployment" },
325
+ },
336
326
},
337
- true },
338
327
},
339
- true , " \" template_request\" " },
328
+ " \" template_request\" " },
340
329
}}
341
330
.ToString () +
342
- " \n Arguments:\n "
343
- " 1. template_request (json object, optional) A json object in the following spec\n "
344
- " {\n "
345
- " \" mode\" :\" template\" (string, optional) This must be set to \" template\" , \" proposal\" (see BIP 23), or omitted\n "
346
- " \" capabilities\" :[ (array, optional) A list of strings\n "
347
- " \" support\" (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid'\n "
348
- " ,...\n "
349
- " ],\n "
350
- " \" rules\" :[ (array, optional) A list of strings\n "
351
- " \" support\" (string) client side supported softfork deployment\n "
352
- " ,...\n "
353
- " ]\n "
354
- " }\n "
355
- " \n "
356
-
357
331
" \n Result:\n "
358
332
" {\n "
359
333
" \" version\" : n, (numeric) The preferred block version\n "
@@ -742,13 +716,10 @@ static UniValue submitblock(const JSONRPCRequest& request)
742
716
" \n Attempts to submit new block to network.\n "
743
717
" See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n " ,
744
718
{
745
- {" hexdata" , RPCArg::Type::STR_HEX, false },
746
- {" dummy" , RPCArg::Type::STR, true },
719
+ {" hexdata" , RPCArg::Type::STR_HEX, /* opt */ false , /* default_val */ " " , " the hex-encoded block data to submit " },
720
+ {" dummy" , RPCArg::Type::STR, /* opt */ true , /* default_val */ " " , " dummy value, for compatibility with BIP22. This value is ignored. " },
747
721
}}
748
722
.ToString () +
749
- " \n Arguments\n "
750
- " 1. \" hexdata\" (string, required) the hex-encoded block data to submit\n "
751
- " 2. \" dummy\" (optional) dummy value, for compatibility with BIP22. This value is ignored.\n "
752
723
" \n Result:\n "
753
724
" \n Examples:\n "
754
725
+ HelpExampleCli (" submitblock" , " \" mydata\" " )
@@ -810,11 +781,9 @@ static UniValue submitheader(const JSONRPCRequest& request)
810
781
" \n Decode the given hexdata as a header and submit it as a candidate chain tip if valid."
811
782
" \n Throws when the header is invalid.\n " ,
812
783
{
813
- {" hexdata" , RPCArg::Type::STR_HEX, false },
784
+ {" hexdata" , RPCArg::Type::STR_HEX, /* opt */ false , /* default_val */ " " , " the hex-encoded block header data " },
814
785
}}
815
786
.ToString () +
816
- " \n Arguments\n "
817
- " 1. \" hexdata\" (string, required) the hex-encoded block header data\n "
818
787
" \n Result:\n "
819
788
" None"
820
789
" \n Examples:\n " +
@@ -852,21 +821,18 @@ static UniValue estimatesmartfee(const JSONRPCRequest& request)
852
821
" for which the estimate is valid. Uses virtual transaction size as defined\n "
853
822
" in BIP 141 (witness data is discounted).\n " ,
854
823
{
855
- {" conf_target" , RPCArg::Type::NUM, false },
856
- {" estimate_mode" , RPCArg::Type::STR, true },
857
- }}
858
- .ToString () +
859
- " \n Arguments:\n "
860
- " 1. conf_target (numeric) Confirmation target in blocks (1 - 1008)\n "
861
- " 2. \" estimate_mode\" (string, optional, default=CONSERVATIVE) The fee estimate mode.\n "
824
+ {" conf_target" , RPCArg::Type::NUM, /* opt */ false , /* default_val */ " " , " Confirmation target in blocks (1 - 1008)" },
825
+ {" estimate_mode" , RPCArg::Type::STR, /* opt */ true , /* default_val */ " CONSERVATIVE" , " The fee estimate mode.\n "
862
826
" Whether to return a more conservative estimate which also satisfies\n "
863
827
" a longer history. A conservative estimate potentially returns a\n "
864
828
" higher feerate and is more likely to be sufficient for the desired\n "
865
829
" target, but is not as responsive to short term drops in the\n "
866
830
" prevailing fee market. Must be one of:\n "
867
831
" \" UNSET\"\n "
868
832
" \" ECONOMICAL\"\n "
869
- " \" CONSERVATIVE\"\n "
833
+ " \" CONSERVATIVE\" " },
834
+ }}
835
+ .ToString () +
870
836
" \n Result:\n "
871
837
" {\n "
872
838
" \" feerate\" : x.x, (numeric, optional) estimate fee rate in " + CURRENCY_UNIT + " /kB\n "
@@ -921,15 +887,12 @@ static UniValue estimaterawfee(const JSONRPCRequest& request)
921
887
" confirmation within conf_target blocks if possible. Uses virtual transaction size as\n "
922
888
" defined in BIP 141 (witness data is discounted).\n " ,
923
889
{
924
- {" conf_target" , RPCArg::Type::NUM, false },
925
- {" threshold" , RPCArg::Type::NUM, true },
890
+ {" conf_target" , RPCArg::Type::NUM, /* opt */ false , /* default_val */ " " , " Confirmation target in blocks (1 - 1008)" },
891
+ {" threshold" , RPCArg::Type::NUM, /* opt */ true , /* default_val */ " " , " The proportion of transactions in a given feerate range that must have been\n "
892
+ " confirmed within conf_target in order to consider those feerates as high enough and proceed to check\n "
893
+ " lower buckets. Default: 0.95" },
926
894
}}
927
895
.ToString () +
928
- " \n Arguments:\n "
929
- " 1. conf_target (numeric) Confirmation target in blocks (1 - 1008)\n "
930
- " 2. threshold (numeric, optional) The proportion of transactions in a given feerate range that must have been\n "
931
- " confirmed within conf_target in order to consider those feerates as high enough and proceed to check\n "
932
- " lower buckets. Default: 0.95\n "
933
896
" \n Result:\n "
934
897
" {\n "
935
898
" \" short\" : { (json object, optional) estimate for short time horizon\n "
0 commit comments