@@ -87,10 +87,15 @@ static UniValue getnetworkhashps(const JSONRPCRequest& request)
8787{
8888 if (request.fHelp || request.params .size () > 2 )
8989 throw std::runtime_error (
90- " getnetworkhashps ( nblocks height )\n "
91- " \n Returns the estimated network hashes per second based on the last n blocks.\n "
92- " Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.\n "
93- " Pass in [height] to estimate the network speed at the time when a certain block was found.\n "
90+ RPCHelpMan{" getnetworkhashps" ,
91+ " \n Returns the estimated network hashes per second based on the last n blocks.\n "
92+ " Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.\n "
93+ " Pass in [height] to estimate the network speed at the time when a certain block was found.\n " ,
94+ {
95+ {" nblocks" , RPCArg::Type::NUM, true },
96+ {" height" , RPCArg::Type::NUM, true },
97+ }}
98+ .ToString () +
9499 " \n Arguments:\n "
95100 " 1. nblocks (numeric, optional, default=120) The number of blocks, or -1 for blocks since last difficulty change.\n "
96101 " 2. height (numeric, optional, default=-1) To estimate at the time of the given height.\n "
@@ -157,8 +162,14 @@ static UniValue generatetoaddress(const JSONRPCRequest& request)
157162{
158163 if (request.fHelp || request.params .size () < 2 || request.params .size () > 3 )
159164 throw std::runtime_error (
160- " generatetoaddress nblocks address (maxtries)\n "
161- " \n Mine blocks immediately to a specified address (before the RPC call returns)\n "
165+ RPCHelpMan{" generatetoaddress" ,
166+ " \n Mine blocks immediately to a specified address (before the RPC call returns)\n " ,
167+ {
168+ {" nblocks" , RPCArg::Type::NUM, false },
169+ {" address" , RPCArg::Type::STR, false },
170+ {" maxtries" , RPCArg::Type::NUM, true },
171+ }}
172+ .ToString () +
162173 " \n Arguments:\n "
163174 " 1. nblocks (numeric, required) How many blocks are generated immediately.\n "
164175 " 2. address (string, required) The address to send the newly generated bitcoin to.\n "
@@ -193,8 +204,9 @@ static UniValue getmininginfo(const JSONRPCRequest& request)
193204{
194205 if (request.fHelp || request.params .size () != 0 )
195206 throw std::runtime_error (
196- " getmininginfo\n "
197- " \n Returns a json object containing mining-related information."
207+ RPCHelpMan{" getmininginfo" ,
208+ " \n Returns a json object containing mining-related information." , {}}
209+ .ToString () +
198210 " \n Result:\n "
199211 " {\n "
200212 " \" blocks\" : nnn, (numeric) The current block\n "
@@ -232,8 +244,14 @@ static UniValue prioritisetransaction(const JSONRPCRequest& request)
232244{
233245 if (request.fHelp || request.params .size () != 3 )
234246 throw std::runtime_error (
235- " prioritisetransaction \" txid\" dummy fee_delta\n "
236- " Accepts the transaction into mined blocks at a higher (or lower) priority\n "
247+ RPCHelpMan{" prioritisetransaction" ,
248+ " Accepts the transaction into mined blocks at a higher (or lower) priority\n " ,
249+ {
250+ {" txid" , RPCArg::Type::STR, false },
251+ {" dummy" , RPCArg::Type::NUM, false },
252+ {" fee_delta" , RPCArg::Type::NUM, false },
253+ }}
254+ .ToString () +
237255 " \n Arguments:\n "
238256 " 1. \" txid\" (string, required) The transaction id.\n "
239257 " 2. dummy (numeric, optional) API-Compatibility for previous API. Must be zero or null.\n "
@@ -295,15 +313,32 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
295313{
296314 if (request.fHelp || request.params .size () > 1 )
297315 throw std::runtime_error (
298- " getblocktemplate ( \" template_request\" )\n "
299- " \n If the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'.\n "
300- " It returns data needed to construct a block to work on.\n "
301- " For full specification, see BIPs 22, 23, 9, and 145:\n "
302- " https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki\n "
303- " https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki\n "
304- " https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes\n "
305- " https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki\n "
306-
316+ RPCHelpMan{" getblocktemplate" ,
317+ " \n If the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'.\n "
318+ " It returns data needed to construct a block to work on.\n "
319+ " For full specification, see BIPs 22, 23, 9, and 145:\n "
320+ " https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki\n "
321+ " https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki\n "
322+ " https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes\n "
323+ " https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki\n " ,
324+ {
325+ {" template_request" , RPCArg::Type::OBJ,
326+ {
327+ {" mode" , RPCArg::Type::STR, true },
328+ {" capabilities" , RPCArg::Type::ARR,
329+ {
330+ {" support" , RPCArg::Type::STR, true },
331+ },
332+ true },
333+ {" rules" , RPCArg::Type::ARR,
334+ {
335+ {" support" , RPCArg::Type::STR, true },
336+ },
337+ true },
338+ },
339+ true , " \" template_request\" " },
340+ }}
341+ .ToString () +
307342 " \n Arguments:\n "
308343 " 1. template_request (json object, optional) A json object in the following spec\n "
309344 " {\n "
@@ -703,10 +738,14 @@ static UniValue submitblock(const JSONRPCRequest& request)
703738 // We allow 2 arguments for compliance with BIP22. Argument 2 is ignored.
704739 if (request.fHelp || request.params .size () < 1 || request.params .size () > 2 ) {
705740 throw std::runtime_error (
706- " submitblock \" hexdata\" ( \" dummy\" )\n "
707- " \n Attempts to submit new block to network.\n "
708- " See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n "
709-
741+ RPCHelpMan{" submitblock" ,
742+ " \n Attempts to submit new block to network.\n "
743+ " See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n " ,
744+ {
745+ {" hexdata" , RPCArg::Type::STR_HEX, false },
746+ {" dummy" , RPCArg::Type::STR, true },
747+ }}
748+ .ToString () +
710749 " \n Arguments\n "
711750 " 1. \" hexdata\" (string, required) the hex-encoded block data to submit\n "
712751 " 2. \" dummy\" (optional) dummy value, for compatibility with BIP22. This value is ignored.\n "
@@ -767,9 +806,13 @@ static UniValue submitheader(const JSONRPCRequest& request)
767806{
768807 if (request.fHelp || request.params .size () != 1 ) {
769808 throw std::runtime_error (
770- " submitheader \" hexdata\"\n "
771- " \n Decode the given hexdata as a header and submit it as a candidate chain tip if valid."
772- " \n Throws when the header is invalid.\n "
809+ RPCHelpMan{" submitheader" ,
810+ " \n Decode the given hexdata as a header and submit it as a candidate chain tip if valid."
811+ " \n Throws when the header is invalid.\n " ,
812+ {
813+ {" hexdata" , RPCArg::Type::STR_HEX, false },
814+ }}
815+ .ToString () +
773816 " \n Arguments\n "
774817 " 1. \" hexdata\" (string, required) the hex-encoded block header data\n "
775818 " \n Result:\n "
@@ -803,11 +846,16 @@ static UniValue estimatesmartfee(const JSONRPCRequest& request)
803846{
804847 if (request.fHelp || request.params .size () < 1 || request.params .size () > 2 )
805848 throw std::runtime_error (
806- " estimatesmartfee conf_target (\" estimate_mode\" )\n "
807- " \n Estimates the approximate fee per kilobyte needed for a transaction to begin\n "
808- " confirmation within conf_target blocks if possible and return the number of blocks\n "
809- " for which the estimate is valid. Uses virtual transaction size as defined\n "
810- " in BIP 141 (witness data is discounted).\n "
849+ RPCHelpMan{" estimatesmartfee" ,
850+ " \n Estimates the approximate fee per kilobyte needed for a transaction to begin\n "
851+ " confirmation within conf_target blocks if possible and return the number of blocks\n "
852+ " for which the estimate is valid. Uses virtual transaction size as defined\n "
853+ " in BIP 141 (witness data is discounted).\n " ,
854+ {
855+ {" conf_target" , RPCArg::Type::NUM, false },
856+ {" estimate_mode" , RPCArg::Type::STR, true },
857+ }}
858+ .ToString () +
811859 " \n Arguments:\n "
812860 " 1. conf_target (numeric) Confirmation target in blocks (1 - 1008)\n "
813861 " 2. \" estimate_mode\" (string, optional, default=CONSERVATIVE) The fee estimate mode.\n "
@@ -864,14 +912,19 @@ static UniValue estimaterawfee(const JSONRPCRequest& request)
864912{
865913 if (request.fHelp || request.params .size () < 1 || request.params .size () > 2 )
866914 throw std::runtime_error (
867- " estimaterawfee conf_target (threshold)\n "
868- " \n WARNING: This interface is unstable and may disappear or change!\n "
869- " \n WARNING: This is an advanced API call that is tightly coupled to the specific\n "
870- " implementation of fee estimation. The parameters it can be called with\n "
871- " and the results it returns will change if the internal implementation changes.\n "
872- " \n Estimates the approximate fee per kilobyte needed for a transaction to begin\n "
873- " confirmation within conf_target blocks if possible. Uses virtual transaction size as\n "
874- " defined in BIP 141 (witness data is discounted).\n "
915+ RPCHelpMan{" estimaterawfee" ,
916+ " \n WARNING: This interface is unstable and may disappear or change!\n "
917+ " \n WARNING: This is an advanced API call that is tightly coupled to the specific\n "
918+ " implementation of fee estimation. The parameters it can be called with\n "
919+ " and the results it returns will change if the internal implementation changes.\n "
920+ " \n Estimates the approximate fee per kilobyte needed for a transaction to begin\n "
921+ " confirmation within conf_target blocks if possible. Uses virtual transaction size as\n "
922+ " defined in BIP 141 (witness data is discounted).\n " ,
923+ {
924+ {" conf_target" , RPCArg::Type::NUM, false },
925+ {" threshold" , RPCArg::Type::NUM, true },
926+ }}
927+ .ToString () +
875928 " \n Arguments:\n "
876929 " 1. conf_target (numeric) Confirmation target in blocks (1 - 1008)\n "
877930 " 2. threshold (numeric, optional) The proportion of transactions in a given feerate range that must have been\n "
0 commit comments