Merge #21679: rpc: Keep default argument value in correct type

bee56c78e94417f89b1f48682404e2821b57bdec rpc: Check default value type againts argument type (João Barbosa)
f81ef4303e057e85aa24772c865287c17ffa4350 rpc: Keep default argument value in correct type (João Barbosa)

Pull request description:

  Store default values of RPC arguments in the corresponding type instead of a string. The value is then serialized when the help output is needed. This change simplifies #20017.

  The following examples illustrates how to use the new `RPCArg::Default` and `RPCArg::DefaultHint`:

  ```diff
  - {"verbose", RPCArg::Type::BOOL, /* default */ "false", "True for a json object, false for array of transaction ids"}
  + {"verbose", RPCArg::Type::BOOL, RPCArg::Default(false), "True for a json object, false for array of transaction ids"}
  ```

  ```diff
  - {"nblocks", RPCArg::Type::NUM, /* default */ "one month", "Size of the window in number of blocks"}
  + {"nblocks", RPCArg::Type::NUM, RPCArg::DefaultHint("one month"), "Size of the window in number of blocks"}
  ```

  No behavior change is expected.

ACKs for top commit:
  LarryRuane:
    ACK bee56c78e94417f89b1f48682404e2821b57bdec
  MarcoFalke:
    ACK bee56c78e94417f89b1f48682404e2821b57bdec 🦅

Tree-SHA512: c47d78c918e996d36631d4ad3c933b270a34c5b446b8d736be94cf4a0a7b8c0e33d954149ec786cf9550639865b79deb6a130ad044de6030f95aac33f524293a
This commit is contained in:
MarcoFalke 2021-04-19 09:04:05 +02:00 committed by Konstantin Akimov
parent 7be514c45c
commit 0484aa63c9
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524
15 changed files with 289 additions and 259 deletions

View File

