diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -176,15 +176,15 @@ "so payments received with the address will be associated with " "'label'.\n", { - {"label", RPCArg::Type::STR, true}, + {"label", RPCArg::Type::STR, /* opt */ true, + /* default_val */ "", + "The label name for the address to be linked to. If not " + "provided, the default label \"\" is used. 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."}, }} - .ToString() + - "\nArguments:\n" - "1. \"label\" (string, optional) The label name for the " - "address to be linked to. If not provided, the default label \"\" " - "is used. 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.\n" + .ToStringWithArgs() + "\nResult:\n" "\"address\" (string) The new bitcoin address\n" "\nExamples:\n" + @@ -317,18 +317,18 @@ if (request.fHelp || request.params.size() != 2) { throw std::runtime_error( - RPCHelpMan{"setlabel", - "\nSets the label associated with the given address.\n", - { - {"address", RPCArg::Type::STR, false}, - {"label", RPCArg::Type::STR, false}, - }} - .ToString() + - "\nArguments:\n" - "1. \"address\" (string, required) The bitcoin address to " - "be associated with a label.\n" - "2. \"label\" (string, required) The label to assign to " - "the address.\n" + RPCHelpMan{ + "setlabel", + "\nSets the label associated with the given address.\n", + { + {"address", RPCArg::Type::STR, /* opt */ false, + /* default_val */ "", + "The bitcoin address to be associated with a label."}, + {"label", RPCArg::Type::STR, /* opt */ false, + /* default_val */ "", + "The label to assign to the address."}, + }} + .ToStringWithArgs() + "\nExamples:\n" + HelpExampleCli("setlabel", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"tabby\"") + @@ -426,38 +426,36 @@ if (request.fHelp || request.params.size() < 2 || request.params.size() > 5) { throw std::runtime_error( - RPCHelpMan{"sendtoaddress", - "\nSend an amount to a given address.\n", - { - {"address", RPCArg::Type::STR, false}, - {"amount", RPCArg::Type::AMOUNT, false}, - {"comment", RPCArg::Type::STR, true}, - {"comment_to", RPCArg::Type::STR, true}, - {"subtractfeefromamount", RPCArg::Type::BOOL, true}, - }} - .ToString() + - HelpRequiringPassphrase(pwallet) + - "\nArguments:\n" - "1. \"address\" (string, required) The bitcoin address " - "to send to.\n" - "2. \"amount\" (numeric or string, required) The " - "amount in " + - CURRENCY_UNIT + - " to send. eg 0.1\n" - "3. \"comment\" (string, optional) A comment used to " - "store what the transaction is for. \n" - " This is not part of the transaction, " - "just kept in your wallet.\n" - "4. \"comment_to\" (string, optional) 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" - " transaction, just kept in your " - "wallet.\n" - "5. subtractfeefromamount (boolean, optional, default=false) The " - "fee will be deducted from the amount being sent.\n" - " The recipient will receive less " - "bitcoins than you enter in the amount field.\n" + RPCHelpMan{ + "sendtoaddress", + "\nSend an amount to a given address.\n" + + HelpRequiringPassphrase(pwallet) + "\n", + { + {"address", RPCArg::Type::STR, /* opt */ false, + /* default_val */ "", "The bitcoin address to send to."}, + {"amount", RPCArg::Type::AMOUNT, /* opt */ false, + /* default_val */ "", + "The amount in " + CURRENCY_UNIT + " to send. eg 0.1"}, + {"comment", RPCArg::Type::STR, /* opt */ true, + /* default_val */ "", + "A comment used to store what the transaction is for.\n" + " This is not part of the " + "transaction, just kept in your wallet."}, + {"comment_to", RPCArg::Type::STR, /* opt */ true, + /* default_val */ "", + "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" + " transaction, just kept in " + "your wallet."}, + {"subtractfeefromamount", RPCArg::Type::BOOL, + /* opt */ true, /* default_val */ "false", + "The fee will be deducted from the amount being sent.\n" + " The recipient will receive " + "less bitcoins than you enter in the amount field."}, + }} + .ToStringWithArgs() + "\nResult:\n" "\"txid\" (string) The transaction id.\n" "\nExamples:\n" + @@ -595,19 +593,17 @@ if (request.fHelp || request.params.size() != 2) { throw std::runtime_error( RPCHelpMan{"signmessage", - "\nSign a message with the private key of an address", + "\nSign a message with the private key of an address" + + HelpRequiringPassphrase(pwallet) + "\n", { - {"address", RPCArg::Type::STR, false}, - {"message", RPCArg::Type::STR, false}, + {"address", RPCArg::Type::STR, /* opt */ false, + /* default_val */ "", + "The bitcoin address to use for the private key."}, + {"message", RPCArg::Type::STR, /* opt */ false, + /* default_val */ "", + "The message to create a signature of."}, }} - .ToString() + - HelpRequiringPassphrase(pwallet) + - "\n" - "\nArguments:\n" - "1. \"address\" (string, required) The bitcoin address to " - "use for the private key.\n" - "2. \"message\" (string, required) The message to create a " - "signature of.\n" + .ToStringWithArgs() + "\nResult:\n" "\"signature\" (string) The signature of the message " "encoded in base 64\n" @@ -681,15 +677,15 @@ "\nReturns the total amount received by the given address in " "transactions with at least minconf confirmations.\n", { - {"address", RPCArg::Type::STR, false}, - {"minconf", RPCArg::Type::NUM, true}, + {"address", RPCArg::Type::STR, /* opt */ false, + /* default_val */ "", + "The bitcoin address for transactions."}, + {"minconf", RPCArg::Type::NUM, /* opt */ true, + /* default_val */ "1", + "Only include transactions confirmed at least this many " + "times."}, }} - .ToString() + - "\nArguments:\n" - "1. \"address\" (string, required) The bitcoin address for " - "transactions.\n" - "2. minconf (numeric, optional, default=1) Only " - "include transactions confirmed at least this many times.\n" + .ToStringWithArgs() + "\nResult:\n" "amount (numeric) The total amount in " + CURRENCY_UNIT + @@ -779,15 +775,16 @@ "\nReturns the total amount received by addresses with