diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 8b298a7247..53d75548ec 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -556,11 +556,10 @@ static RPCHelpMan getblocktemplate() {"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"}, - {"capabilities", RPCArg::Type::ARR, /* treat as named arg */ RPCArg::Optional::OMITTED_NAMED_ARG, "A list of strings", - { - {"str", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "client side supported feature, 'longpoll', 'coinbasevalue', 'proposal', 'serverlist', 'workid'"}, - }}, - {"rules", RPCArg::Type::ARR, RPCArg::Optional::NO, "A list of strings", + {"longpollid", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "The longpollid from a previous template to wait for an update"}, + {"data", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED_NAMED_ARG, "The hex-encoded block data to validate when mode is \"proposal\" (see BIP 23)"}, + {"maxversion", RPCArg::Type::NUM, RPCArg::Optional::OMITTED_NAMED_ARG, "Legacy maximum block version. Used only when \"rules\" is not provided"}, + {"rules", RPCArg::Type::ARR, RPCArg::Optional::OMITTED_NAMED_ARG, "A list of strings", { {"segwit", RPCArg::Type::STR, RPCArg::Optional::NO, "(literal) indicates client side segwit support"}, {"str", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "other client side supported softfork deployment"}, diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index dc7642b3a4..65e47e29b5 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -126,12 +126,15 @@ static std::vector CreateTxDoc() }, {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "", { - {"vdata", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The key is \"vdata\", the value is an array of hex encoded data"}, + {"vdata", RPCArg::Type::ARR, RPCArg::Optional::NO, "The key is \"vdata\", the value is an array of hex encoded data", + { + {"", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "Hex-encoded data"}, + }}, }, }, {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "", { - {"burn", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "A key-value pair. The key must be \"burn\", the value is the amount that will be burned."}, + {"burn", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "A key-value pair. The key must be \"burn\", the value is the amount that will be burned."}, }, }, {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "", @@ -1230,21 +1233,21 @@ static RPCHelpMan decodepsbt() {RPCResult::Type::STR, "path", "The path"}, }}, }}, - {RPCResult::Type::NUM, "tx_version", "The version number of the unsigned transaction. Not to be confused with PSBT version"}, - {RPCResult::Type::NUM, "fallback_locktime", "The locktime to fallback to if no inputs specify a required locktime."}, - {RPCResult::Type::NUM, "input_count", "The number of inputs in this psbt"}, - {RPCResult::Type::NUM, "output_count", "The number of outputs in this psbt."}, - {RPCResult::Type::NUM, "inputs_modifiable", "Whether inputs can be modified"}, - {RPCResult::Type::NUM, "outputs_modifiable", "Whether outputs can be modified"}, - {RPCResult::Type::ARR, "sighash_single_indexes", "The indexes which have SIGHASH_SINGLE signatures", + {RPCResult::Type::NUM, "tx_version", /*optional=*/true, "The version number of the unsigned transaction. Not to be confused with PSBT version"}, + {RPCResult::Type::NUM, "fallback_locktime", /*optional=*/true, "The locktime to fallback to if no inputs specify a required locktime."}, + {RPCResult::Type::NUM, "input_count", /*optional=*/true, "The number of inputs in this psbt"}, + {RPCResult::Type::NUM, "output_count", /*optional=*/true, "The number of outputs in this psbt."}, + {RPCResult::Type::NUM, "inputs_modifiable", /*optional=*/true, "Whether inputs can be modified"}, + {RPCResult::Type::NUM, "outputs_modifiable", /*optional=*/true, "Whether outputs can be modified"}, + {RPCResult::Type::ARR, "sighash_single_indexes", /*optional=*/true, "The indexes which have SIGHASH_SINGLE signatures", {{RPCResult::Type::NUM, "", "Index of an input with a SIGHASH_SINGLE signature"}}, }, {RPCResult::Type::NUM, "psbt_version", "The PSBT version number. Not to be confused with the unsigned transaction version"}, - {RPCResult::Type::OBJ_DYN, "scalar_offsets", "The PSET scalar elements", + {RPCResult::Type::OBJ_DYN, "scalar_offsets", /*optional=*/true, "The PSET scalar elements", { {RPCResult::Type::STR_HEX, "scalar", "A scalar offset stored in the PSET"}, }}, - {RPCResult::Type::OBJ, "proprietary", "The global proprietary map", + {RPCResult::Type::OBJ, "proprietary", /*optional=*/true, "The global proprietary map", { {RPCResult::Type::OBJ, "", "", { @@ -1254,7 +1257,7 @@ static RPCHelpMan decodepsbt() {RPCResult::Type::STR_HEX, "value", "The hex for the value"}, }}, }}, - {RPCResult::Type::OBJ_DYN, "unknown", "The unknown global fields", + {RPCResult::Type::OBJ_DYN, "unknown", /*optional=*/true, "The unknown global fields", { {RPCResult::Type::STR_HEX, "key", "(key-value pair) An unknown key-value pair"}, }}, @@ -1313,31 +1316,31 @@ static RPCHelpMan decodepsbt() { {RPCResult::Type::STR_HEX, "", "hex-encoded witness data (if any)"}, }}, - {RPCResult::Type::STR_HEX, "previous_txid", "TXID of the transaction containing the output being spent by this input."}, - {RPCResult::Type::NUM, "previous_vout", "Index of the output being spent"}, - {RPCResult::Type::NUM, "sequence", "Sequence number for this inputs"}, - {RPCResult::Type::NUM, "time_locktime", "Required time-based locktime for this input"}, - {RPCResult::Type::NUM, "height_locktime", "Required height-based locktime for this input"}, - {RPCResult::Type::NUM, "issuance_value", "The explicit value of the issuance in this input in " + CURRENCY_UNIT}, - {RPCResult::Type::STR_HEX, "issuance_value_commitment", "The commitment of the value of the issuance in this input."}, - {RPCResult::Type::STR_HEX, "issuance_value_rangeproof", "The rangeproof for the value commitment of the issuance in this input."}, - {RPCResult::Type::STR_HEX, "blind_issuance_value_proof", "Explicit value rangeproof that proves the issuance value commitment matches the value"}, - {RPCResult::Type::NUM, "issuance_reissuance_amount", "The explicit amount available for the reissuance output."}, - {RPCResult::Type::STR_HEX, "issuance_reissuance_amount_commitment", "The commitment of the reissuance amount."}, - {RPCResult::Type::STR_HEX, "issuance_reissuance_amount_rangeproof", "The rangeproof for the amount commitment of the reissuance amount."}, - {RPCResult::Type::STR_HEX, "blind_reissuance_amount_proof", "Explicit value rangeproof that proves the reissuance value commitment matches the reissuance value"}, - {RPCResult::Type::STR_HEX, "issuance_blinding_nonce", "The blinding nonce for the issuance in this input."}, - {RPCResult::Type::STR_HEX, "issuance_asset_entropy", "The asset entropy for the issuance in this input."}, - {RPCResult::Type::STR_HEX, "pegin_bitcoin_tx", "The tx providing the peg-in in the format of the getrawtransaction RPC"}, - {RPCResult::Type::STR_HEX, "pegin_claim_script", "The claim script for the peg-in input"}, - {RPCResult::Type::STR_HEX, "pegin_txout_proof", "The tx providing the peg-in input"}, - {RPCResult::Type::STR_HEX, "pegin_genesis_hash", "The hash of the genesis block for this peg-in"}, - {RPCResult::Type::NUM, "pegin_value", "The value of this peg-in."}, - {RPCResult::Type::ARR, "pegin_witness", "", + {RPCResult::Type::STR_HEX, "previous_txid", /*optional=*/true, "TXID of the transaction containing the output being spent by this input."}, + {RPCResult::Type::NUM, "previous_vout", /*optional=*/true, "Index of the output being spent"}, + {RPCResult::Type::NUM, "sequence", /*optional=*/true, "Sequence number for this inputs"}, + {RPCResult::Type::NUM, "time_locktime", /*optional=*/true, "Required time-based locktime for this input"}, + {RPCResult::Type::NUM, "height_locktime", /*optional=*/true, "Required height-based locktime for this input"}, + {RPCResult::Type::STR_AMOUNT, "issuance_value", /*optional=*/true, "The explicit value of the issuance in this input in " + CURRENCY_UNIT}, + {RPCResult::Type::STR_HEX, "issuance_value_commitment", /*optional=*/true, "The commitment of the value of the issuance in this input."}, + {RPCResult::Type::STR_HEX, "issuance_value_rangeproof", /*optional=*/true, "The rangeproof for the value commitment of the issuance in this input."}, + {RPCResult::Type::STR_HEX, "blind_issuance_value_proof", /*optional=*/true, "Explicit value rangeproof that proves the issuance value commitment matches the value"}, + {RPCResult::Type::STR_AMOUNT, "issuance_reissuance_amount", /*optional=*/true, "The explicit amount available for the reissuance output."}, + {RPCResult::Type::STR_HEX, "issuance_reissuance_amount_commitment", /*optional=*/true, "The commitment of the reissuance amount."}, + {RPCResult::Type::STR_HEX, "issuance_reissuance_amount_rangeproof", /*optional=*/true, "The rangeproof for the amount commitment of the reissuance amount."}, + {RPCResult::Type::STR_HEX, "blind_reissuance_amount_proof", /*optional=*/true, "Explicit value rangeproof that proves the reissuance value commitment matches the reissuance value"}, + {RPCResult::Type::STR_HEX, "issuance_blinding_nonce", /*optional=*/true, "The blinding nonce for the issuance in this input."}, + {RPCResult::Type::STR_HEX, "issuance_asset_entropy", /*optional=*/true, "The asset entropy for the issuance in this input."}, + {RPCResult::Type::STR_HEX, "pegin_bitcoin_tx", /*optional=*/true, "The tx providing the peg-in in the format of the getrawtransaction RPC"}, + {RPCResult::Type::STR_HEX, "pegin_claim_script", /*optional=*/true, "The claim script for the peg-in input"}, + {RPCResult::Type::STR_HEX, "pegin_txout_proof", /*optional=*/true, "The tx providing the peg-in input"}, + {RPCResult::Type::STR_HEX, "pegin_genesis_hash", /*optional=*/true, "The hash of the genesis block for this peg-in"}, + {RPCResult::Type::STR_AMOUNT, "pegin_value", /*optional=*/true, "The value of this peg-in."}, + {RPCResult::Type::ARR, "pegin_witness", /*optional=*/true, "", { {RPCResult::Type::STR_HEX, "", "hex-encoded witness data (if any)"}, }}, - {RPCResult::Type::STR_HEX, "utxo_rangeproof", "The rangeproof for the UTXO"}, + {RPCResult::Type::STR_HEX, "utxo_rangeproof", /*optional=*/true, "The rangeproof for the UTXO"}, {RPCResult::Type::NUM, "explicit_value", /*optional=*/true, "The explicit value for this input"}, {RPCResult::Type::STR_HEX, "value_proof", /*optional=*/true, "The explicit value proof for this input"}, {RPCResult::Type::STR_HEX, "explicit_asset", /*optional=*/true, "The explicit asset for this input"}, @@ -1400,20 +1403,20 @@ static RPCHelpMan decodepsbt() {RPCResult::Type::STR, "path", "The path"}, }}, }}, - {RPCResult::Type::NUM, "amount", "The amount (nValue) for this output"}, - {RPCResult::Type::OBJ, "script", "The output script (scriptPubKey) for this output", + {RPCResult::Type::STR_AMOUNT, "amount", /*optional=*/true, "The amount (nValue) for this output"}, + {RPCResult::Type::OBJ, "script", /*optional=*/true, "The output script (scriptPubKey) for this output", {{RPCResult::Type::ELISION, "", "The layout is the same as the output of scriptPubKeys in decoderawtransaction."}}, }, - {RPCResult::Type::STR_HEX, "value_commitment", "The blinded value of the output"}, - {RPCResult::Type::STR_HEX, "asset_commitment", "The blinded asset id of the output"}, - {RPCResult::Type::STR_HEX, "asset", "The explicit asset for the output"}, - {RPCResult::Type::STR_HEX, "rangeproof", "The rangeproof for the output"}, - {RPCResult::Type::STR_HEX, "surjection_proof", "The surjection proof for the output"}, - {RPCResult::Type::STR_HEX, "ecdh_pubkey", "The ecdh pubkey for the output"}, - {RPCResult::Type::STR_HEX, "blinding_pubkey", "The blinding pubkey for the output"}, - {RPCResult::Type::STR_HEX, "blind_value_proof", "Explicit value rangeproof that proves the value commitment matches the value"}, - {RPCResult::Type::STR_HEX, "blind_asset_proof", "Assert surjection proof that proves the assert commitment matches the asset"}, - {RPCResult::Type::STR, "status", "information about how the output has been blinded, if available"}, + {RPCResult::Type::STR_HEX, "value_commitment", /*optional=*/true, "The blinded value of the output"}, + {RPCResult::Type::STR_HEX, "asset_commitment", /*optional=*/true, "The blinded asset id of the output"}, + {RPCResult::Type::STR_HEX, "asset", /*optional=*/true, "The explicit asset for the output"}, + {RPCResult::Type::STR_HEX, "rangeproof", /*optional=*/true, "The rangeproof for the output"}, + {RPCResult::Type::STR_HEX, "surjection_proof", /*optional=*/true, "The surjection proof for the output"}, + {RPCResult::Type::STR_HEX, "ecdh_pubkey", /*optional=*/true, "The ecdh pubkey for the output"}, + {RPCResult::Type::STR_HEX, "blinding_pubkey", /*optional=*/true, "The blinding pubkey for the output"}, + {RPCResult::Type::STR_HEX, "blind_value_proof", /*optional=*/true, "Explicit value rangeproof that proves the value commitment matches the value"}, + {RPCResult::Type::STR_HEX, "blind_asset_proof", /*optional=*/true, "Assert surjection proof that proves the assert commitment matches the asset"}, + {RPCResult::Type::STR, "status", /*optional=*/true, "information about how the output has been blinded, if available"}, {RPCResult::Type::OBJ_DYN, "unknown", /*optional=*/true, "The unknown global fields", { {RPCResult::Type::STR_HEX, "key", "(key-value pair) An unknown key-value pair"}, @@ -1430,7 +1433,10 @@ static RPCHelpMan decodepsbt() }}, }}, }}, - {RPCResult::Type::STR_AMOUNT, "fee", /*optional=*/true, "The transaction fee paid if all UTXOs slots in the PSBT have been filled."}, + {RPCResult::Type::OBJ_DYN, "fees", /*optional=*/true, "Map of asset id (hex) to fee amount paid in that asset", + { + {RPCResult::Type::STR_AMOUNT, "xxxx", "fee amount for the asset whose id is the object key (hex-encoded asset id)"}, + }}, } }, RPCExamples{ @@ -2157,9 +2163,9 @@ static RPCHelpMan createpsbt() {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"}, {"vout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The output number"}, {"sequence", RPCArg::Type::NUM, RPCArg::DefaultHint{"depends on the value of the 'replaceable' and 'locktime' arguments"}, "The sequence number"}, - {"pegin_bitcoin_tx", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The raw bitcoin transaction (in hex) depositing bitcoin to the mainchain_address generated by getpeginaddress"}, - {"pegin_txout_proof", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "A rawtxoutproof (in hex) generated by the mainchain daemon's `gettxoutproof` containing a proof of only bitcoin_tx"}, - {"pegin_claim_script", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The witness program generated by getpeginaddress."}, + {"pegin_bitcoin_tx", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED_NAMED_ARG, "(only for pegin inputs) The raw bitcoin transaction (in hex) depositing bitcoin to the mainchain_address generated by getpeginaddress"}, + {"pegin_txout_proof", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED_NAMED_ARG, "(only for pegin inputs) A rawtxoutproof (in hex) generated by the mainchain daemon's `gettxoutproof` containing a proof of only bitcoin_tx"}, + {"pegin_claim_script", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED_NAMED_ARG, "(only for pegin inputs) The claim script generated by getpeginaddress."}, {"issuance_amount", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The amount to be issued"}, {"issuance_tokens", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The number of asset issuance tokens to generate"}, {"asset_entropy", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "For new asset issuance, this is any additional entropy to be used in the asset tag calculation. For reissuance, this is the original asset entropy"}, diff --git a/src/wallet/rpc/backup.cpp b/src/wallet/rpc/backup.cpp index ca2215e3e1..e83e338053 100644 --- a/src/wallet/rpc/backup.cpp +++ b/src/wallet/rpc/backup.cpp @@ -1307,8 +1307,8 @@ RPCHelpMan importmulti() { {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "", { - {"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", + {"desc", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Descriptor to import. Either desc or scriptPubKey must be provided, but not both. If using descriptor, do not also provide scripts or pubkeys"}, + {"scriptPubKey", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Type of scriptPubKey (string for script, json for address). Either desc or scriptPubKey must be provided, but not both", /* oneline_description */ "", {"\"