@ -289,7 +289,7 @@ static RPCHelpMan waitfornewblock()
"\nWaits for a specific new block and returns useful info about it.\n" "\nWaits for a specific new block and returns useful info about it.\n"
"\nReturns the current block on timeout or exit.\n", "\nReturns the current block on timeout or exit.\n",
{ {
{"timeout", RPCArg::Type::NUM, /* default */ "0", "Time in milliseconds to wait for a response. 0 indicates no timeout."}, {"timeout", RPCArg::Type::NUM, RPCArg::Default{0}, "Time in milliseconds to wait for a response. 0 indicates no timeout."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "",
@ -332,7 +332,7 @@ static RPCHelpMan waitforblock()
"\nReturns the current block on timeout or exit.\n", "\nReturns the current block on timeout or exit.\n",
{ {
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Block hash to wait for."}, {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Block hash to wait for."},
{"timeout", RPCArg::Type::NUM, /* default */ "0", "Time in milliseconds to wait for a response. 0 indicates no timeout."}, {"timeout", RPCArg::Type::NUM, RPCArg::Default{0}, "Time in milliseconds to wait for a response. 0 indicates no timeout."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "",
@ -379,7 +379,7 @@ static RPCHelpMan waitforblockheight()
"\nReturns the current block on timeout or exit.\n", "\nReturns the current block on timeout or exit.\n",
{ {
{"height", RPCArg::Type::NUM, RPCArg::Optional::NO, "Block height to wait for."}, {"height", RPCArg::Type::NUM, RPCArg::Optional::NO, "Block height to wait for."},
{"timeout", RPCArg::Type::NUM, /* default */ "0", "Time in milliseconds to wait for a response. 0 indicates no timeout."}, {"timeout", RPCArg::Type::NUM, RPCArg::Default{0}, "Time in milliseconds to wait for a response. 0 indicates no timeout."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "",
@ -580,8 +580,8 @@ static RPCHelpMan getrawmempool()
"\nReturns all transaction ids in memory pool as a json array of string transaction ids.\n" "\nReturns all transaction ids in memory pool as a json array of string transaction ids.\n"
"\nHint: use getmempoolentry to fetch a specific transaction from the mempool.\n", "\nHint: use getmempoolentry to fetch a specific transaction from the mempool.\n",
{ {
{"verbose", RPCArg::Type::BOOL, /* default */ "false", "True for a json object, false for array of transaction ids"}, {"verbose", RPCArg::Type::BOOL, RPCArg::Default{false}, "True for a json object, false for array of transaction ids"},
{"mempool_sequence", RPCArg::Type::BOOL, /* default */ "false", "If verbose=false, returns a json object with transaction list and mempool sequence number attached."}, {"mempool_sequence", RPCArg::Type::BOOL, RPCArg::Default{false}, "If verbose=false, returns a json object with transaction list and mempool sequence number attached."},
}, },
{ {
RPCResult{"for verbose = false", RPCResult{"for verbose = false",
@ -633,7 +633,7 @@ static RPCHelpMan getmempoolancestors()
"\nIf txid is in the mempool, returns all in-mempool ancestors.\n", "\nIf txid is in the mempool, returns all in-mempool ancestors.\n",
{ {
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id (must be in mempool)"}, {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id (must be in mempool)"},
{"verbose", RPCArg::Type::BOOL, /* default */ "false", "True for a json object, false for array of transaction ids"}, {"verbose", RPCArg::Type::BOOL, RPCArg::Default{false}, "True for a json object, false for array of transaction ids"},
}, },
{ {
RPCResult{"for verbose = false", RPCResult{"for verbose = false",
@ -700,7 +700,7 @@ static RPCHelpMan getmempooldescendants()
"\nIf txid is in the mempool, returns all in-mempool descendants.\n", "\nIf txid is in the mempool, returns all in-mempool descendants.\n",
{ {
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id (must be in mempool)"}, {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id (must be in mempool)"},
{"verbose", RPCArg::Type::BOOL, /* default */ "false", "True for a json object, false for array of transaction ids"}, {"verbose", RPCArg::Type::BOOL, RPCArg::Default{false}, "True for a json object, false for array of transaction ids"},
}, },
{ {
RPCResult{"for verbose = false", RPCResult{"for verbose = false",
@ -923,7 +923,7 @@ static RPCHelpMan getblockheader()
"If verbose is true, returns an Object with information about blockheader <hash>.\n", "If verbose is true, returns an Object with information about blockheader <hash>.\n",
{ {
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"}, {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
{"verbose", RPCArg::Type::BOOL, /* default */ "true", "true for a json object, false for the hex-encoded data"}, {"verbose", RPCArg::Type::BOOL, RPCArg::Default{true}, "true for a json object, false for the hex-encoded data"},
}, },
{ {
RPCResult{"for verbose = true", RPCResult{"for verbose = true",
@ -997,8 +997,8 @@ static RPCHelpMan getblockheaders()
"If verbose is true, each item is an Object with information about a single blockheader.\n", "If verbose is true, each item is an Object with information about a single blockheader.\n",
{ {
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"}, {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
{"count", RPCArg::Type::NUM, /* default */ strprintf("%s", MAX_HEADERS_UNCOMPRESSED_RESULT), ""}, {"count", RPCArg::Type::NUM, RPCArg::Default{int{MAX_HEADERS_UNCOMPRESSED_RESULT}}, ""},
{"verbose", RPCArg::Type::BOOL, /* default */ "true", "true for a json object, false for the hex-encoded data"}, {"verbose", RPCArg::Type::BOOL, RPCArg::Default{true}, "true for a json object, false for the hex-encoded data"},
}, },
{ {
RPCResult{"for verbose = true", RPCResult{"for verbose = true",
@ -1135,7 +1135,7 @@ static RPCHelpMan getmerkleblocks()
{ {
{"filter", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex-encoded bloom filter"}, {"filter", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex-encoded bloom filter"},
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"}, {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
{"count", RPCArg::Type::NUM, /* default */ strprintf("%s", MAX_HEADERS_UNCOMPRESSED_RESULT), ""}, {"count", RPCArg::Type::NUM, RPCArg::Default{int{MAX_HEADERS_UNCOMPRESSED_RESULT}}, ""},
}, },
RPCResult{ RPCResult{
RPCResult::Type::ARR, "", "", RPCResult::Type::ARR, "", "",
@ -1211,7 +1211,7 @@ static RPCHelpMan getblock()
"If verbosity is 2, returns an Object with information about block <hash> and information about each transaction. \n", "If verbosity is 2, returns an Object with information about block <hash> and information about each transaction. \n",
{ {
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"}, {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
{"verbosity|verbose", RPCArg::Type::NUM, /* default */ "1", "0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data"}, {"verbosity|verbose", RPCArg::Type::NUM, RPCArg::Default{1}, "0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data"},
}, },
{ {
RPCResult{"for verbosity = 0", RPCResult{"for verbosity = 0",
@ -1388,9 +1388,9 @@ static RPCHelpMan gettxoutsetinfo()
"\nReturns statistics about the unspent transaction output set.\n" "\nReturns statistics about the unspent transaction output set.\n"
"Note this call may take some time if you are not using coinstatsindex.\n", "Note this call may take some time if you are not using coinstatsindex.\n",
{ {
{"hash_type", RPCArg::Type::STR, /* default */ "hash_serialized_2", "Which UTXO set hash should be calculated. Options: 'hash_serialized_2' (the legacy algorithm), 'muhash', 'none'."}, {"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'."},
{"hash_or_height", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The block hash or height of the target height (only available with coinstatsindex).", "", {"", "string or numeric"}}, {"hash_or_height", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The block hash or height of the target height (only available with coinstatsindex).", "", {"", "string or numeric"}},
{"use_index", RPCArg::Type::BOOL, /* default */ "true", "Use coinstatsindex, if available."}, {"use_index", RPCArg::Type::BOOL, RPCArg::Default{true}, "Use coinstatsindex, if available."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "",
@ -1532,7 +1532,7 @@ static RPCHelpMan gettxout()
{ {
{"txid", RPCArg::Type::STR, RPCArg::Optional::NO, "The transaction id"}, {"txid", RPCArg::Type::STR, RPCArg::Optional::NO, "The transaction id"},
{"n", RPCArg::Type::NUM, RPCArg::Optional::NO, "vout number"}, {"n", RPCArg::Type::NUM, RPCArg::Optional::NO, "vout number"},
{"include_mempool", RPCArg::Type::BOOL, /* default */ "true", "Whether to include the mempool. Note that an unspent output that is spent in the mempool won't appear."}, {"include_mempool", RPCArg::Type::BOOL, RPCArg::Default{true}, "Whether to include the mempool. Note that an unspent output that is spent in the mempool won't appear."},
}, },
{ {
RPCResult{"If the UTXO was not found", RPCResult::Type::NONE, "", ""}, RPCResult{"If the UTXO was not found", RPCResult::Type::NONE, "", ""},
@ -1619,9 +1619,9 @@ static RPCHelpMan verifychain()
return RPCHelpMan{"verifychain", return RPCHelpMan{"verifychain",
"\nVerifies blockchain database.\n", "\nVerifies blockchain database.\n",
{ {
{"checklevel", RPCArg::Type::NUM, /* default */ strprintf("%d, range=0-4", DEFAULT_CHECKLEVEL), {"checklevel", RPCArg::Type::NUM, RPCArg::DefaultHint{strprintf("%d, range=0-4", DEFAULT_CHECKLEVEL)},
strprintf("How thorough the block verification is:\n - %s", MakeUnorderedList(CHECKLEVEL_DOC))}, strprintf("How thorough the block verification is:\n - %s", MakeUnorderedList(CHECKLEVEL_DOC))},
{"nblocks", RPCArg::Type::NUM, /* default */ strprintf("%d, 0=all", DEFAULT_CHECKBLOCKS), "The number of blocks to check."}, {"nblocks", RPCArg::Type::NUM, RPCArg::DefaultHint{strprintf("%d, 0=all", DEFAULT_CHECKBLOCKS)}, "The number of blocks to check."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::BOOL, "", "Verified or not"}, RPCResult::Type::BOOL, "", "Verified or not"},
@ -1872,8 +1872,8 @@ static RPCHelpMan getchaintips()
"Return information about all known tips in the block tree," "Return information about all known tips in the block tree,"
" including the main chain as well as orphaned branches.\n", " including the main chain as well as orphaned branches.\n",
{ {
{"count", RPCArg::Type::NUM, /* default */ "", "only show this much of latest tips"}, {"count", RPCArg::Type::NUM, RPCArg::Default{INT_MAX}, "only show this much of latest tips"},
{"branchlen", RPCArg::Type::NUM, /* default */ "", "only show tips that have equal or greater length of branch"}, {"branchlen", RPCArg::Type::NUM, RPCArg::Default{-1}, "only show tips that have equal or greater length of branch"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::ARR, "", "", RPCResult::Type::ARR, "", "",
@ -2168,8 +2168,8 @@ static RPCHelpMan getchaintxstats()
return RPCHelpMan{"getchaintxstats", return RPCHelpMan{"getchaintxstats",
"\nCompute statistics about the total number and rate of transactions in the chain.\n", "\nCompute statistics about the total number and rate of transactions in the chain.\n",
{ {
{"nblocks", RPCArg::Type::NUM, /* default */ "one month", "Size of the window in number of blocks"}, {"nblocks", RPCArg::Type::NUM, RPCArg::DefaultHint{"one month"}, "Size of the window in number of blocks"},
{"blockhash", RPCArg::Type::STR_HEX, /* default */ "chain tip", "The hash of the block that ends the window."}, {"blockhash", RPCArg::Type::STR_HEX, RPCArg::DefaultHint{"chain tip"}, "The hash of the block that ends the window."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "",
@ -2318,7 +2318,7 @@ static RPCHelpMan getblockstats()
"It won't work for some heights with pruning.\n", "It won't work for some heights with pruning.\n",
{ {
{"hash_or_height", RPCArg::Type::NUM, RPCArg::Optional::NO, "The block hash or height of the target block", "", {"", "string or numeric"}}, {"hash_or_height", RPCArg::Type::NUM, RPCArg::Optional::NO, "The block hash or height of the target block", "", {"", "string or numeric"}},
{"stats", RPCArg::Type::ARR, /* default */ "all values", "Values to plot (see result below)", {"stats", RPCArg::Type::ARR, RPCArg::DefaultHint{"all values"}, "Values to plot (see result below)",
{ {
{"height", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Selected statistic"}, {"height", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Selected statistic"},
{"time", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Selected statistic"}, {"time", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Selected statistic"},
@ -2536,10 +2536,10 @@ static RPCHelpMan getspecialtxes()
"If verbosity is 2, returns an Object with information for each transaction.\n", "If verbosity is 2, returns an Object with information for each transaction.\n",
{ {
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"}, {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
{"type", RPCArg::Type::NUM, /* default */ "-1", "Filter special txes by type, -1 means all types"}, {"type", RPCArg::Type::NUM, RPCArg::Default{-1}, "Filter special txes by type, -1 means all types"},
{"count", RPCArg::Type::NUM, /* default */ "10", "The number of transactions to return"}, {"count", RPCArg::Type::NUM, RPCArg::Default{10}, "The number of transactions to return"},
{"skip", RPCArg::Type::NUM, /* default */ "0", "The number of transactions to skip"}, {"skip", RPCArg::Type::NUM, RPCArg::Default{0}, "The number of transactions to skip"},
{"verbosity", RPCArg::Type::NUM, /* default */ "0", "0 for hashes, 1 for hex-encoded data, and 2 for json object"}, {"verbosity", RPCArg::Type::NUM, RPCArg::Default{0}, "0 for hashes, 1 for hex-encoded data, and 2 for json object"},
}, },
{ {
RPCResult{"for verbosity = 0", RPCResult{"for verbosity = 0",
@ -2761,7 +2761,7 @@ static RPCHelpMan scantxoutset()
{"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "An object with output descriptor and metadata", {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "An object with output descriptor and metadata",
{ {
{"desc", RPCArg::Type::STR, RPCArg::Optional::NO, "An output descriptor"}, {"desc", RPCArg::Type::STR, RPCArg::Optional::NO, "An output descriptor"},
{"range", RPCArg::Type::RANGE, /* default */ "1000", "The range of HD chain indexes to explore (either end or [begin,end])"}, {"range", RPCArg::Type::RANGE, RPCArg::Default{1000}, "The range of HD chain indexes to explore (either end or [begin,end])"},
}, },
}, },
}, },
@ -2907,7 +2907,7 @@ static RPCHelpMan getblockfilter()
"\nRetrieve a BIP 157 content filter for a particular block.\n", "\nRetrieve a BIP 157 content filter for a particular block.\n",
{ {
{"blockhash", RPCArg::Type::STR, RPCArg::Optional::NO, "The hash of the block"}, {"blockhash", RPCArg::Type::STR, RPCArg::Optional::NO, "The hash of the block"},
{"filtertype", RPCArg::Type::STR, /* default */ "basic", "The type name of the filter"}, {"filtertype", RPCArg::Type::STR, RPCArg::Default{"basic"}, "The type name of the filter"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "",

View File

@ -207,7 +207,7 @@ static RPCHelpMan coinjoinsalt_generate()
"\nGenerate new CoinJoin salt and store it in the wallet database\n" "\nGenerate new CoinJoin salt and store it in the wallet database\n"
"Cannot generate new salt if CoinJoin mixing is in process or wallet has private keys disabled.\n", "Cannot generate new salt if CoinJoin mixing is in process or wallet has private keys disabled.\n",
{ {
{"overwrite", RPCArg::Type::BOOL, /* default */ "false", "Generate new salt even if there is an existing salt and/or there is CoinJoin balance"}, {"overwrite", RPCArg::Type::BOOL, RPCArg::Default{false}, "Generate new salt even if there is an existing salt and/or there is CoinJoin balance"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::BOOL, "", "Status of CoinJoin salt generation and commitment" RPCResult::Type::BOOL, "", "Status of CoinJoin salt generation and commitment"
@ -309,7 +309,7 @@ static RPCHelpMan coinjoinsalt_set()
"Will overwrite existing salt. The presence of a CoinJoin balance will cause the wallet to rescan.\n", "Will overwrite existing salt. The presence of a CoinJoin balance will cause the wallet to rescan.\n",
{ {
{"salt", RPCArg::Type::STR, RPCArg::Optional::NO, "Desired CoinJoin salt value for the wallet"}, {"salt", RPCArg::Type::STR, RPCArg::Optional::NO, "Desired CoinJoin salt value for the wallet"},
{"overwrite", RPCArg::Type::BOOL, /* default */ "false", "Overwrite salt even if CoinJoin balance present"}, {"overwrite", RPCArg::Type::BOOL, RPCArg::Default{false}, "Overwrite salt even if CoinJoin balance present"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::BOOL, "", "Status of CoinJoin salt change request" RPCResult::Type::BOOL, "", "Status of CoinJoin salt change request"

View File

@ -59,13 +59,13 @@ static RPCArg GetRpcArg(const std::string& strParamName)
"The collateral transaction output index."} "The collateral transaction output index."}
}, },
{"feeSourceAddress", {"feeSourceAddress",
{"feeSourceAddress", RPCArg::Type::STR, /* default */ "", {"feeSourceAddress", RPCArg::Type::STR, RPCArg::Default{""},
"If specified wallet will only use coins from this address to fund ProTx.\n" "If specified wallet will only use coins from this address to fund ProTx.\n"
"If not specified, payoutAddress is the one that is going to be used.\n" "If not specified, payoutAddress is the one that is going to be used.\n"
"The private key belonging to this address must be known in your wallet."} "The private key belonging to this address must be known in your wallet."}
}, },
{"fundAddress", {"fundAddress",
{"fundAddress", RPCArg::Type::STR, /* default */ "", {"fundAddress", RPCArg::Type::STR, RPCArg::Default{""},
"If specified wallet will only use coins from this address to fund ProTx.\n" "If specified wallet will only use coins from this address to fund ProTx.\n"
"If not specified, payoutAddress is the one that is going to be used.\n" "If not specified, payoutAddress is the one that is going to be used.\n"
"The private key belonging to this address must be known in your wallet."} "The private key belonging to this address must be known in your wallet."}
@ -85,7 +85,7 @@ static RPCArg GetRpcArg(const std::string& strParamName)
"registered operator public key."} "registered operator public key."}
}, },
{"operatorPayoutAddress", {"operatorPayoutAddress",
{"operatorPayoutAddress", RPCArg::Type::STR, /* default */ "", {"operatorPayoutAddress", RPCArg::Type::STR, RPCArg::Default{""},
"The address used for operator reward payments.\n" "The address used for operator reward payments.\n"
"Only allowed when the ProRegTx had a non-zero operatorReward value.\n" "Only allowed when the ProRegTx had a non-zero operatorReward value.\n"
"If set to an empty string, the currently active payout address is reused."} "If set to an empty string, the currently active payout address is reused."}
@ -137,11 +137,11 @@ static RPCArg GetRpcArg(const std::string& strParamName)
"The hash of the initial ProRegTx."} "The hash of the initial ProRegTx."}
}, },
{"reason", {"reason",
{"reason", RPCArg::Type::NUM, /* default */ "", {"reason", RPCArg::Type::NUM, RPCArg::DefaultHint{"Reason is not specified"},
"The reason for masternode service revocation."} "The reason for masternode service revocation."}
}, },
{"submit", {"submit",
{"submit", RPCArg::Type::BOOL, /* default */ "true", {"submit", RPCArg::Type::BOOL, RPCArg::Default{true},
"If true, the resulting transaction is sent to the network."} "If true, the resulting transaction is sent to the network."}
}, },
{"votingAddress_register", {"votingAddress_register",
@ -1349,7 +1349,7 @@ static RPCHelpMan protx_list()
return RPCHelpMan{"protx list", return RPCHelpMan{"protx list",
"\nLists all ProTxs in your wallet or on-chain, depending on the given type.\n", "\nLists all ProTxs in your wallet or on-chain, depending on the given type.\n",
{ {
{"type", RPCArg::Type::STR, /* default */ "registered", {"type", RPCArg::Type::STR, RPCArg::Default{"registered"},
"\nAvailable types:\n" "\nAvailable types:\n"
" registered - List all ProTx which are registered at the given chain height.\n" " registered - List all ProTx which are registered at the given chain height.\n"
" This will also include ProTx which failed PoSe verification.\n" " This will also include ProTx which failed PoSe verification.\n"
@ -1360,8 +1360,8 @@ static RPCHelpMan protx_list()
" This will also include ProTx which failed PoSe verification.\n" " This will also include ProTx which failed PoSe verification.\n"
#endif #endif
}, },
{"detailed", RPCArg::Type::BOOL, /* default */ "false", "If not specified, only the hashes of the ProTx will be returned."}, {"detailed", RPCArg::Type::BOOL, RPCArg::Default{false}, "If not specified, only the hashes of the ProTx will be returned."},
{"height", RPCArg::Type::NUM, /* default */ "current chain-tip", ""}, {"height", RPCArg::Type::NUM, RPCArg::DefaultHint{"current chain-tip"}, ""},
}, },
RPCResults{}, RPCResults{},
RPCExamples{""}, RPCExamples{""},
@ -1470,7 +1470,7 @@ static RPCHelpMan protx_info()
"\nReturns detailed information about a deterministic masternode.\n", "\nReturns detailed information about a deterministic masternode.\n",
{ {
GetRpcArg("proTxHash"), GetRpcArg("proTxHash"),
{"blockHash", RPCArg::Type::STR_HEX, /* default*/ "(chain tip)", "The hash of the block to get deterministic masternode state at"}, {"blockHash", RPCArg::Type::STR_HEX, RPCArg::DefaultHint{"(chain tip)"}, "The hash of the block to get deterministic masternode state at"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "Details about a specific deterministic masternode", RPCResult::Type::OBJ, "", "Details about a specific deterministic masternode",
@ -1720,7 +1720,7 @@ static RPCHelpMan bls_generate()
return RPCHelpMan{"bls generate", return RPCHelpMan{"bls generate",
"\nReturns a BLS secret/public key pair.\n", "\nReturns a BLS secret/public key pair.\n",
{ {
{"legacy", RPCArg::Type::BOOL, /* default */ "true until the v19 fork is activated, otherwise false", "Use legacy BLS scheme"}, {"legacy", RPCArg::Type::BOOL, RPCArg::DefaultHint{"true until the v19 fork is activated, otherwise false"}, "Use legacy BLS scheme"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "",
@ -1759,7 +1759,7 @@ static RPCHelpMan bls_fromsecret()
"\nParses a BLS secret key and returns the secret/public key pair.\n", "\nParses a BLS secret key and returns the secret/public key pair.\n",
{ {
{"secret", RPCArg::Type::STR, RPCArg::Optional::NO, "The BLS secret key"}, {"secret", RPCArg::Type::STR, RPCArg::Optional::NO, "The BLS secret key"},
{"legacy", RPCArg::Type::BOOL, /* default */ "true until the v19 fork is activated, otherwise false", "Use legacy BLS scheme"}, {"legacy", RPCArg::Type::BOOL, RPCArg::DefaultHint{"true until the v19 fork is activated, otherwise false"}, "Use legacy BLS scheme"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "",

View File

@ -33,7 +33,7 @@ static RPCHelpMan gobject_count()
return RPCHelpMan{"gobject count", return RPCHelpMan{"gobject count",
"Count governance objects and votes\n", "Count governance objects and votes\n",
{ {
{"mode", RPCArg::Type::STR, /* default */ "json", "Output format: json (\"json\") or string in free form (\"all\")"}, {"mode", RPCArg::Type::STR, RPCArg::DefaultHint{"json"}, "Output format: json (\"json\") or string in free form (\"all\")"},
}, },
RPCResults{}, RPCResults{},
RPCExamples{""}, RPCExamples{""},
@ -133,9 +133,9 @@ static RPCHelpMan gobject_prepare()
{"revision", RPCArg::Type::NUM, RPCArg::Optional::NO, "object revision in the system"}, {"revision", RPCArg::Type::NUM, RPCArg::Optional::NO, "object revision in the system"},
{"time", RPCArg::Type::NUM, RPCArg::Optional::NO, "time this object was created"}, {"time", RPCArg::Type::NUM, RPCArg::Optional::NO, "time this object was created"},
{"data-hex", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "data in hex string form"}, {"data-hex", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "data in hex string form"},
{"use-IS", RPCArg::Type::BOOL, /* default */ "false", "Deprecated and ignored"}, {"use-IS", RPCArg::Type::BOOL, RPCArg::Default{false}, "Deprecated and ignored"},
{"outputHash", RPCArg::Type::STR_HEX, /* default */ "", "the single output to submit the proposal fee from"}, {"outputHash", RPCArg::Type::STR_HEX, RPCArg::Default{""}, "the single output to submit the proposal fee from"},
{"outputIndex", RPCArg::Type::NUM, /* default */ "", "The output index."}, {"outputIndex", RPCArg::Type::NUM, RPCArg::Default{0}, "The output index."},
}, },
RPCResults{}, RPCResults{},
RPCExamples{""}, RPCExamples{""},
@ -245,7 +245,7 @@ static RPCHelpMan gobject_list_prepared()
"Returns a list of governance objects prepared by this wallet with \"gobject prepare\" sorted by their creation time.\n" "Returns a list of governance objects prepared by this wallet with \"gobject prepare\" sorted by their creation time.\n"
+ HELP_REQUIRING_PASSPHRASE, + HELP_REQUIRING_PASSPHRASE,
{ {
{"count", RPCArg::Type::NUM, /* default */ "10", "Maximum number of objects to return."}, {"count", RPCArg::Type::NUM, RPCArg::Default{10}, "Maximum number of objects to return."},
}, },
RPCResults{}, RPCResults{},
RPCExamples{""}, RPCExamples{""},
@ -694,8 +694,8 @@ static RPCHelpMan gobject_list_helper(const bool make_a_diff)
return RPCHelpMan{command, return RPCHelpMan{command,
description, description,
{ {
{"signal", RPCArg::Type::STR, /* default */ "valid", "cached signal, possible values: [valid|funding|delete|endorsed|all]"}, {"signal", RPCArg::Type::STR, RPCArg::Default{"valid"}, "cached signal, possible values: [valid|funding|delete|endorsed|all]"},
{"type", RPCArg::Type::STR, /* default */ "all", "object type, possible values: [proposals|triggers|all]"}, {"type", RPCArg::Type::STR, RPCArg::Default{"all"}, "object type, possible values: [proposals|triggers|all]"},
}, },
RPCResults{}, RPCResults{},
RPCExamples{""}, RPCExamples{""},
@ -837,8 +837,8 @@ static RPCHelpMan gobject_getcurrentvotes()
"Get only current (tallying) votes for a governance object hash (does not include old votes)\n", "Get only current (tallying) votes for a governance object hash (does not include old votes)\n",
{ {
{"governance-hash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "object id"}, {"governance-hash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "object id"},
{"txid", RPCArg::Type::STR_HEX, /* default */ "", "masternode collateral txid"}, {"txid", RPCArg::Type::STR_HEX, RPCArg::Default{""}, "masternode collateral txid"},
{"vout", RPCArg::Type::STR, /* default */ "", "masternode collateral output index, required if <txid> present"}, {"vout", RPCArg::Type::STR, RPCArg::Default{""}, "masternode collateral output index, required if <txid> present"},
}, },
RPCResults{}, RPCResults{},
RPCExamples{""}, RPCExamples{""},

View File

@ -278,8 +278,8 @@ static RPCHelpMan masternode_winners()
return RPCHelpMan{"masternode winners", return RPCHelpMan{"masternode winners",
"Print list of masternode winners\n", "Print list of masternode winners\n",
{ {
{"count", RPCArg::Type::NUM, /* default */ "", "number of last winners to return"}, {"count", RPCArg::Type::NUM, RPCArg::Default{10}, "number of last winners to return"},
{"filter", RPCArg::Type::STR, /* default */ "", "filter for returned winners"}, {"filter", RPCArg::Type::STR, RPCArg::Default{""}, "filter for returned winners"},
}, },
RPCResults{}, RPCResults{},
RPCExamples{""}, RPCExamples{""},
@ -340,8 +340,8 @@ static RPCHelpMan masternode_payments()
return RPCHelpMan{"masternode payments", return RPCHelpMan{"masternode payments",
"\nReturns an array of deterministic masternodes and their payments for the specified block\n", "\nReturns an array of deterministic masternodes and their payments for the specified block\n",
{ {
{"blockhash", RPCArg::Type::STR_HEX, /* default */ "tip", "The hash of the starting block"}, {"blockhash", RPCArg::Type::STR_HEX, RPCArg::DefaultHint{"tip"}, "The hash of the starting block"},
{"count", RPCArg::Type::NUM, /* default */ "1", "The number of blocks to return. Will return <count> previous blocks if <count> is negative. Both 1 and -1 correspond to the chain tip."}, {"count", RPCArg::Type::NUM, RPCArg::Default{1}, "The number of blocks to return. Will return <count> previous blocks if <count> is negative. Both 1 and -1 correspond to the chain tip."},
}, },
RPCResult { RPCResult {
RPCResult::Type::ARR, "", "Blocks", RPCResult::Type::ARR, "", "Blocks",
@ -531,8 +531,8 @@ static RPCHelpMan masternodelist_helper(bool is_composite)
" (can be additionally filtered, partial match)\n" " (can be additionally filtered, partial match)\n"
" votingaddress - Print the masternode voting Dash address\n", " votingaddress - Print the masternode voting Dash address\n",
{ {
{"mode", RPCArg::Type::STR, /* default */ "json", "The mode to run list in"}, {"mode", RPCArg::Type::STR, RPCArg::DefaultHint{"json"}, "The mode to run list in"},
{"filter", RPCArg::Type::STR, /* default */ "", "Filter results. Partial match by outpoint by default in all modes, additional matches in some modes are also available"}, {"filter", RPCArg::Type::STR, RPCArg::Default{""}, "Filter results. Partial match by outpoint by default in all modes, additional matches in some modes are also available"},
}, },
RPCResults{}, RPCResults{},
RPCExamples{""}, RPCExamples{""},

View File

@ -102,8 +102,8 @@ static RPCHelpMan getnetworkhashps()
"Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.\n" "Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.\n"
"Pass in [height] to estimate the network speed at the time when a certain block was found.\n", "Pass in [height] to estimate the network speed at the time when a certain block was found.\n",
{ {
{"nblocks", RPCArg::Type::NUM, /* default */ "120", "The number of blocks, or -1 for blocks since last difficulty change."}, {"nblocks", RPCArg::Type::NUM, RPCArg::Default{120}, "The number of blocks, or -1 for blocks since last difficulty change."},
{"height", RPCArg::Type::NUM, /* default */ "-1", "To estimate at the time of the given height."}, {"height", RPCArg::Type::NUM, RPCArg::Default{-1}, "To estimate at the time of the given height."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::NUM, "", "Hashes per second estimated"}, RPCResult::Type::NUM, "", "Hashes per second estimated"},
@ -230,7 +230,7 @@ static RPCHelpMan generatetodescriptor()
{ {
{"num_blocks", RPCArg::Type::NUM, RPCArg::Optional::NO, "How many blocks are generated immediately."}, {"num_blocks", RPCArg::Type::NUM, RPCArg::Optional::NO, "How many blocks are generated immediately."},
{"descriptor", RPCArg::Type::STR, RPCArg::Optional::NO, "The descriptor to send the newly generated coins to."}, {"descriptor", RPCArg::Type::STR, RPCArg::Optional::NO, "The descriptor to send the newly generated coins to."},
{"maxtries", RPCArg::Type::NUM, /* default */ ToString(DEFAULT_MAX_TRIES), "How many iterations to try."}, {"maxtries", RPCArg::Type::NUM, RPCArg::Default{DEFAULT_MAX_TRIES}, "How many iterations to try."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::ARR, "", "", RPCResult::Type::ARR, "", "",
@ -267,7 +267,7 @@ static RPCHelpMan generatetoaddress()
{ {
{"nblocks", RPCArg::Type::NUM, RPCArg::Optional::NO, "How many blocks are generated immediately."}, {"nblocks", RPCArg::Type::NUM, RPCArg::Optional::NO, "How many blocks are generated immediately."},
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The address to send the newly generated coins to."}, {"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The address to send the newly generated coins to."},
{"maxtries", RPCArg::Type::NUM, /* default */ ToString(DEFAULT_MAX_TRIES), "How many iterations to try."}, {"maxtries", RPCArg::Type::NUM, RPCArg::Default{DEFAULT_MAX_TRIES}, "How many iterations to try."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::ARR, "", "hashes of blocks generated", RPCResult::Type::ARR, "", "hashes of blocks generated",
@ -563,7 +563,7 @@ static RPCHelpMan getblocktemplate()
" https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki\n" " https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki\n"
" https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes\n", " https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes\n",
{ {
{"template_request", RPCArg::Type::OBJ, /* default_val */ "", "Format of the template", {"template_request", RPCArg::Type::OBJ, RPCArg::Default{UniValue::VOBJ}, "Format of the template",
{ {
{"mode", RPCArg::Type::STR, /* treat as named arg */ RPCArg::Optional::OMITTED_NAMED_ARG, "This must be set to \"template\", \"proposal\" (see BIP 23), or omitted"}, {"mode", RPCArg::Type::STR, /* treat as named arg */ RPCArg::Optional::OMITTED_NAMED_ARG, "This must be set to \"template\", \"proposal\" (see BIP 23), or omitted"},
{"capabilities", RPCArg::Type::ARR, /* treat as named arg */ RPCArg::Optional::OMITTED_NAMED_ARG, "A list of strings", {"capabilities", RPCArg::Type::ARR, /* treat as named arg */ RPCArg::Optional::OMITTED_NAMED_ARG, "A list of strings",
@ -571,7 +571,7 @@ static RPCHelpMan getblocktemplate()
{"str", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "client side supported feature, 'longpoll', 'coinbasevalue', 'proposal', 'serverlist', 'workid'"}, {"str", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "client side supported feature, 'longpoll', 'coinbasevalue', 'proposal', 'serverlist', 'workid'"},
}, },
}, },
{"rules", RPCArg::Type::ARR, /* default_val */ "", "A list of strings", {"rules", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "A list of strings",
{ {
{"str", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "client side supported softfork deployment"}, {"str", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "client side supported softfork deployment"},
}, },
@ -1020,7 +1020,7 @@ static RPCHelpMan submitblock()
"See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n", "See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n",
{ {
{"hexdata", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "the hex-encoded block data to submit"}, {"hexdata", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "the hex-encoded block data to submit"},
{"dummy", RPCArg::Type::STR, /* default */ "ignored", "dummy value, for compatibility with BIP22. This value is ignored."}, {"dummy", RPCArg::Type::STR, RPCArg::DefaultHint{"ignored"}, "dummy value, for compatibility with BIP22. This value is ignored."},
}, },
{ {
RPCResult{"If the block was accepted", RPCResult::Type::NONE, "", ""}, RPCResult{"If the block was accepted", RPCResult::Type::NONE, "", ""},
@ -1120,7 +1120,7 @@ static RPCHelpMan estimatesmartfee()
"for which the estimate is valid.\n", "for which the estimate is valid.\n",
{ {
{"conf_target", RPCArg::Type::NUM, RPCArg::Optional::NO, "Confirmation target in blocks (1 - 1008)"}, {"conf_target", RPCArg::Type::NUM, RPCArg::Optional::NO, "Confirmation target in blocks (1 - 1008)"},
{"estimate_mode", RPCArg::Type::STR, /* default */ "conservative", "The fee estimate mode.\n" {"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"conservative"}, "The fee estimate mode.\n"
" Whether to return a more conservative estimate which also satisfies\n" " Whether to return a more conservative estimate which also satisfies\n"
" a longer history. A conservative estimate potentially returns a\n" " a longer history. A conservative estimate potentially returns a\n"
" higher feerate and is more likely to be sufficient for the desired\n" " higher feerate and is more likely to be sufficient for the desired\n"
@ -1196,7 +1196,7 @@ static RPCHelpMan estimaterawfee()
"confirmation within conf_target blocks if possible.\n", "confirmation within conf_target blocks if possible.\n",
{ {
{"conf_target", RPCArg::Type::NUM, RPCArg::Optional::NO, "Confirmation target in blocks (1 - 1008)"}, {"conf_target", RPCArg::Type::NUM, RPCArg::Optional::NO, "Confirmation target in blocks (1 - 1008)"},
{"threshold", RPCArg::Type::NUM, /* default */ "0.95", "The proportion of transactions in a given feerate range that must have been\n" {"threshold", RPCArg::Type::NUM, RPCArg::Default{0.95}, "The proportion of transactions in a given feerate range that must have been\n"
" confirmed within conf_target in order to consider those feerates as high enough and proceed to check\n" " confirmed within conf_target in order to consider those feerates as high enough and proceed to check\n"
" lower buckets."}, " lower buckets."},
}, },

View File

@ -716,9 +716,9 @@ static RPCHelpMan getaddressmempool()
return RPCHelpMan{"getaddressmempool", return RPCHelpMan{"getaddressmempool",
"\nReturns all mempool deltas for an address (requires addressindex to be enabled).\n", "\nReturns all mempool deltas for an address (requires addressindex to be enabled).\n",
{ {
{"addresses", RPCArg::Type::ARR, /* default */ "", "", {"addresses", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "",
{ {
{"address", RPCArg::Type::STR, /* default */ "", "The base58check encoded address"}, {"address", RPCArg::Type::STR, RPCArg::Default{""}, "The base58check encoded address"},
}, },
}, },
}, },
@ -789,9 +789,9 @@ static RPCHelpMan getaddressutxos()
return RPCHelpMan{"getaddressutxos", return RPCHelpMan{"getaddressutxos",
"\nReturns all unspent outputs for an address (requires addressindex to be enabled).\n", "\nReturns all unspent outputs for an address (requires addressindex to be enabled).\n",
{ {
{"addresses", RPCArg::Type::ARR, /* default */ "", "", {"addresses", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "",
{ {
{"address", RPCArg::Type::STR, /* default */ "", "The base58check encoded address"}, {"address", RPCArg::Type::STR, RPCArg::Default{""}, "The base58check encoded address"},
}, },
}, },
}, },
@ -862,9 +862,9 @@ static RPCHelpMan getaddressdeltas()
return RPCHelpMan{"getaddressdeltas", return RPCHelpMan{"getaddressdeltas",
"\nReturns all changes for an address (requires addressindex to be enabled).\n", "\nReturns all changes for an address (requires addressindex to be enabled).\n",
{ {
{"addresses", RPCArg::Type::ARR, /* default */ "", "", {"addresses", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "",
{ {
{"address", RPCArg::Type::STR, /* default */ "", "The base58check encoded address"}, {"address", RPCArg::Type::STR, RPCArg::Default{""}, "The base58check encoded address"},
}, },
}, },
}, },
@ -959,9 +959,9 @@ static RPCHelpMan getaddressbalance()
return RPCHelpMan{"getaddressbalance", return RPCHelpMan{"getaddressbalance",
"\nReturns the balance for an address(es) (requires addressindex to be enabled).\n", "\nReturns the balance for an address(es) (requires addressindex to be enabled).\n",
{ {
{"addresses", RPCArg::Type::ARR, /* default */ "", "", {"addresses", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "",
{ {
{"address", RPCArg::Type::STR, /* default */ "", "The base58check encoded address"}, {"address", RPCArg::Type::STR, RPCArg::Default{""}, "The base58check encoded address"},
}, },
}, },
}, },
@ -1036,9 +1036,9 @@ static RPCHelpMan getaddresstxids()
return RPCHelpMan{"getaddresstxids", return RPCHelpMan{"getaddresstxids",
"\nReturns the txids for an address(es) (requires addressindex to be enabled).\n", "\nReturns the txids for an address(es) (requires addressindex to be enabled).\n",
{ {
{"addresses", RPCArg::Type::ARR, /* default */ "", "", {"addresses", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "",
{ {
{"address", RPCArg::Type::STR, /* default */ "", "The base58check encoded address"}, {"address", RPCArg::Type::STR, RPCArg::Default{""}, "The base58check encoded address"},
}, },
}, },
}, },
@ -1123,10 +1123,10 @@ static RPCHelpMan getspentinfo()
return RPCHelpMan{"getspentinfo", return RPCHelpMan{"getspentinfo",
"\nReturns the txid and index where an output is spent.\n", "\nReturns the txid and index where an output is spent.\n",
{ {
{"request", RPCArg::Type::OBJ, /* default */ "", "", {"request", RPCArg::Type::OBJ, RPCArg::Default{UniValue::VOBJ}, "",
{ {
{"txid", RPCArg::Type::STR_HEX, /* default */ "", "The hex string of the txid"}, {"txid", RPCArg::Type::STR_HEX, RPCArg::Default{""}, "The hex string of the txid"},
{"index", RPCArg::Type::NUM, /* default */ "", "The start block height"}, {"index", RPCArg::Type::NUM, RPCArg::Default{0}, "The start block height"},
}, },
}, },
}, },
@ -1245,7 +1245,7 @@ static RPCHelpMan getmemoryinfo()
return RPCHelpMan{"getmemoryinfo", return RPCHelpMan{"getmemoryinfo",
"Returns an object containing information about memory usage.\n", "Returns an object containing information about memory usage.\n",
{ {
{"mode", RPCArg::Type::STR, /* default */ "\"stats\"", "determines what kind of information is returned.\n" {"mode", RPCArg::Type::STR, RPCArg::Default{"stats"}, "determines what kind of information is returned.\n"
" - \"stats\" returns general statistics about memory usage in the daemon.\n" " - \"stats\" returns general statistics about memory usage in the daemon.\n"
" - \"mallocinfo\" returns an XML string describing low-level heap state (only available if compiled with glibc 2.10+)."}, " - \"mallocinfo\" returns an XML string describing low-level heap state (only available if compiled with glibc 2.10+)."},
}, },

View File

@ -408,8 +408,8 @@ static RPCHelpMan disconnectnode()
"\nStrictly one out of 'address' and 'nodeid' can be provided to identify the node.\n" "\nStrictly one out of 'address' and 'nodeid' can be provided to identify the node.\n"
"\nTo disconnect by nodeid, either set 'address' to the empty string, or call using the named 'nodeid' argument only.\n", "\nTo disconnect by nodeid, either set 'address' to the empty string, or call using the named 'nodeid' argument only.\n",
{ {
{"address", RPCArg::Type::STR, /* default */ "fallback to nodeid", "The IP address/port of the node"}, {"address", RPCArg::Type::STR, RPCArg::DefaultHint{"fallback to nodeid"}, "The IP address/port of the node"},
{"nodeid", RPCArg::Type::NUM, /* default */ "fallback to address", "The node ID (see getpeerinfo for node IDs)"}, {"nodeid", RPCArg::Type::NUM, RPCArg::DefaultHint{"fallback to address"}, "The node ID (see getpeerinfo for node IDs)"},
}, },
RPCResult{RPCResult::Type::NONE, "", ""}, RPCResult{RPCResult::Type::NONE, "", ""},
RPCExamples{ RPCExamples{
@ -454,7 +454,7 @@ static RPCHelpMan getaddednodeinfo()
"\nReturns information about the given added node, or all added nodes\n" "\nReturns information about the given added node, or all added nodes\n"
"(note that onetry addnodes are not listed here)\n", "(note that onetry addnodes are not listed here)\n",
{ {
{"node", RPCArg::Type::STR, /* default */ "all nodes", "If provided, return information about this specific node, otherwise all nodes are returned."}, {"node", RPCArg::Type::STR, RPCArg::DefaultHint{"all nodes"}, "If provided, return information about this specific node, otherwise all nodes are returned."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::ARR, "", "", RPCResult::Type::ARR, "", "",
@ -706,8 +706,8 @@ static RPCHelpMan setban()
{ {
{"subnet", RPCArg::Type::STR, RPCArg::Optional::NO, "The IP/Subnet (see getpeerinfo for nodes IP) with an optional netmask (default is /32 = single IP)"}, {"subnet", RPCArg::Type::STR, RPCArg::Optional::NO, "The IP/Subnet (see getpeerinfo for nodes IP) with an optional netmask (default is /32 = single IP)"},
{"command", RPCArg::Type::STR, RPCArg::Optional::NO, "'add' to add an IP/Subnet to the list, 'remove' to remove an IP/Subnet from the list"}, {"command", RPCArg::Type::STR, RPCArg::Optional::NO, "'add' to add an IP/Subnet to the list, 'remove' to remove an IP/Subnet from the list"},
{"bantime", RPCArg::Type::NUM, /* default */ "0", "time in seconds how long (or until when if [absolute] is set) the IP is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)"}, {"bantime", RPCArg::Type::NUM, RPCArg::Default{0}, "time in seconds how long (or until when if [absolute] is set) the IP is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)"},
{"absolute", RPCArg::Type::BOOL, /* default */ "false", "If set, the bantime must be an absolute timestamp expressed in " + UNIX_EPOCH_TIME}, {"absolute", RPCArg::Type::BOOL, RPCArg::Default{false}, "If set, the bantime must be an absolute timestamp expressed in " + UNIX_EPOCH_TIME},
}, },
RPCResult{RPCResult::Type::NONE, "", ""}, RPCResult{RPCResult::Type::NONE, "", ""},
RPCExamples{ RPCExamples{
@ -910,8 +910,8 @@ static RPCHelpMan getnodeaddresses()
return RPCHelpMan{"getnodeaddresses", return RPCHelpMan{"getnodeaddresses",
"\nReturn known addresses, which can potentially be used to find new nodes in the network.\n", "\nReturn known addresses, which can potentially be used to find new nodes in the network.\n",
{ {
{"count", RPCArg::Type::NUM, /* default */ "1", "The maximum number of addresses to return. Specify 0 to return all known addresses."}, {"count", RPCArg::Type::NUM, RPCArg::Default{1}, "The maximum number of addresses to return. Specify 0 to return all known addresses."},
{"network", RPCArg::Type::STR, /* default */ "all networks", "Return only addresses of the specified network. Can be one of: " + Join(GetNetworkNames(), ", ") + "."}, {"network", RPCArg::Type::STR, RPCArg::DefaultHint{"all networks"}, "Return only addresses of the specified network. Can be one of: " + Join(GetNetworkNames(), ", ") + "."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::ARR, "", "", RPCResult::Type::ARR, "", "",
@ -971,7 +971,7 @@ static RPCHelpMan addpeeraddress()
{ {
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The IP address of the peer"}, {"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The IP address of the peer"},
{"port", RPCArg::Type::NUM, RPCArg::Optional::NO, "The port of the peer"}, {"port", RPCArg::Type::NUM, RPCArg::Optional::NO, "The port of the peer"},
{"tried", RPCArg::Type::BOOL, /* default */ "false", "If true, attempt to add the peer to the tried addresses table"}, {"tried", RPCArg::Type::BOOL, RPCArg::Default{false}, "If true, attempt to add the peer to the tried addresses table"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "",

View File

@ -40,8 +40,8 @@ static RPCHelpMan quorum_list()
return RPCHelpMan{"quorum list", return RPCHelpMan{"quorum list",
"List of on-chain quorums\n", "List of on-chain quorums\n",
{ {
{"count", RPCArg::Type::NUM, /* default */ "", {"count", RPCArg::Type::NUM, RPCArg::DefaultHint{"The active quorum count if not specified"},
"Number of quorums to list. Will list active quorums if \"count\" is not specified.\n" "Number of quorums to list.\n"
"Can be CPU/disk heavy when the value is larger than the number of active quorums." "Can be CPU/disk heavy when the value is larger than the number of active quorums."
}, },
}, },
@ -67,7 +67,7 @@ static RPCHelpMan quorum_list()
int count = -1; int count = -1;
if (!request.params[0].isNull()) { if (!request.params[0].isNull()) {
count = ParseInt32V(request.params[0], "count"); count = ParseInt32V(request.params[0], "count");
if (count < 0) { if (count < -1) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "count can't be negative"); throw JSONRPCError(RPC_INVALID_PARAMETER, "count can't be negative");
} }
} }
@ -99,7 +99,7 @@ static RPCHelpMan quorum_list_extended()
return RPCHelpMan{"quorum listextended", return RPCHelpMan{"quorum listextended",
"Extended list of on-chain quorums\n", "Extended list of on-chain quorums\n",
{ {
{"height", RPCArg::Type::NUM, /* default */ "", "The height index. Will list active quorums at tip if \"height\" is not specified."}, {"height", RPCArg::Type::NUM, RPCArg::DefaultHint{"Tip height if not specified"}, "Active quorums at the height."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "",
@ -233,7 +233,7 @@ static RPCHelpMan quorum_info()
{ {
{"llmqType", RPCArg::Type::NUM, RPCArg::Optional::NO, "LLMQ type."}, {"llmqType", RPCArg::Type::NUM, RPCArg::Optional::NO, "LLMQ type."},
{"quorumHash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Block hash of quorum."}, {"quorumHash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Block hash of quorum."},
{"includeSkShare", RPCArg::Type::BOOL, /* default */ "", "Include secret key share in output."}, {"includeSkShare", RPCArg::Type::BOOL, RPCArg::Default{false}, "Include secret key share in output."},
}, },
RPCResults{}, RPCResults{},
RPCExamples{""}, RPCExamples{""},
@ -269,7 +269,7 @@ static RPCHelpMan quorum_dkgstatus()
"Return the status of the current DKG process.\n" "Return the status of the current DKG process.\n"
"Works only when SPORK_17_QUORUM_DKG_ENABLED spork is ON.\n", "Works only when SPORK_17_QUORUM_DKG_ENABLED spork is ON.\n",
{ {
{"detail_level", RPCArg::Type::NUM, /* default */ "0", {"detail_level", RPCArg::Type::NUM, RPCArg::Default{0},
"Detail level of output.\n" "Detail level of output.\n"
"0=Only show counts. 1=Show member indexes. 2=Show member's ProTxHashes."}, "0=Only show counts. 1=Show member indexes. 2=Show member's ProTxHashes."},
}, },
@ -372,9 +372,8 @@ static RPCHelpMan quorum_memberof()
"Checks which quorums the given masternode is a member of.\n", "Checks which quorums the given masternode is a member of.\n",
{ {
{"proTxHash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "ProTxHash of the masternode."}, {"proTxHash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "ProTxHash of the masternode."},
{"scanQuorumsCount", RPCArg::Type::NUM, /* default */ "", {"scanQuorumsCount", RPCArg::Type::NUM, RPCArg::DefaultHint{"The active quorum count for each specific quorum type is used"},
"Number of quorums to scan for.\n" "Number of quorums to scan for.\n"
"If not specified, the active quorum count for each specific quorum type is used.\n"
"Can be CPU/disk heavy when the value is larger than the number of active quorums." "Can be CPU/disk heavy when the value is larger than the number of active quorums."
}, },
}, },
@ -491,8 +490,8 @@ static RPCHelpMan quorum_sign()
{"llmqType", RPCArg::Type::NUM, RPCArg::Optional::NO, "LLMQ type."}, {"llmqType", RPCArg::Type::NUM, RPCArg::Optional::NO, "LLMQ type."},
{"id", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Request id."}, {"id", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Request id."},
{"msgHash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Message hash."}, {"msgHash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Message hash."},
{"quorumHash", RPCArg::Type::STR_HEX, /* default */ "", "The quorum identifier."}, {"quorumHash", RPCArg::Type::STR_HEX, RPCArg::Default{""}, "The quorum identifier."},
{"submit", RPCArg::Type::BOOL, /* default */ "true", "Submits the signature share to the network if this is true. " {"submit", RPCArg::Type::BOOL, RPCArg::Default{true}, "Submits the signature share to the network if this is true. "
"Returns an object containing the signature share if this is false."}, "Returns an object containing the signature share if this is false."},
}, },
RPCResults{}, RPCResults{},
@ -518,8 +517,8 @@ static RPCHelpMan quorum_platformsign()
{ {
{"id", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Request id."}, {"id", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Request id."},
{"msgHash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Message hash."}, {"msgHash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Message hash."},
{"quorumHash", RPCArg::Type::STR_HEX, /* default */ "", "The quorum identifier."}, {"quorumHash", RPCArg::Type::STR_HEX, RPCArg::Default{""}, "The quorum identifier."},
{"submit", RPCArg::Type::BOOL, /* default */ "true", "Submits the signature share to the network if this is true. " {"submit", RPCArg::Type::BOOL, RPCArg::Default{true}, "Submits the signature share to the network if this is true. "
"Returns an object containing the signature share if this is false."}, "Returns an object containing the signature share if this is false."},
}, },
RPCResults{}, RPCResults{},
@ -553,10 +552,10 @@ static RPCHelpMan quorum_verify()
{"id", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Request id."}, {"id", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Request id."},
{"msgHash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Message hash."}, {"msgHash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Message hash."},
{"signature", RPCArg::Type::STR, RPCArg::Optional::NO, "Quorum signature to verify."}, {"signature", RPCArg::Type::STR, RPCArg::Optional::NO, "Quorum signature to verify."},
{"quorumHash", RPCArg::Type::STR_HEX, /* default */ "", {"quorumHash", RPCArg::Type::STR_HEX, RPCArg::Default{""},
"The quorum identifier.\n" "The quorum identifier.\n"
"Set to \"\" if you want to specify signHeight instead."}, "Set to \"\" if you want to specify signHeight instead."},
{"signHeight", RPCArg::Type::NUM, /* default */ "", {"signHeight", RPCArg::Type::NUM, RPCArg::Default{-1},
"The height at which the message was signed.\n" "The height at which the message was signed.\n"
"Only works when quorumHash is \"\"."}, "Only works when quorumHash is \"\"."},
}, },
@ -787,7 +786,7 @@ static RPCHelpMan quorum_getdata()
"Possible values: 1 - Request quorum verification vector\n" "Possible values: 1 - Request quorum verification vector\n"
"2 - Request encrypted contributions for member defined by \"proTxHash\". \"proTxHash\" must be specified if this option is used.\n" "2 - Request encrypted contributions for member defined by \"proTxHash\". \"proTxHash\" must be specified if this option is used.\n"
"3 - Request both, 1 and 2"}, "3 - Request both, 1 and 2"},
{"proTxHash", RPCArg::Type::STR_HEX, /* default */ "", "The proTxHash the contributions will be requested for. Must be member of the specified LLMQ."}, {"proTxHash", RPCArg::Type::STR_HEX, RPCArg::Default{""}, "The proTxHash the contributions will be requested for. Must be member of the specified LLMQ."},
}, },
RPCResults{}, RPCResults{},
RPCExamples{""}, RPCExamples{""},
@ -832,8 +831,8 @@ static RPCHelpMan quorum_rotationinfo()
"Get quorum rotation information\n", "Get quorum rotation information\n",
{ {
{"blockRequestHash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The blockHash of the request."}, {"blockRequestHash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The blockHash of the request."},
{"extraShare", RPCArg::Type::BOOL, /* default */ "false", "Extra share"}, {"extraShare", RPCArg::Type::BOOL, RPCArg::Default{false}, "Extra share"},
{"baseBlockHash...", RPCArg::Type::STR_HEX, /* default*/ "", "baseBlockHashes"}, {"baseBlockHash...", RPCArg::Type::STR_HEX, RPCArg::DefaultHint{"baseBlockHashes …"}, "The list of block hashes"},
}, },
RPCResults{}, RPCResults{},
RPCExamples{""}, RPCExamples{""},
@ -954,7 +953,7 @@ static RPCHelpMan verifychainlock()
{ {
{"blockHash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash of the ChainLock."}, {"blockHash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash of the ChainLock."},
{"signature", RPCArg::Type::STR, RPCArg::Optional::NO, "The signature of the ChainLock."}, {"signature", RPCArg::Type::STR, RPCArg::Optional::NO, "The signature of the ChainLock."},
{"blockHeight", RPCArg::Type::NUM, /* default */ "", "The height of the ChainLock. There will be an internal lookup of \"blockHash\" if this is not provided."}, {"blockHeight", RPCArg::Type::NUM, RPCArg::DefaultHint{"There will be an internal lookup of \"blockHash\" if this is not provided."}, "The height of the ChainLock."},
}, },
RPCResults{}, RPCResults{},
RPCExamples{""}, RPCExamples{""},
@ -1012,7 +1011,7 @@ static RPCHelpMan verifyislock()
{"id", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Request id."}, {"id", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Request id."},
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id."}, {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id."},
{"signature", RPCArg::Type::STR, RPCArg::Optional::NO, "The InstantSend Lock signature to verify."}, {"signature", RPCArg::Type::STR, RPCArg::Optional::NO, "The InstantSend Lock signature to verify."},
{"maxHeight", RPCArg::Type::NUM, /* default */ "", "The maximum height to search quorums from."}, {"maxHeight", RPCArg::Type::NUM, RPCArg::Default{-1}, "The maximum height to search quorums from."},
}, },
RPCResults{}, RPCResults{},
RPCExamples{""}, RPCExamples{""},

View File

@ -131,7 +131,7 @@ static RPCHelpMan getrawtransaction()
"If verbose is 'false' or omitted, returns a string that is serialized, hex-encoded data for 'txid'.\n", "If verbose is 'false' or omitted, returns a string that is serialized, hex-encoded data for 'txid'.\n",
{ {
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"}, {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"},
{"verbose", RPCArg::Type::BOOL, /* default */ "false", "If false, return a string, otherwise return a json object"}, {"verbose", RPCArg::Type::BOOL, RPCArg::Default{false}, "If false, return a string, otherwise return a json object"},
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED_NAMED_ARG, "The block in which to look for the transaction"}, {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED_NAMED_ARG, "The block in which to look for the transaction"},
}, },
{ {
@ -290,7 +290,7 @@ static RPCHelpMan getrawtransactionmulti() {
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "The transaction id"}, {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "The transaction id"},
}}, }},
}}, }},
{"verbose", RPCArg::Type::BOOL, /* default */ "false", {"verbose", RPCArg::Type::BOOL, RPCArg::Default{false},
"If false, return a string, otherwise return a json object"}, "If false, return a string, otherwise return a json object"},
}, },
RPCResults{}, RPCResults{},
@ -744,7 +744,7 @@ static RPCHelpMan createrawtransaction()
{ {
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"}, {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"},
{"vout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The output number"}, {"vout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The output number"},
{"sequence", RPCArg::Type::NUM, /* default */ "", "The sequence number"}, {"sequence", RPCArg::Type::NUM, RPCArg::DefaultHint{"depends on the value of the 'locktime' argument"}, "The sequence number"},
}, },
}, },
}, },
@ -766,7 +766,7 @@ static RPCHelpMan createrawtransaction()
}, },
}, },
}, },
{"locktime", RPCArg::Type::NUM, /* default */ "0", "Raw locktime. Non-0 value also locktime-activates inputs"}, {"locktime", RPCArg::Type::NUM, RPCArg::Default{0}, "Raw locktime. Non-0 value also locktime-activates inputs"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::STR_HEX, "transaction", "hex string of the transaction" RPCResult::Type::STR_HEX, "transaction", "hex string of the transaction"
@ -1035,7 +1035,7 @@ static RPCHelpMan signrawtransactionwithkey()
}, },
}, },
}, },
{"sighashtype", RPCArg::Type::STR, /* default */ "ALL", "The signature hash type. Must be one of:\n" {"sighashtype", RPCArg::Type::STR, RPCArg::Default{"ALL"}, "The signature hash type. Must be one of:\n"
" \"ALL\"\n" " \"ALL\"\n"
" \"NONE\"\n" " \"NONE\"\n"
" \"SINGLE\"\n" " \"SINGLE\"\n"
@ -1114,11 +1114,11 @@ RPCHelpMan sendrawtransaction()
"\nRelated RPCs: createrawtransaction, signrawtransactionwithkey\n", "\nRelated RPCs: createrawtransaction, signrawtransactionwithkey\n",
{ {
{"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex string of the raw transaction"}, {"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex string of the raw transaction"},
{"maxfeerate", RPCArg::Type::AMOUNT, /* default */ FormatMoney(DEFAULT_MAX_RAW_TX_FEE_RATE.GetFeePerK()), {"maxfeerate", RPCArg::Type::AMOUNT, RPCArg::Default{FormatMoney(DEFAULT_MAX_RAW_TX_FEE_RATE.GetFeePerK())},
"Reject transactions whose fee rate is higher than the specified value, expressed in " + CURRENCY_UNIT + "Reject transactions whose fee rate is higher than the specified value, expressed in " + CURRENCY_UNIT +
"/kB.\nSet to 0 to accept any fee rate.\n"}, "/kB.\nSet to 0 to accept any fee rate.\n"},
{"instantsend", RPCArg::Type::BOOL, RPCArg::Optional::OMITTED, "Deprecated and ignored"}, {"instantsend", RPCArg::Type::BOOL, RPCArg::Optional::OMITTED, "Deprecated and ignored"},
{"bypasslimits", RPCArg::Type::BOOL, /* default_val */ "false", "Bypass transaction policy limits"}, {"bypasslimits", RPCArg::Type::BOOL, RPCArg::Default{false}, "Bypass transaction policy limits"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::STR_HEX, "", "The transaction hash in hex" RPCResult::Type::STR_HEX, "", "The transaction hash in hex"
@ -1184,7 +1184,7 @@ static RPCHelpMan testmempoolaccept()
{"rawtx", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, ""}, {"rawtx", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, ""},
}, },
}, },
{"maxfeerate", RPCArg::Type::AMOUNT, /* default */ FormatMoney(DEFAULT_MAX_RAW_TX_FEE_RATE.GetFeePerK()), {"maxfeerate", RPCArg::Type::AMOUNT, RPCArg::Default{FormatMoney(DEFAULT_MAX_RAW_TX_FEE_RATE.GetFeePerK())},
"Reject transactions whose fee rate is higher than the specified value, expressed in " + CURRENCY_UNIT + "/kB\n"}, "Reject transactions whose fee rate is higher than the specified value, expressed in " + CURRENCY_UNIT + "/kB\n"},
}, },
RPCResult{ RPCResult{
@ -1619,7 +1619,7 @@ static RPCHelpMan finalizepsbt()
"Implements the Finalizer and Extractor roles.\n", "Implements the Finalizer and Extractor roles.\n",
{ {
{"psbt", RPCArg::Type::STR, RPCArg::Optional::NO, "A base64 string of a PSBT"}, {"psbt", RPCArg::Type::STR, RPCArg::Optional::NO, "A base64 string of a PSBT"},
{"extract", RPCArg::Type::BOOL, /* default */ "true", "If true and the transaction is complete,\n" {"extract", RPCArg::Type::BOOL, RPCArg::Default{true}, "If true and the transaction is complete,\n"
" extract and return the complete transaction in normal network serialization instead of the PSBT."}, " extract and return the complete transaction in normal network serialization instead of the PSBT."},
}, },
RPCResult{ RPCResult{
@ -1681,7 +1681,7 @@ static RPCHelpMan createpsbt()
{ {
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"}, {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"},
{"vout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The output number"}, {"vout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The output number"},
{"sequence", RPCArg::Type::NUM, /* default */ "depends on the value of 'locktime' argument", "The sequence number"}, {"sequence", RPCArg::Type::NUM, RPCArg::DefaultHint{"depends on the value of the 'locktime' argument"}, "The sequence number"},
}, },
}, },
}, },
@ -1703,7 +1703,7 @@ static RPCHelpMan createpsbt()
}, },
}, },
}, },
{"locktime", RPCArg::Type::NUM, /* default */ "0", "Raw locktime. Non-0 value also locktime-activates inputs"}, {"locktime", RPCArg::Type::NUM, RPCArg::Default{0}, "Raw locktime. Non-0 value also locktime-activates inputs"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::STR, "", "The resulting raw transaction (base64-encoded string)" RPCResult::Type::STR, "", "The resulting raw transaction (base64-encoded string)"
@ -1749,7 +1749,7 @@ static RPCHelpMan converttopsbt()
"createpsbt and walletcreatefundedpsbt should be used for new applications.\n", "createpsbt and walletcreatefundedpsbt should be used for new applications.\n",
{ {
{"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex string of a raw transaction"}, {"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex string of a raw transaction"},
{"permitsigdata", RPCArg::Type::BOOL, /* default */ "false", "If true, any signatures in the input will be discarded and conversion\n" {"permitsigdata", RPCArg::Type::BOOL, RPCArg::Default{false}, "If true, any signatures in the input will be discarded and conversion\n"
" will continue. If false, RPC will fail if any signatures are present."}, " will continue. If false, RPC will fail if any signatures are present."},
}, },
RPCResult{ RPCResult{
@ -1809,7 +1809,7 @@ static RPCHelpMan utxoupdatepsbt()
{"", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "An output descriptor"}, {"", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "An output descriptor"},
{"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "An object with an output descriptor and extra information", { {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "An object with an output descriptor and extra information", {
{"desc", RPCArg::Type::STR, RPCArg::Optional::NO, "An output descriptor"}, {"desc", RPCArg::Type::STR, RPCArg::Optional::NO, "An output descriptor"},
{"range", RPCArg::Type::RANGE, "1000", "Up to what index HD chains should be explored (either end or [begin,end])"}, {"range", RPCArg::Type::RANGE, RPCArg::Default{1000}, "Up to what index HD chains should be explored (either end or [begin,end])"},
}}, }},
}}, }},
}, },

View File

@ -168,8 +168,8 @@ static RPCHelpMan help()
return RPCHelpMan{"help", return RPCHelpMan{"help",
"\nList all commands, or get help for a specified command.\n", "\nList all commands, or get help for a specified command.\n",
{ {
{"command", RPCArg::Type::STR, /* default */ "all commands", "The command to get help on"}, {"command", RPCArg::Type::STR, RPCArg::DefaultHint{"all commands"}, "The command to get help on"},
{"subcommand", RPCArg::Type::STR, /* default */ "all subcommands", "The subcommand to get help on."}, {"subcommand", RPCArg::Type::STR, RPCArg::DefaultHint{"all subcommands"}, "The subcommand to get help on."},
}, },
{ {
RPCResult{RPCResult::Type::STR, "", "The help text"}, RPCResult{RPCResult::Type::STR, "", "The help text"},

View File

@ -480,6 +480,33 @@ RPCHelpMan::RPCHelpMan(std::string name, std::string description, std::vector<RP
for (const std::string& name : names) { for (const std::string& name : names) {
CHECK_NONFATAL(named_args.insert(name).second); CHECK_NONFATAL(named_args.insert(name).second);
} }
// Default value type should match argument type only when defined
if (arg.m_fallback.index() == 2) {
const RPCArg::Type type = arg.m_type;
switch (std::get<RPCArg::Default>(arg.m_fallback).getType()) {
case UniValue::VOBJ:
CHECK_NONFATAL(type == RPCArg::Type::OBJ);
break;
case UniValue::VARR:
CHECK_NONFATAL(type == RPCArg::Type::ARR);
break;
case UniValue::VSTR:
CHECK_NONFATAL(type == RPCArg::Type::STR || type == RPCArg::Type::STR_HEX || type == RPCArg::Type::AMOUNT);
break;
case UniValue::VNUM:
CHECK_NONFATAL(type == RPCArg::Type::NUM || type == RPCArg::Type::AMOUNT || type == RPCArg::Type::RANGE);
break;
case UniValue::VBOOL:
CHECK_NONFATAL(type == RPCArg::Type::BOOL);
break;
case UniValue::VNULL:
// Null values are accepted in all arguments
break;
default:
CHECK_NONFATAL(false);
break;
}
}
} }
} }
@ -625,7 +652,7 @@ std::string RPCArg::GetName() const
bool RPCArg::IsOptional() const bool RPCArg::IsOptional() const
{ {
if (m_fallback.index() == 1) { if (m_fallback.index() != 0) {
return true; return true;
} else { } else {
return RPCArg::Optional::NO != std::get<RPCArg::Optional>(m_fallback); return RPCArg::Optional::NO != std::get<RPCArg::Optional>(m_fallback);
@ -673,7 +700,9 @@ std::string RPCArg::ToDescriptionString() const
} // no default case, so the compiler can warn about missing cases } // no default case, so the compiler can warn about missing cases
} }
if (m_fallback.index() == 1) { if (m_fallback.index() == 1) {
ret += ", optional, default=" + std::get<std::string>(m_fallback); ret += ", optional, default=" + std::get<RPCArg::DefaultHint>(m_fallback);
} else if (m_fallback.index() == 2) {
ret += ", optional, default=" + std::get<RPCArg::Default>(m_fallback).write();
} else { } else {
switch (std::get<RPCArg::Optional>(m_fallback)) { switch (std::get<RPCArg::Optional>(m_fallback)) {
case RPCArg::Optional::OMITTED: { case RPCArg::Optional::OMITTED: {

View File

@ -162,7 +162,9 @@ struct RPCArg {
*/ */
OMITTED, OMITTED,
}; };
using Fallback = std::variant<Optional, /* default value for optional args */ std::string>; using DefaultHint = std::string;
using Default = UniValue;
using Fallback = std::variant<Optional, /* hint for default value */ DefaultHint, /* default constant value */ Default>;
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) 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)
const Type m_type; const Type m_type;
const bool m_hidden; const bool m_hidden;

View File

@ -80,8 +80,8 @@ RPCHelpMan importprivkey()
"may report that the imported key exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.\n", "may report that the imported key exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.\n",
{ {
{"privkey", RPCArg::Type::STR, RPCArg::Optional::NO, "The private key (see dumpprivkey)"}, {"privkey", RPCArg::Type::STR, RPCArg::Optional::NO, "The private key (see dumpprivkey)"},
{"label", RPCArg::Type::STR, /* default */ "current label if address exists, otherwise \"\"", "An optional label"}, {"label", RPCArg::Type::STR, RPCArg::DefaultHint{"current label if address exists, otherwise \"\""}, "An optional label"},
{"rescan", RPCArg::Type::BOOL, /* default */ "true", "Rescan the wallet for transactions"}, {"rescan", RPCArg::Type::BOOL, RPCArg::Default{true}, "Rescan the wallet for transactions"},
}, },
RPCResult{RPCResult::Type::NONE, "", ""}, RPCResult{RPCResult::Type::NONE, "", ""},
RPCExamples{ RPCExamples{
@ -200,9 +200,9 @@ RPCHelpMan importaddress()
"as change, and not show up in many RPCs.\n", "as change, and not show up in many RPCs.\n",
{ {
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The Dash address (or hex-encoded script)"}, {"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The Dash address (or hex-encoded script)"},
{"label", RPCArg::Type::STR, /* default */ "\"\"", "An optional label"}, {"label", RPCArg::Type::STR, RPCArg::Default{""}, "An optional label"},
{"rescan", RPCArg::Type::BOOL, /* default */ "true", "Rescan the wallet for transactions"}, {"rescan", RPCArg::Type::BOOL, RPCArg::Default{true}, "Rescan the wallet for transactions"},
{"p2sh", RPCArg::Type::BOOL, /* default */ "false", "Add the P2SH version of the script as well"}, {"p2sh", RPCArg::Type::BOOL, RPCArg::Default{false}, "Add the P2SH version of the script as well"},
}, },
RPCResult{RPCResult::Type::NONE, "", ""}, RPCResult{RPCResult::Type::NONE, "", ""},
RPCExamples{ RPCExamples{
@ -393,8 +393,8 @@ RPCHelpMan importpubkey()
"may report that the imported pubkey exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.\n", "may report that the imported pubkey exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.\n",
{ {
{"pubkey", RPCArg::Type::STR, RPCArg::Optional::NO, "The hex-encoded public key"}, {"pubkey", RPCArg::Type::STR, RPCArg::Optional::NO, "The hex-encoded public key"},
{"label", RPCArg::Type::STR, /* default */ "\"\"", "An optional label"}, {"label", RPCArg::Type::STR, RPCArg::Default{""}, "An optional label"},
{"rescan", RPCArg::Type::BOOL, /* default */ "true", "Rescan the wallet for transactions"}, {"rescan", RPCArg::Type::BOOL, RPCArg::Default{true}, "Rescan the wallet for transactions"},
}, },
RPCResult{RPCResult::Type::NONE, "", ""}, RPCResult{RPCResult::Type::NONE, "", ""},
RPCExamples{ RPCExamples{
@ -634,7 +634,7 @@ RPCHelpMan importelectrumwallet()
"\nImports keys from an Electrum wallet export file (.csv or .json)\n", "\nImports keys from an Electrum wallet export file (.csv or .json)\n",
{ {
{"filename", RPCArg::Type::STR, RPCArg::Optional::NO, "The Electrum wallet export file, should be in csv or json format"}, {"filename", RPCArg::Type::STR, RPCArg::Optional::NO, "The Electrum wallet export file, should be in csv or json format"},
{"index", RPCArg::Type::NUM, /* default */ "0", "Rescan the wallet for transactions starting from this block index"}, {"index", RPCArg::Type::NUM, RPCArg::Default{0}, "Rescan the wallet for transactions starting from this block index"},
}, },
RPCResult{RPCResult::Type::NONE, "", ""}, RPCResult{RPCResult::Type::NONE, "", ""},
RPCExamples{ RPCExamples{
@ -1462,7 +1462,7 @@ RPCHelpMan importmulti()
{ {
{"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "", {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
{ {
{"desc", RPCArg::Type::STR, /* default */ "", "Descriptor to import. If using descriptor, do not also provide address/scriptPubKey, scripts, or pubkeys" {"desc", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Descriptor to import. If using descriptor, do not also provide address/scriptPubKey, scripts, or pubkeys"
}, },
{"scriptPubKey", RPCArg::Type::STR, RPCArg::Optional::NO, "Type of scriptPubKey (string for script, json for address). Should not be provided if using a descriptor", {"scriptPubKey", RPCArg::Type::STR, RPCArg::Optional::NO, "Type of scriptPubKey (string for script, json for address). Should not be provided if using a descriptor",
/* oneline_description */ "", {"\"<script>\" | { \"address\":\"<address>\" }", "string / json"} /* oneline_description */ "", {"\"<script>\" | { \"address\":\"<address>\" }", "string / json"}
@ -1476,28 +1476,28 @@ RPCHelpMan importmulti()
/* oneline_description */ "", {"timestamp | \"now\"", "integer / string"} /* oneline_description */ "", {"timestamp | \"now\"", "integer / string"}
}, },
{"redeemscript", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Allowed only if the scriptPubKey is a P2SH address or a P2SH scriptPubKey"}, {"redeemscript", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Allowed only if the scriptPubKey is a P2SH address or a P2SH scriptPubKey"},
{"pubkeys", RPCArg::Type::ARR, /* default */ "empty array", "Array of strings giving pubkeys to import. They must occur in P2PKH scripts. They are not required when the private key is also provided (see the \"keys\" argument).", {"pubkeys", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "Array of strings giving pubkeys to import. They must occur in P2PKH or P2WPKH scripts. They are not required when the private key is also provided (see the \"keys\" argument).",
{ {
{"pubKey", RPCArg::Type::STR, RPCArg::Optional::OMITTED, ""}, {"pubKey", RPCArg::Type::STR, RPCArg::Optional::OMITTED, ""},
} }
}, },
{"keys", RPCArg::Type::ARR, /* default */ "empty array", "Array of strings giving private keys whose corresponding public keys must occur in the output or redeemscript.", {"keys", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "Array of strings giving private keys whose corresponding public keys must occur in the output or redeemscript.",
{ {
{"key", RPCArg::Type::STR, RPCArg::Optional::OMITTED, ""}, {"key", RPCArg::Type::STR, RPCArg::Optional::OMITTED, ""},
} }
}, },
{"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"}, {"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"},
{"internal", RPCArg::Type::BOOL, /* default */ "false", "Stating whether matching outputs should be treated as not incoming payments (also known as change)"}, {"internal", RPCArg::Type::BOOL, RPCArg::Default{false}, "Stating whether matching outputs should be treated as not incoming payments (also known as change)"},
{"watchonly", RPCArg::Type::BOOL, /* default */ "false", "Stating whether matching outputs should be considered watchonly."}, {"watchonly", RPCArg::Type::BOOL, RPCArg::Default{false}, "Stating whether matching outputs should be considered watchonly."},
{"label", RPCArg::Type::STR, /* default */ "''", "Label to assign to the address, only allowed with internal=false"}, {"label", RPCArg::Type::STR, RPCArg::Default{""}, "Label to assign to the address, only allowed with internal=false"},
{"keypool", RPCArg::Type::BOOL, /* default */ "false", "Stating whether imported public keys should be added to the keypool for when users request new addresses. Only allowed when wallet private keys are disabled"}, {"keypool", RPCArg::Type::BOOL, RPCArg::Default{false}, "Stating whether imported public keys should be added to the keypool for when users request new addresses. Only allowed when wallet private keys are disabled"},
}, },
}, },
}, },
"\"requests\""}, "\"requests\""},
{"options", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, "", {"options", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, "",
{ {
{"rescan", RPCArg::Type::BOOL, /* default */ "true", "Stating if should rescan the blockchain after all imports"}, {"rescan", RPCArg::Type::BOOL, RPCArg::Default{true}, "Stating if should rescan the blockchain after all imports"},
}, },
"\"options\""}, "\"options\""},
}, },
@ -1791,7 +1791,7 @@ RPCHelpMan importdescriptors() {
{"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "", {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
{ {
{"desc", RPCArg::Type::STR, RPCArg::Optional::NO, "Descriptor to import."}, {"desc", RPCArg::Type::STR, RPCArg::Optional::NO, "Descriptor to import."},
{"active", RPCArg::Type::BOOL, /* default */ "false", "Set this descriptor to be the active descriptor for the corresponding output type/externality"}, {"active", RPCArg::Type::BOOL, RPCArg::Default{false}, "Set this descriptor to be the active descriptor for the corresponding output type/externality"},
{"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"}, {"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"},
{"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"}, {"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"},
{"timestamp", RPCArg::Type::NUM, RPCArg::Optional::NO, "Time from which to start rescanning the blockchain for this descriptor, in " + UNIX_EPOCH_TIME + "\n" {"timestamp", RPCArg::Type::NUM, RPCArg::Optional::NO, "Time from which to start rescanning the blockchain for this descriptor, in " + UNIX_EPOCH_TIME + "\n"
@ -1801,8 +1801,8 @@ RPCHelpMan importdescriptors() {
" of all descriptors being imported will be scanned.", " of all descriptors being imported will be scanned.",
/* oneline_description */ "", {"timestamp | \"now\"", "integer / string"} /* oneline_description */ "", {"timestamp | \"now\"", "integer / string"}
}, },
{"internal", RPCArg::Type::BOOL, /* default */ "false", "Whether matching outputs should be treated as not incoming payments (e.g. change)"}, {"internal", RPCArg::Type::BOOL, RPCArg::Default{false}, "Whether matching outputs should be treated as not incoming payments (e.g. change)"},
{"label", RPCArg::Type::STR, /* default */ "''", "Label to assign to the address, only allowed with internal=false"}, {"label", RPCArg::Type::STR, RPCArg::Default{""}, "Label to assign to the address, only allowed with internal=false"},
}, },
}, },
}, },

View File

@ -241,7 +241,7 @@ RPCHelpMan getnewaddress()
"If 'label' is specified, it is added to the address book \n" "If 'label' is specified, it is added to the address book \n"
"so payments received with the address will be associated with 'label'.\n", "so payments received with the address will be associated with 'label'.\n",
{ {
{"label", RPCArg::Type::STR, /* default */ "\"\"", "The label name for the address to be linked to. It can also be set to the empty string \"\" to represent the default label. The label does not need to exist, it will be created if there is no label by the given name."}, {"label", RPCArg::Type::STR, RPCArg::Default{""}, "The label name for the address to be linked to. It can also be set to the empty string \"\" to represent the default label. The label does not need to exist, it will be created if there is no label by the given name."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::STR, "address", "The new Dash address" RPCResult::Type::STR, "address", "The new Dash address"
@ -426,17 +426,17 @@ static RPCHelpMan sendtoaddress()
{"comment_to", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "A comment to store the name of the person or organization\n" {"comment_to", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "A comment to store the name of the person or organization\n"
"to which you're sending the transaction. This is not part of the \n" "to which you're sending the transaction. This is not part of the \n"
"transaction, just kept in your wallet."}, "transaction, just kept in your wallet."},
{"subtractfeefromamount", RPCArg::Type::BOOL, /* default */ "false", "The fee will be deducted from the amount being sent.\n" {"subtractfeefromamount", RPCArg::Type::BOOL, RPCArg::Default{false}, "The fee will be deducted from the amount being sent.\n"
"The recipient will receive less amount of Dash than you enter in the amount field."}, "The recipient will receive less amount of Dash than you enter in the amount field."},
{"use_is", RPCArg::Type::BOOL, /* default */ "false", "Deprecated and ignored"}, {"use_is", RPCArg::Type::BOOL, RPCArg::Default{false}, "Deprecated and ignored"},
{"use_cj", RPCArg::Type::BOOL, /* default */ "false", "Use CoinJoin funds only"}, {"use_cj", RPCArg::Type::BOOL, RPCArg::Default{false}, "Use CoinJoin funds only"},
{"conf_target", RPCArg::Type::NUM, /* default */ "wallet -txconfirmtarget", "Confirmation target in blocks"}, {"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks"},
{"estimate_mode", RPCArg::Type::STR, /* default */ "unset", std::string() + "The fee estimate mode, must be one of (case insensitive):\n" {"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, std::string() + "The fee estimate mode, must be one of (case insensitive):\n"
" \"" + FeeModes("\"\n\"") + "\""}, " \"" + FeeModes("\"\n\"") + "\""},
{"avoid_reuse", RPCArg::Type::BOOL, /* default */ "true", "(only available if avoid_reuse wallet flag is set) Avoid spending from dirty addresses; addresses are considered\n" {"avoid_reuse", RPCArg::Type::BOOL, RPCArg::Default{true}, "(only available if avoid_reuse wallet flag is set) Avoid spending from dirty addresses; addresses are considered\n"
" dirty if they have previously been used in a transaction."}, " dirty if they have previously been used in a transaction."},
{"fee_rate", RPCArg::Type::AMOUNT, /* default */ "not set, fall back to wallet fee estimation", "Specify a fee rate in " + CURRENCY_ATOM + "/B."}, {"fee_rate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, "Specify a fee rate in " + CURRENCY_ATOM + "/B."},
{"verbose", RPCArg::Type::BOOL, /* default */ "false", "If true, return extra information about the transaction."}, {"verbose", RPCArg::Type::BOOL, RPCArg::Default{false}, "If true, return extra information about the transaction."},
}, },
{ {
RPCResult{"if verbose is not set or set to false", RPCResult{"if verbose is not set or set to false",
@ -599,7 +599,7 @@ static RPCHelpMan listaddressbalances()
return RPCHelpMan{"listaddressbalances", return RPCHelpMan{"listaddressbalances",
"\nLists addresses of this wallet and their balances\n", "\nLists addresses of this wallet and their balances\n",
{ {
{"minamount", RPCArg::Type::NUM, /* default */ "0", "Minimum balance in " + CURRENCY_UNIT + " an address should have to be shown in the list"}, {"minamount", RPCArg::Type::NUM, RPCArg::Default{0}, "Minimum balance in " + CURRENCY_UNIT + " an address should have to be shown in the list"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::ARR, "", "", RPCResult::Type::ARR, "", "",
@ -749,8 +749,8 @@ static RPCHelpMan getreceivedbyaddress()
"\nReturns the total amount received by the given address in transactions with at least minconf confirmations.\n", "\nReturns the total amount received by the given address in transactions with at least minconf confirmations.\n",
{ {
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The Dash address for transactions."}, {"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The Dash address for transactions."},
{"minconf", RPCArg::Type::NUM, /* default */ "1", "Only include transactions confirmed at least this many times."}, {"minconf", RPCArg::Type::NUM, RPCArg::Default{1}, "Only include transactions confirmed at least this many times."},
{"addlocked", RPCArg::Type::BOOL, /* default */ "false", "Whether to include transactions locked via InstantSend."}, {"addlocked", RPCArg::Type::BOOL, RPCArg::Default{false}, "Whether to include transactions locked via InstantSend."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::STR_AMOUNT, "amount", "The total amount in " + CURRENCY_UNIT + " received at this address." RPCResult::Type::STR_AMOUNT, "amount", "The total amount in " + CURRENCY_UNIT + " received at this address."
@ -788,8 +788,8 @@ static RPCHelpMan getreceivedbylabel()
"\nReturns the total amount received by addresses with <label> in transactions with specified minimum number of confirmations.\n", "\nReturns the total amount received by addresses with <label> in transactions with specified minimum number of confirmations.\n",
{ {
{"label", RPCArg::Type::STR, RPCArg::Optional::NO, "The selected label, may be the default label using \"\"."}, {"label", RPCArg::Type::STR, RPCArg::Optional::NO, "The selected label, may be the default label using \"\"."},
{"minconf", RPCArg::Type::NUM, /* default */ "1", "Only include transactions confirmed at least this many times."}, {"minconf", RPCArg::Type::NUM, RPCArg::Default{1}, "Only include transactions confirmed at least this many times."},
{"addlocked", RPCArg::Type::BOOL, /* default */ "false", "Whether to include transactions locked via InstantSend."}, {"addlocked", RPCArg::Type::BOOL, RPCArg::Default{false}, "Whether to include transactions locked via InstantSend."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::STR_AMOUNT, "amount", "The total amount in " + CURRENCY_UNIT + " received for this label." RPCResult::Type::STR_AMOUNT, "amount", "The total amount in " + CURRENCY_UNIT + " received for this label."
@ -829,10 +829,10 @@ static RPCHelpMan getbalance()
"thus affected by options which limit spendability such as -spendzeroconfchange.\n", "thus affected by options which limit spendability such as -spendzeroconfchange.\n",
{ {
{"dummy", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "Remains for backward compatibility. Must be excluded or set to \"*\"."}, {"dummy", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "Remains for backward compatibility. Must be excluded or set to \"*\"."},
{"minconf", RPCArg::Type::NUM, /* default */ "0", "Only include transactions confirmed at least this many times."}, {"minconf", RPCArg::Type::NUM, RPCArg::Default{0}, "Only include transactions confirmed at least this many times."},
{"addlocked", RPCArg::Type::BOOL, /* default */ "false", "Whether to include transactions locked via InstantSend in the wallet's balance."}, {"addlocked", RPCArg::Type::BOOL, RPCArg::Default{false}, "Whether to include transactions locked via InstantSend in the wallet's balance."},
{"include_watchonly", RPCArg::Type::BOOL, /* default */ "true for watch-only wallets, otherwise false", "Also include balance in watch-only addresses (see 'importaddress')"}, {"include_watchonly", RPCArg::Type::BOOL, RPCArg::DefaultHint{"true for watch-only wallets, otherwise false"}, "Also include balance in watch-only addresses (see 'importaddress')"},
{"avoid_reuse", RPCArg::Type::BOOL, /* default */ "true", "(only available if avoid_reuse wallet flag is set) Do not include balance in dirty outputs; addresses are considered dirty if they have previously been used in a transaction. If true, this also activates avoidpartialspends, grouping outputs by their addresses."}, {"avoid_reuse", RPCArg::Type::BOOL, RPCArg::Default{true}, "(only available if avoid_reuse wallet flag is set) Do not include balance in dirty outputs; addresses are considered dirty if they have previously been used in a transaction. If true, this also activates avoidpartialspends, grouping outputs by their addresses."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::STR_AMOUNT, "amount", "The total amount in " + CURRENCY_UNIT + " received for this wallet." RPCResult::Type::STR_AMOUNT, "amount", "The total amount in " + CURRENCY_UNIT + " received for this wallet."
@ -929,13 +929,13 @@ static RPCHelpMan sendmany()
{"address", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Subtract fee from this address"}, {"address", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Subtract fee from this address"},
}, },
}, },
{"use_is", RPCArg::Type::BOOL, /* default */ "false", "Deprecated and ignored"}, {"use_is", RPCArg::Type::BOOL, RPCArg::Default{false}, "Deprecated and ignored"},
{"use_cj", RPCArg::Type::BOOL, /* default */ "false", "Use CoinJoin funds only"}, {"use_cj", RPCArg::Type::BOOL, RPCArg::Default{false}, "Use CoinJoin funds only"},
{"conf_target", RPCArg::Type::NUM, /* default */ "wallet -txconfirmtarget", "Confirmation target in blocks"}, {"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks"},
{"estimate_mode", RPCArg::Type::STR, /* default */ "unset", std::string() + "The fee estimate mode, must be one of (case insensitive):\n" {"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, std::string() + "The fee estimate mode, must be one of (case insensitive):\n"
" \"" + FeeModes("\"\n\"") + "\""}, " \"" + FeeModes("\"\n\"") + "\""},
{"fee_rate", RPCArg::Type::AMOUNT, /* default */ "not set, fall back to wallet fee estimation", "Specify a fee rate in " + CURRENCY_ATOM + "/B."}, {"fee_rate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, "Specify a fee rate in " + CURRENCY_ATOM + "/B."},
{"verbose", RPCArg::Type::BOOL, /* default */ "false", "If true, return extra infomration about the transaction."}, {"verbose", RPCArg::Type::BOOL, RPCArg::Default{false}, "If true, return extra infomration about the transaction."},
}, },
{ {
RPCResult{"if verbose is not set or set to false", RPCResult{"if verbose is not set or set to false",
@ -1245,10 +1245,10 @@ static RPCHelpMan listreceivedbyaddress()
return RPCHelpMan{"listreceivedbyaddress", return RPCHelpMan{"listreceivedbyaddress",
"\nList balances by receiving address.\n", "\nList balances by receiving address.\n",
{ {
{"minconf", RPCArg::Type::NUM, /* default */ "1", "The minimum number of confirmations before payments are included."}, {"minconf", RPCArg::Type::NUM, RPCArg::Default{1}, "The minimum number of confirmations before payments are included."},
{"addlocked", RPCArg::Type::BOOL, /* default */ "false", "Whether to include transactions locked via InstantSend."}, {"addlocked", RPCArg::Type::BOOL, RPCArg::Default{false}, "Whether to include transactions locked via InstantSend."},
{"include_empty", RPCArg::Type::BOOL, /* default */ "false", "Whether to include addresses that haven't received any payments."}, {"include_empty", RPCArg::Type::BOOL, RPCArg::Default{false}, "Whether to include addresses that haven't received any payments."},
{"include_watchonly", RPCArg::Type::BOOL, /* default */ "true for watch-only wallets, otherwise false", "Whether to include watch-only addresses (see 'importaddress')"}, {"include_watchonly", RPCArg::Type::BOOL, RPCArg::DefaultHint{"true for watch-only wallets, otherwise false"}, "Whether to include watch-only addresses (see 'importaddress')"},
{"address_filter", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "If present, only return information on this address."}, {"address_filter", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "If present, only return information on this address."},
}, },
RPCResult{ RPCResult{
@ -1297,10 +1297,10 @@ static RPCHelpMan listreceivedbylabel()
return RPCHelpMan{"listreceivedbylabel", return RPCHelpMan{"listreceivedbylabel",
"\nList received transactions by label.\n", "\nList received transactions by label.\n",
{ {
{"minconf", RPCArg::Type::NUM, /* default */ "1", "The minimum number of confirmations before payments are included."}, {"minconf", RPCArg::Type::NUM, RPCArg::Default{1}, "The minimum number of confirmations before payments are included."},
{"addlocked", RPCArg::Type::BOOL, /* default */ "false", "Whether to include transactions locked via InstantSend."}, {"addlocked", RPCArg::Type::BOOL, RPCArg::Default{false}, "Whether to include transactions locked via InstantSend."},
{"include_empty", RPCArg::Type::BOOL, /* default */ "false", "Whether to include labels that haven't received any payments."}, {"include_empty", RPCArg::Type::BOOL, RPCArg::Default{false}, "Whether to include labels that haven't received any payments."},
{"include_watchonly", RPCArg::Type::BOOL, /* default */ "true for watch-only wallets, otherwise false", "Whether to include watch-only addresses (see 'importaddress')"}, {"include_watchonly", RPCArg::Type::BOOL, RPCArg::DefaultHint{"true for watch-only wallets, otherwise false"}, "Whether to include watch-only addresses (see 'importaddress')"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::ARR, "", "", RPCResult::Type::ARR, "", "",
@ -1466,9 +1466,9 @@ static RPCHelpMan listtransactions()
{ {
{"label|dummy", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "If set, should be a valid label name to return only incoming transactions\n" {"label|dummy", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "If set, should be a valid label name to return only incoming transactions\n"
"with the specified label, or \"*\" to disable filtering and return all transactions."}, "with the specified label, or \"*\" to disable filtering and return all transactions."},
{"count", RPCArg::Type::NUM, /* default */ "10", "The number of transactions to return"}, {"count", RPCArg::Type::NUM, RPCArg::Default{10}, "The number of transactions to return"},
{"skip", RPCArg::Type::NUM, /* default */ "0", "The number of transactions to skip"}, {"skip", RPCArg::Type::NUM, RPCArg::Default{0}, "The number of transactions to skip"},
{"include_watchonly", RPCArg::Type::BOOL, /* default */ "true for watch-only wallets, otherwise false", "Include transactions to watch-only addresses (see 'importaddress')"}, {"include_watchonly", RPCArg::Type::BOOL, RPCArg::DefaultHint{"true for watch-only wallets, otherwise false"}, "Include transactions to watch-only addresses (see 'importaddress')"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::ARR, "", "", RPCResult::Type::ARR, "", "",
@ -1580,9 +1580,9 @@ static RPCHelpMan listsinceblock()
"Additionally, if include_removed is set, transactions affecting the wallet which were removed are returned in the \"removed\" array.\n", "Additionally, if include_removed is set, transactions affecting the wallet which were removed are returned in the \"removed\" array.\n",
{ {
{"blockhash", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "If set, the block hash to list transactions since, otherwise list all transactions."}, {"blockhash", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "If set, the block hash to list transactions since, otherwise list all transactions."},
{"target_confirmations", RPCArg::Type::NUM, /* default */ "1", "Return the nth block hash from the main chain. e.g. 1 would mean the best block hash. Note: this is not used as a filter, but only affects [lastblock] in the return value"}, {"target_confirmations", RPCArg::Type::NUM, RPCArg::Default{1}, "Return the nth block hash from the main chain. e.g. 1 would mean the best block hash. Note: this is not used as a filter, but only affects [lastblock] in the return value"},
{"include_watchonly", RPCArg::Type::BOOL, /* default */ "true for watch-only wallets, otherwise false", "Include transactions to watch-only addresses (see 'importaddress')"}, {"include_watchonly", RPCArg::Type::BOOL, RPCArg::DefaultHint{"true for watch-only wallets, otherwise false"}, "Include transactions to watch-only addresses (see 'importaddress')"},
{"include_removed", RPCArg::Type::BOOL, /* default */ "true", "Show transactions that were removed due to a reorg in the \"removed\" array\n" {"include_removed", RPCArg::Type::BOOL, RPCArg::Default{true}, "Show transactions that were removed due to a reorg in the \"removed\" array\n"
"(not guaranteed to work on pruned nodes)"}, "(not guaranteed to work on pruned nodes)"},
}, },
RPCResult{ RPCResult{
@ -1718,8 +1718,8 @@ static RPCHelpMan gettransaction()
"\nGet detailed information about in-wallet transaction <txid>\n", "\nGet detailed information about in-wallet transaction <txid>\n",
{ {
{"txid", RPCArg::Type::STR, RPCArg::Optional::NO, "The transaction id"}, {"txid", RPCArg::Type::STR, RPCArg::Optional::NO, "The transaction id"},
{"include_watchonly", RPCArg::Type::BOOL, /* default */ "true for watch-only wallets, otherwise false", "Whether to include watch-only addresses in balance calculation and details[]"}, {"include_watchonly", RPCArg::Type::BOOL, RPCArg::DefaultHint{"true for watch-only wallets, otherwise false"}, "Whether to include watch-only addresses in balance calculation and details[]"},
{"verbose", RPCArg::Type::BOOL, /* default */ "false", "Whether to include a `decoded` field containing the decoded transaction (equivalent to RPC decoderawtransaction)"}, {"verbose", RPCArg::Type::BOOL, RPCArg::Default{false}, "Whether to include a `decoded` field containing the decoded transaction (equivalent to RPC decoderawtransaction)"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", Cat(Cat<std::vector<RPCResult>>( RPCResult::Type::OBJ, "", "", Cat(Cat<std::vector<RPCResult>>(
@ -1904,7 +1904,7 @@ static RPCHelpMan keypoolrefill()
"\nFills the keypool."+ "\nFills the keypool."+
HELP_REQUIRING_PASSPHRASE, HELP_REQUIRING_PASSPHRASE,
{ {
{"newsize", RPCArg::Type::NUM, /* default */ ToString(DEFAULT_KEYPOOL_SIZE), "The new keypool size"}, {"newsize", RPCArg::Type::NUM, RPCArg::Default{int{DEFAULT_KEYPOOL_SIZE}}, "The new keypool size"},
}, },
RPCResult{RPCResult::Type::NONE, "", ""}, RPCResult{RPCResult::Type::NONE, "", ""},
RPCExamples{ RPCExamples{
@ -1954,7 +1954,7 @@ static RPCHelpMan walletpassphrase()
{ {
{"passphrase", RPCArg::Type::STR, RPCArg::Optional::NO, "The wallet passphrase"}, {"passphrase", RPCArg::Type::STR, RPCArg::Optional::NO, "The wallet passphrase"},
{"timeout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The time to keep the decryption key in seconds; capped at 100000000 (~3 years)."}, {"timeout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The time to keep the decryption key in seconds; capped at 100000000 (~3 years)."},
{"mixingonly", RPCArg::Type::BOOL, /* default */ "false", "If is true sending functions are disabled."}, {"mixingonly", RPCArg::Type::BOOL, RPCArg::Default{false}, "If is true sending functions are disabled."},
}, },
RPCResult{RPCResult::Type::NONE, "", ""}, RPCResult{RPCResult::Type::NONE, "", ""},
RPCExamples{ RPCExamples{
@ -2209,7 +2209,7 @@ static RPCHelpMan lockunspent()
"Also see the listunspent call\n", "Also see the listunspent call\n",
{ {
{"unlock", RPCArg::Type::BOOL, RPCArg::Optional::NO, "Whether to unlock (true) or lock (false) the specified transactions"}, {"unlock", RPCArg::Type::BOOL, RPCArg::Optional::NO, "Whether to unlock (true) or lock (false) the specified transactions"},
{"transactions", RPCArg::Type::ARR, /* default */ "empty array", "The transaction outputs and within each, the txid (string) vout (numeric).", {"transactions", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "The transaction outputs and within each, the txid (string) vout (numeric).",
{ {
{"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "", {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
{ {
@ -2771,10 +2771,10 @@ static RPCHelpMan upgradetohd()
"\npassphrase may result in your wallet getting locked.\n" "\npassphrase may result in your wallet getting locked.\n"
"\nWarning: You will need to make a new backup of your wallet after setting the HD wallet mnemonic.\n", "\nWarning: You will need to make a new backup of your wallet after setting the HD wallet mnemonic.\n",
{ {
{"mnemonic", RPCArg::Type::STR, /* default */ "", "Mnemonic as defined in BIP39 to use for the new HD wallet. Use an empty string \"\" to generate a new random mnemonic."}, {"mnemonic", RPCArg::Type::STR, RPCArg::Default{""}, "Mnemonic as defined in BIP39 to use for the new HD wallet. Use an empty string \"\" to generate a new random mnemonic."},
{"mnemonicpassphrase", RPCArg::Type::STR, /* default */ "", "Optional mnemonic passphrase as defined in BIP39"}, {"mnemonicpassphrase", RPCArg::Type::STR, RPCArg::Default{""}, "Optional mnemonic passphrase as defined in BIP39"},
{"walletpassphrase", RPCArg::Type::STR, /* default */ "", "If your wallet is encrypted you must have your wallet passphrase here. If your wallet is not encrypted, specifying wallet passphrase will trigger wallet encryption."}, {"walletpassphrase", RPCArg::Type::STR, RPCArg::Default{""}, "If your wallet is encrypted you must have your wallet passphrase here. If your wallet is not encrypted, specifying wallet passphrase will trigger wallet encryption."},
{"rescan", RPCArg::Type::BOOL, /* default */ "false if mnemonic is empty", "Whether to rescan the blockchain for missing transactions or not"}, {"rescan", RPCArg::Type::BOOL, RPCArg::DefaultHint{"false if mnemonic is empty"}, "Whether to rescan the blockchain for missing transactions or not"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::BOOL, "", "true if successful" RPCResult::Type::BOOL, "", "true if successful"
@ -2870,7 +2870,7 @@ static RPCHelpMan loadwallet()
"\napplied to the new wallet (eg, rescan, etc).\n", "\napplied to the new wallet (eg, rescan, etc).\n",
{ {
{"filename", RPCArg::Type::STR, RPCArg::Optional::NO, "The wallet directory or .dat file."}, {"filename", RPCArg::Type::STR, RPCArg::Optional::NO, "The wallet directory or .dat file."},
{"load_on_startup", RPCArg::Type::BOOL, /* default */ "null", "Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged."}, {"load_on_startup", RPCArg::Type::BOOL, RPCArg::Default{UniValue::VNULL}, "Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "",
@ -2918,7 +2918,7 @@ static RPCHelpMan setwalletflag()
"\nChange the state of the given wallet flag for a wallet.\n", "\nChange the state of the given wallet flag for a wallet.\n",
{ {
{"flag", RPCArg::Type::STR, RPCArg::Optional::NO, "The name of the flag to change. Current available flags: " + flags}, {"flag", RPCArg::Type::STR, RPCArg::Optional::NO, "The name of the flag to change. Current available flags: " + flags},
{"value", RPCArg::Type::BOOL, /* default */ "true", "The new state."}, {"value", RPCArg::Type::BOOL, RPCArg::Default{true}, "The new state."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "",
@ -2982,12 +2982,12 @@ static RPCHelpMan createwallet()
"\nCreates and loads a new wallet.\n", "\nCreates and loads a new wallet.\n",
{ {
{"wallet_name", RPCArg::Type::STR, RPCArg::Optional::NO, "The name for the new wallet. If this is a path, the wallet will be created at the path location."}, {"wallet_name", RPCArg::Type::STR, RPCArg::Optional::NO, "The name for the new wallet. If this is a path, the wallet will be created at the path location."},
{"disable_private_keys", RPCArg::Type::BOOL, /* default */ "false", "Disable the possibility of private keys (only watchonlys are possible in this mode)."}, {"disable_private_keys", RPCArg::Type::BOOL, RPCArg::Default{false}, "Disable the possibility of private keys (only watchonlys are possible in this mode)."},
{"blank", RPCArg::Type::BOOL, /* default */ "false", "Create a blank wallet. A blank wallet has no keys or HD seed. One can be set using upgradetohd (by mnemonic) or sethdseed (WIF private key)."}, {"blank", RPCArg::Type::BOOL, RPCArg::Default{false}, "Create a blank wallet. A blank wallet has no keys or HD seed. One can be set using upgradetohd (by mnemonic) or sethdseed (WIF private key)."},
{"passphrase", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Encrypt the wallet with this passphrase."}, {"passphrase", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Encrypt the wallet with this passphrase."},
{"avoid_reuse", RPCArg::Type::BOOL, /* default */ "false", "Keep track of coin reuse, and treat dirty and clean coins differently with privacy considerations in mind."}, {"avoid_reuse", RPCArg::Type::BOOL, RPCArg::Default{false}, "Keep track of coin reuse, and treat dirty and clean coins differently with privacy considerations in mind."},
{"descriptors", RPCArg::Type::BOOL, /* default */ "false", "Create a native descriptor wallet. The wallet will use descriptors internally to handle address creation. This feature is well-tested but still considered experimental."}, {"descriptors", RPCArg::Type::BOOL, RPCArg::Default{false}, "Create a native descriptor wallet. The wallet will use descriptors internally to handle address creation. This feature is well-tested but still considered experimental."},
{"load_on_startup", RPCArg::Type::BOOL, /* default */ "null", "Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged."}, {"load_on_startup", RPCArg::Type::BOOL, RPCArg::Default{UniValue::VNULL}, "Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged."},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "",
@ -3124,8 +3124,8 @@ static RPCHelpMan unloadwallet()
"Unloads the wallet referenced by the request endpoint otherwise unloads the wallet specified in the argument.\n" "Unloads the wallet referenced by the request endpoint otherwise unloads the wallet specified in the argument.\n"
"Specifying the wallet name on a wallet endpoint is invalid.", "Specifying the wallet name on a wallet endpoint is invalid.",
{ {
{"wallet_name", RPCArg::Type::STR, /* default */ "the wallet name from the RPC endpoint", "The name of the wallet to unload. If provided both here and in the RPC endpoint, the two must be identical."}, {"wallet_name", RPCArg::Type::STR, RPCArg::DefaultHint{"the wallet name from the RPC endpoint"}, "The name of the wallet to unload. If provided both here and in the RPC endpoint, the two must be identical."},
{"load_on_startup", RPCArg::Type::BOOL, /* default */ "null", "Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged."}, {"load_on_startup", RPCArg::Type::BOOL, RPCArg::Default{UniValue::VNULL}, "Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged."},
}, },
RPCResult{RPCResult::Type::OBJ, "", "", { RPCResult{RPCResult::Type::OBJ, "", "", {
{RPCResult::Type::STR, "warning", "Warning message if wallet was not unloaded cleanly."}, {RPCResult::Type::STR, "warning", "Warning message if wallet was not unloaded cleanly."},
@ -3175,22 +3175,22 @@ static RPCHelpMan listunspent()
"with between minconf and maxconf (inclusive) confirmations.\n" "with between minconf and maxconf (inclusive) confirmations.\n"
"Optionally filter to only include txouts paid to specified addresses.\n", "Optionally filter to only include txouts paid to specified addresses.\n",
{ {
{"minconf", RPCArg::Type::NUM, /* default */ "1", "The minimum confirmations to filter"}, {"minconf", RPCArg::Type::NUM, RPCArg::Default{1}, "The minimum confirmations to filter"},
{"maxconf", RPCArg::Type::NUM, /* default */ "9999999", "The maximum confirmations to filter"}, {"maxconf", RPCArg::Type::NUM, RPCArg::Default{9999999}, "The maximum confirmations to filter"},
{"addresses", RPCArg::Type::ARR, /* default */ "empty array", "The Dash addresses to filter", {"addresses", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "The Dash addresses to filter",
{ {
{"address", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Dash address"}, {"address", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Dash address"},
}, },
}, },
{"include_unsafe", RPCArg::Type::BOOL, /* default */ "true", "Include outputs that are not safe to spend\n" {"include_unsafe", RPCArg::Type::BOOL, RPCArg::Default{true}, "Include outputs that are not safe to spend\n"
"See description of \"safe\" attribute below."}, "See description of \"safe\" attribute below."},
{"query_options", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, "JSON with query options", {"query_options", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, "JSON with query options",
{ {
{"minimumAmount", RPCArg::Type::AMOUNT, /* default */ "0", "Minimum value of each UTXO in " + CURRENCY_UNIT + ""}, {"minimumAmount", RPCArg::Type::AMOUNT, RPCArg::Default{0}, "Minimum value of each UTXO in " + CURRENCY_UNIT + ""},
{"maximumAmount", RPCArg::Type::AMOUNT, /* default */ "unlimited", "Maximum value of each UTXO in " + CURRENCY_UNIT + ""}, {"maximumAmount", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"unlimited"}, "Maximum value of each UTXO in " + CURRENCY_UNIT + ""},
{"maximumCount", RPCArg::Type::NUM, /* default */ "unlimited", "Maximum number of UTXOs"}, {"maximumCount", RPCArg::Type::NUM, RPCArg::DefaultHint{"unlimited"}, "Maximum number of UTXOs"},
{"minimumSumAmount", RPCArg::Type::AMOUNT, /* default */ "unlimited", "Minimum sum value of all UTXOs in " + CURRENCY_UNIT + ""}, {"minimumSumAmount", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"unlimited"}, "Minimum sum value of all UTXOs in " + CURRENCY_UNIT + ""},
{"coinType", RPCArg::Type::NUM, /* default */ "0", "Filter coinTypes as follows:\n" {"coinType", RPCArg::Type::NUM, RPCArg::Default{0}, "Filter coinTypes as follows:\n"
"0=ALL_COINS, 1=ONLY_FULLY_MIXED, 2=ONLY_READY_TO_MIX, 3=ONLY_NONDENOMINATED,\n" "0=ALL_COINS, 1=ONLY_FULLY_MIXED, 2=ONLY_READY_TO_MIX, 3=ONLY_NONDENOMINATED,\n"
"4=ONLY_MASTERNODE_COLLATERAL, 5=ONLY_COINJOIN_COLLATERAL" }, "4=ONLY_MASTERNODE_COLLATERAL, 5=ONLY_COINJOIN_COLLATERAL" },
}, },
@ -3528,19 +3528,19 @@ static RPCHelpMan fundrawtransaction()
{"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex string of the raw transaction"}, {"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex string of the raw transaction"},
{"options", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, "for backward compatibility: passing in a true instead of an object will result in {\"includeWatching\":true}", {"options", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, "for backward compatibility: passing in a true instead of an object will result in {\"includeWatching\":true}",
{ {
{"add_inputs", RPCArg::Type::BOOL, /* default */ "true", "For a transaction with existing inputs, automatically include more if they are not enough."}, {"add_inputs", RPCArg::Type::BOOL, RPCArg::Default{true}, "For a transaction with existing inputs, automatically include more if they are not enough."},
{"include_unsafe", RPCArg::Type::BOOL, /* default */ "false", "Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions).\n" {"include_unsafe", RPCArg::Type::BOOL, RPCArg::Default{false}, "Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions).\n"
"Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears.\n" "Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears.\n"
"If that happens, you will need to fund the transaction with different inputs and republish it."}, "If that happens, you will need to fund the transaction with different inputs and republish it."},
{"changeAddress", RPCArg::Type::STR, /* default */ "pool address", "The Dash address to receive the change"}, {"changeAddress", RPCArg::Type::STR, RPCArg::DefaultHint{"pool address"}, "The Dash address to receive the change"},
{"changePosition", RPCArg::Type::NUM, /* default */ "random", "The index of the change output"}, {"changePosition", RPCArg::Type::NUM, RPCArg::DefaultHint{"random"}, "The index of the change output"},
{"includeWatching", RPCArg::Type::BOOL, /* default */ "true for watch-only wallets, otherwise false", "Also select inputs which are watch only.\n" {"includeWatching", RPCArg::Type::BOOL, RPCArg::DefaultHint{"true for watch-only wallets, otherwise false"}, "Also select inputs which are watch only.\n"
"Only solvable inputs can be used. Watch-only destinations are solvable if the public key and/or output script was imported,\n" "Only solvable inputs can be used. Watch-only destinations are solvable if the public key and/or output script was imported,\n"
"e.g. with 'importpubkey' or 'importmulti' with the 'pubkeys' or 'desc' field."}, "e.g. with 'importpubkey' or 'importmulti' with the 'pubkeys' or 'desc' field."},
{"lockUnspents", RPCArg::Type::BOOL, /* default */ "false", "Lock selected unspent outputs"}, {"lockUnspents", RPCArg::Type::BOOL, RPCArg::Default{false}, "Lock selected unspent outputs"},
{"fee_rate", RPCArg::Type::AMOUNT, /* default */ "not set, fall back to wallet fee estimation", "Specify a fee rate in " + CURRENCY_ATOM + "/B."}, {"fee_rate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, "Specify a fee rate in " + CURRENCY_ATOM + "/B."},
{"feeRate", RPCArg::Type::AMOUNT, /* default */ "not set, fall back to wallet fee estimation", "Specify a fee rate in " + CURRENCY_UNIT + "/kB."}, {"feeRate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, "Specify a fee rate in " + CURRENCY_UNIT + "/kB."},
{"subtractFeeFromOutputs", RPCArg::Type::ARR, /* default */ "empty array", "The integers.\n" {"subtractFeeFromOutputs", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "The integers.\n"
"The fee will be equally deducted from the amount of each specified output.\n" "The fee will be equally deducted from the amount of each specified output.\n"
"Those recipients will receive less Dash than you enter in their corresponding amount field.\n" "Those recipients will receive less Dash than you enter in their corresponding amount field.\n"
"If no outputs are specified here, the sender pays the fee.", "If no outputs are specified here, the sender pays the fee.",
@ -3548,8 +3548,8 @@ static RPCHelpMan fundrawtransaction()
{"vout_index", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The zero-based output index, before a change output is added."}, {"vout_index", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The zero-based output index, before a change output is added."},
}, },
}, },
{"conf_target", RPCArg::Type::NUM, /* default */ "wallet -txconfirmtarget", "Confirmation target in blocks"}, {"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks"},
{"estimate_mode", RPCArg::Type::STR, /* default */ "unset", std::string() + "The fee estimate mode, must be one of (case insensitive):\n" {"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, std::string() + "The fee estimate mode, must be one of (case insensitive):\n"
" \"" + FeeModes("\"\n\"") + "\""}, " \"" + FeeModes("\"\n\"") + "\""},
}, },
"options"}, "options"},
@ -3624,7 +3624,7 @@ RPCHelpMan signrawtransactionwithwallet()
}, },
}, },
}, },
{"sighashtype", RPCArg::Type::STR, /* default */ "ALL", "The signature hash type. Must be one of\n" {"sighashtype", RPCArg::Type::STR, RPCArg::Default{"ALL"}, "The signature hash type. Must be one of\n"
" \"ALL\"\n" " \"ALL\"\n"
" \"NONE\"\n" " \"NONE\"\n"
" \"SINGLE\"\n" " \"SINGLE\"\n"
@ -3700,7 +3700,7 @@ static RPCHelpMan rescanblockchain()
"\nRescan the local blockchain for wallet related transactions.\n" "\nRescan the local blockchain for wallet related transactions.\n"
"Note: Use \"getwalletinfo\" to query the scanning progress.\n", "Note: Use \"getwalletinfo\" to query the scanning progress.\n",
{ {
{"start_height", RPCArg::Type::NUM, /* default */ "0", "block height where the rescan should start"}, {"start_height", RPCArg::Type::NUM, RPCArg::Default{0}, "block height where the rescan should start"},
{"stop_height", RPCArg::Type::NUM, RPCArg::Optional::OMITTED_NAMED_ARG, "the last block height that should be scanned. If none is provided it will rescan up to the tip at return time of this call."}, {"stop_height", RPCArg::Type::NUM, RPCArg::Optional::OMITTED_NAMED_ARG, "the last block height that should be scanned. If none is provided it will rescan up to the tip at return time of this call."},
}, },
RPCResult{ RPCResult{
@ -3785,7 +3785,7 @@ static RPCHelpMan wipewallettxes()
"\nWipe wallet transactions.\n" "\nWipe wallet transactions.\n"
"Note: Use \"rescanblockchain\" to initiate the scanning progress and recover wallet transactions.\n", "Note: Use \"rescanblockchain\" to initiate the scanning progress and recover wallet transactions.\n",
{ {
{"keep_confirmed", RPCArg::Type::BOOL, /* default */ "false", "Do not wipe confirmed transactions"}, {"keep_confirmed", RPCArg::Type::BOOL, RPCArg::Default{false}, "Do not wipe confirmed transactions"},
}, },
RPCResult{RPCResult::Type::NONE, "", ""}, RPCResult{RPCResult::Type::NONE, "", ""},
RPCExamples{ RPCExamples{
@ -4192,37 +4192,37 @@ static RPCHelpMan send()
}, },
}, },
}, },
{"conf_target", RPCArg::Type::NUM, /* default */ "wallet -txconfirmtarget", "Confirmation target in blocks"}, {"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks"},
{"estimate_mode", RPCArg::Type::STR, /* default */ "unset", std::string() + "The fee estimate mode, must be one of (case insensitive):\n" {"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, std::string() + "The fee estimate mode, must be one of (case insensitive):\n"
" \"" + FeeModes("\"\n\"") + "\""}, " \"" + FeeModes("\"\n\"") + "\""},
{"fee_rate", RPCArg::Type::AMOUNT, /* default */ "not set, fall back to wallet fee estimation", "Specify a fee rate in " + CURRENCY_ATOM + "/B."}, {"fee_rate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, "Specify a fee rate in " + CURRENCY_ATOM + "/B."},
{"options", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, "", {"options", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, "",
{ {
{"add_inputs", RPCArg::Type::BOOL, /* default */ "false", "If inputs are specified, automatically include more if they are not enough."}, {"add_inputs", RPCArg::Type::BOOL, RPCArg::Default{false}, "If inputs are specified, automatically include more if they are not enough."},
{"include_unsafe", RPCArg::Type::BOOL, /* default */ "false", "Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions).\n" {"include_unsafe", RPCArg::Type::BOOL, RPCArg::Default{false}, "Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions).\n"
"Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears.\n" "Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears.\n"
"If that happens, you will need to fund the transaction with different inputs and republish it."}, "If that happens, you will need to fund the transaction with different inputs and republish it."},
{"add_to_wallet", RPCArg::Type::BOOL, /* default */ "true", "When false, returns a serialized transaction which will not be added to the wallet or broadcast"}, {"add_to_wallet", RPCArg::Type::BOOL, RPCArg::Default{true}, "When false, returns a serialized transaction which will not be added to the wallet or broadcast"},
{"change_address", RPCArg::Type::STR_HEX, /* default */ "pool address", "The Dash address to receive the change"}, {"change_address", RPCArg::Type::STR_HEX, RPCArg::DefaultHint{"pool address"}, "The Dash address to receive the change"},
{"change_position", RPCArg::Type::NUM, /* default */ "random", "The index of the change output"}, {"change_position", RPCArg::Type::NUM, RPCArg::DefaultHint{"random"}, "The index of the change output"},
{"conf_target", RPCArg::Type::NUM, /* default */ "wallet -txconfirmtarget", "Confirmation target in blocks"}, {"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks"},
{"estimate_mode", RPCArg::Type::STR, /* default */ "unset", std::string() + "The fee estimate mode, must be one of (case insensitive):\n" {"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, std::string() + "The fee estimate mode, must be one of (case insensitive):\n"
" \"" + FeeModes("\"\n\"") + "\""}, " \"" + FeeModes("\"\n\"") + "\""},
{"fee_rate", RPCArg::Type::AMOUNT, /* default */ "not set, fall back to wallet fee estimation", "Specify a fee rate in " + CURRENCY_ATOM + "/B."}, {"fee_rate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, "Specify a fee rate in " + CURRENCY_ATOM + "/B."},
{"include_watching", RPCArg::Type::BOOL, /* default */ "true for watch-only wallets, otherwise false", "Also select inputs which are watch only.\n" {"include_watching", RPCArg::Type::BOOL, RPCArg::DefaultHint{"true for watch-only wallets, otherwise false"}, "Also select inputs which are watch only.\n"
"Only solvable inputs can be used. Watch-only destinations are solvable if the public key and/or output script was imported,\n" "Only solvable inputs can be used. Watch-only destinations are solvable if the public key and/or output script was imported,\n"
"e.g. with 'importpubkey' or 'importmulti' with the 'pubkeys' or 'desc' field."}, "e.g. with 'importpubkey' or 'importmulti' with the 'pubkeys' or 'desc' field."},
{"inputs", RPCArg::Type::ARR, /* default */ "empty array", "Specify inputs instead of adding them automatically. A JSON array of JSON objects", {"inputs", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "Specify inputs instead of adding them automatically. A JSON array of JSON objects",
{ {
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"}, {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"},
{"vout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The output number"}, {"vout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The output number"},
{"sequence", RPCArg::Type::NUM, RPCArg::Optional::NO, "The sequence number"}, {"sequence", RPCArg::Type::NUM, RPCArg::Optional::NO, "The sequence number"},
}, },
}, },
{"locktime", RPCArg::Type::NUM, /* default */ "0", "Raw locktime. Non-0 value also locktime-activates inputs"}, {"locktime", RPCArg::Type::NUM, RPCArg::Default{0}, "Raw locktime. Non-0 value also locktime-activates inputs"},
{"lock_unspents", RPCArg::Type::BOOL, /* default */ "false", "Lock selected unspent outputs"}, {"lock_unspents", RPCArg::Type::BOOL, RPCArg::Default{false}, "Lock selected unspent outputs"},
{"psbt", RPCArg::Type::BOOL, /* default */ "automatic", "Always return a PSBT, implies add_to_wallet=false."}, {"psbt", RPCArg::Type::BOOL, RPCArg::DefaultHint{"automatic"}, "Always return a PSBT, implies add_to_wallet=false."},
{"subtract_fee_from_outputs", RPCArg::Type::ARR, /* default */ "empty array", "Outputs to subtract the fee from, specified as integer indices.\n" {"subtract_fee_from_outputs", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "Outputs to subtract the fee from, specified as integer indices.\n"
"The fee will be equally deducted from the amount of each specified output.\n" "The fee will be equally deducted from the amount of each specified output.\n"
"Those recipients will receive less funds than you enter in their corresponding amount field.\n" "Those recipients will receive less funds than you enter in their corresponding amount field.\n"
"If no outputs are specified here, the sender pays the fee.", "If no outputs are specified here, the sender pays the fee.",
@ -4370,10 +4370,10 @@ static RPCHelpMan sethdseed()
"\nNote that you will need to MAKE A NEW BACKUP of your wallet after setting the HD wallet seed." + "\nNote that you will need to MAKE A NEW BACKUP of your wallet after setting the HD wallet seed." +
HELP_REQUIRING_PASSPHRASE, HELP_REQUIRING_PASSPHRASE,
{ {
{"newkeypool", RPCArg::Type::BOOL, /* default */ "true", "Whether to flush old unused addresses, including change addresses, from the keypool and regenerate it.\n" {"newkeypool", RPCArg::Type::BOOL, RPCArg::Default{true}, "Whether to flush old unused addresses, including change addresses, from the keypool and regenerate it.\n"
"If true, the next address from getnewaddress and change address from getrawchangeaddress will be from this new seed.\n" "If true, the next address from getnewaddress and change address from getrawchangeaddress will be from this new seed.\n"
"If false, addresses from the existing keypool will be used until it has been depleted."}, "If false, addresses from the existing keypool will be used until it has been depleted."},
{"seed", RPCArg::Type::STR, /* default */ "random seed", "The WIF private key to use as the new HD seed.\n" {"seed", RPCArg::Type::STR, RPCArg::DefaultHint{"random seed"}, "The WIF private key to use as the new HD seed.\n"
"The seed value can be retrieved using the dumpwallet command. It is the private key marked hdseed=1"}, "The seed value can be retrieved using the dumpwallet command. It is the private key marked hdseed=1"},
}, },
RPCResult{RPCResult::Type::NONE, "", ""}, RPCResult{RPCResult::Type::NONE, "", ""},
@ -4448,15 +4448,15 @@ RPCHelpMan walletprocesspsbt()
HELP_REQUIRING_PASSPHRASE, HELP_REQUIRING_PASSPHRASE,
{ {
{"psbt", RPCArg::Type::STR, RPCArg::Optional::NO, "The transaction base64 string"}, {"psbt", RPCArg::Type::STR, RPCArg::Optional::NO, "The transaction base64 string"},
{"sign", RPCArg::Type::BOOL, /* default */ "true", "Also sign the transaction when updating"}, {"sign", RPCArg::Type::BOOL, RPCArg::Default{true}, "Also sign the transaction when updating"},
{"sighashtype", RPCArg::Type::STR, /* default */ "ALL", "The signature hash type to sign with if not specified by the PSBT. Must be one of\n" {"sighashtype", RPCArg::Type::STR, RPCArg::Default{"ALL"}, "The signature hash type to sign with if not specified by the PSBT. Must be one of\n"
" \"ALL\"\n" " \"ALL\"\n"
" \"NONE\"\n" " \"NONE\"\n"
" \"SINGLE\"\n" " \"SINGLE\"\n"
" \"ALL|ANYONECANPAY\"\n" " \"ALL|ANYONECANPAY\"\n"
" \"NONE|ANYONECANPAY\"\n" " \"NONE|ANYONECANPAY\"\n"
" \"SINGLE|ANYONECANPAY\""}, " \"SINGLE|ANYONECANPAY\""},
{"bip32derivs", RPCArg::Type::BOOL, /* default */ "true", "Include BIP 32 derivation paths for public keys if we know them"}, {"bip32derivs", RPCArg::Type::BOOL, RPCArg::Default{true}, "Include BIP 32 derivation paths for public keys if we know them"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "",
@ -4526,7 +4526,7 @@ static RPCHelpMan walletcreatefundedpsbt()
{ {
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"}, {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"},
{"vout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The output number"}, {"vout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The output number"},
{"sequence", RPCArg::Type::NUM, /* default */ "depends on the value of the 'locktime' argument", "The sequence number"}, {"sequence", RPCArg::Type::NUM, RPCArg::DefaultHint{"depends on the value of the 'locktime' argument"}, "The sequence number"},
}, },
}, },
}, },
@ -4548,20 +4548,20 @@ static RPCHelpMan walletcreatefundedpsbt()
}, },
}, },
}, },
{"locktime", RPCArg::Type::NUM, /* default */ "0", "Raw locktime. Non-0 value also locktime-activates inputs"}, {"locktime", RPCArg::Type::NUM, RPCArg::Default{0}, "Raw locktime. Non-0 value also locktime-activates inputs"},
{"options", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, "", {"options", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, "",
{ {
{"add_inputs", RPCArg::Type::BOOL, /* default */ "false", "If inputs are specified, automatically include more if they are not enough."}, {"add_inputs", RPCArg::Type::BOOL, RPCArg::Default{false}, "If inputs are specified, automatically include more if they are not enough."},
{"include_unsafe", RPCArg::Type::BOOL, /* default */ "false", "Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions).\n" {"include_unsafe", RPCArg::Type::BOOL, RPCArg::Default{false}, "Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions).\n"
"Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears.\n" "Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears.\n"
"If that happens, you will need to fund the transaction with different inputs and republish it."}, "If that happens, you will need to fund the transaction with different inputs and republish it."},
{"changeAddress", RPCArg::Type::STR_HEX, /* default */ "pool address", "The Dash address to receive the change"}, {"changeAddress", RPCArg::Type::STR_HEX, RPCArg::DefaultHint{"pool address"}, "The Dash address to receive the change"},
{"changePosition", RPCArg::Type::NUM, /* default */ "random", "The index of the change output"}, {"changePosition", RPCArg::Type::NUM, RPCArg::DefaultHint{"random"}, "The index of the change output"},
{"includeWatching", RPCArg::Type::BOOL, /* default */ "true for watch-only wallets, otherwise false", "Also select inputs which are watch only"}, {"includeWatching", RPCArg::Type::BOOL, RPCArg::DefaultHint{"true for watch-only wallets, otherwise false"}, "Also select inputs which are watch only"},
{"lockUnspents", RPCArg::Type::BOOL, /* default */ "false", "Lock selected unspent outputs"}, {"lockUnspents", RPCArg::Type::BOOL, RPCArg::Default{false}, "Lock selected unspent outputs"},
{"fee_rate", RPCArg::Type::AMOUNT, /* default */ "not set, fall back to wallet fee estimation", "Specify a fee rate in " + CURRENCY_ATOM + "/B."}, {"fee_rate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, "Specify a fee rate in " + CURRENCY_ATOM + "/B."},
{"feeRate", RPCArg::Type::AMOUNT, /* default */ "not set: makes wallet determine the fee", "Set a specific fee rate in " + CURRENCY_UNIT + "/kB"}, {"feeRate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set: makes wallet determine the fee"}, "Set a specific fee rate in " + CURRENCY_UNIT + "/kB"},
{"subtractFeeFromOutputs", RPCArg::Type::ARR, /* default */ "empty array", "The outputs to subtract the fee from.\n" {"subtractFeeFromOutputs", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "The outputs to subtract the fee from.\n"
"The fee will be equally deducted from the amount of each specified output.\n" "The fee will be equally deducted from the amount of each specified output.\n"
"Those recipients will receive less Dash than you enter in their corresponding amount field.\n" "Those recipients will receive less Dash than you enter in their corresponding amount field.\n"
"If no outputs are specified here, the sender pays the fee.", "If no outputs are specified here, the sender pays the fee.",
@ -4569,12 +4569,12 @@ static RPCHelpMan walletcreatefundedpsbt()
{"vout_index", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The zero-based output index, before a change output is added."}, {"vout_index", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The zero-based output index, before a change output is added."},
}, },
}, },
{"conf_target", RPCArg::Type::NUM, /* default */ "wallet -txconfirmtarget", "Confirmation target in blocks"}, {"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks"},
{"estimate_mode", RPCArg::Type::STR, /* default */ "unset", std::string() + "The fee estimate mode, must be one of (case insensitive):\n" {"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, std::string() + "The fee estimate mode, must be one of (case insensitive):\n"
" \"" + FeeModes("\"\n\"") + "\""}, " \"" + FeeModes("\"\n\"") + "\""},
}, },
"options"}, "options"},
{"bip32derivs", RPCArg::Type::BOOL, /* default */ "true", "Include BIP 32 derivation paths for public keys if we know them"}, {"bip32derivs", RPCArg::Type::BOOL, RPCArg::Default{true}, "Include BIP 32 derivation paths for public keys if we know them"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "",
@ -4646,7 +4646,7 @@ static RPCHelpMan upgradewallet()
"\nUpgrade the wallet. Upgrades to the latest version if no version number is specified.\n" "\nUpgrade the wallet. Upgrades to the latest version if no version number is specified.\n"
"New keys may be generated and a new wallet backup will need to be made.", "New keys may be generated and a new wallet backup will need to be made.",
{ {
{"version", RPCArg::Type::NUM, /* default */ strprintf("%d", FEATURE_LATEST), "The version number to upgrade to. Default is the latest wallet version."} {"version", RPCArg::Type::NUM, RPCArg::Default{FEATURE_LATEST}, "The version number to upgrade to. Default is the latest wallet version."}
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "",