diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 5ac5ec15603..1001a9b5b9f 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -968,28 +968,33 @@ static RPCHelpMan getblockheader() {RPCResult::Type::STR_HEX, "merkleroot", "The merkle root"}, {RPCResult::Type::NUM_TIME, "time", "The block time expressed in " + UNIX_EPOCH_TIME}, {RPCResult::Type::NUM_TIME, "mediantime", "The median block time expressed in " + UNIX_EPOCH_TIME}, - {RPCResult::Type::NUM, "nonce", "The nonce"}, - {RPCResult::Type::STR_HEX, "bits", "The bits"}, - {RPCResult::Type::NUM, "difficulty", "The difficulty"}, - {RPCResult::Type::STR_HEX, "chainwork", "Expected number of hashes required to produce the current chain"}, + {RPCResult::Type::NUM, "nonce", /*optional=*/true, "The nonce"}, + {RPCResult::Type::STR_HEX, "bits", /*optional=*/true, "The bits"}, + {RPCResult::Type::NUM, "difficulty", /*optional=*/true, "The difficulty"}, + {RPCResult::Type::STR_HEX, "chainwork", /*optional=*/true, "Expected number of hashes required to produce the current chain"}, {RPCResult::Type::NUM, "nTx", "The number of transactions in the block"}, - {RPCResult::Type::STR, "signblock_witness_asm", "ASM of sign block witness data"}, - {RPCResult::Type::STR_HEX, "signblock_witness_hex", "Hex of sign block witness data"}, - {RPCResult::Type::OBJ, "dynamic_parameters", "Dynamic federation parameters in the block, if any", + {RPCResult::Type::STR, "signblock_witness_asm", /*optional=*/true, "ASM of sign block witness data"}, + {RPCResult::Type::STR_HEX, "signblock_witness_hex", /*optional=*/true, "Hex of sign block witness data"}, + {RPCResult::Type::STR_HEX, "signblock_challenge", /*optional=*/true, "Hex of sign block challenge"}, + {RPCResult::Type::STR, "warning", /*optional=*/true, "Warning message if block was not loaded cleanly"}, + {RPCResult::Type::OBJ, "dynamic_parameters", /*optional=*/true, "Dynamic federation parameters in the block, if any", { - {RPCResult::Type::OBJ, "current", "enforced dynamic federation parameters. The signblockscript is published for each block, while others are published only at epoch start", + {RPCResult::Type::OBJ, "current", "enforced dynamic federation parameters", { - {RPCResult::Type::STR_HEX, "signblockscript", "signblock script"}, - {RPCResult::Type::NUM, "max_block_witness", "Maximum serialized size of the block witness stack"}, - {RPCResult::Type::STR_HEX, "fedpegscript", "fedpeg script"}, - {RPCResult::Type::ARR, "extension_space", "array of hex-encoded strings", + {RPCResult::Type::STR_HEX, "root", /*optional=*/true, "parameter root"}, + {RPCResult::Type::STR_HEX, "signblockscript", /*optional=*/true, "signblock script as hex"}, + {RPCResult::Type::NUM, "max_block_witness", /*optional=*/true, "maximum serialized size of the block witness stack"}, + {RPCResult::Type::STR_HEX, "extra_root", /*optional=*/true, "extra root"}, + {RPCResult::Type::STR_HEX, "fedpeg_program", /*optional=*/true, "fedpeg program scriptPubKey in hex"}, + {RPCResult::Type::STR_HEX, "fedpegscript", /*optional=*/true, "fedpeg script in hex"}, + {RPCResult::Type::ARR, "extension_space", /*optional=*/true, "extension space as hex strings", { {RPCResult::Type::ELISION, "", ""} }} }}, {RPCResult::Type::OBJ, "proposed", "Proposed parameters. Uninforced. Must be published in full", { - {RPCResult::Type::ELISION, "", "same entries as current"} + {RPCResult::Type::ELISION, "", "same entries as \"current\""} }}, }}, {RPCResult::Type::STR_HEX, "previousblockhash", /*optional=*/true, "The hash of the previous block (if available)"}, @@ -1102,28 +1107,34 @@ static RPCHelpMan getblock() {{RPCResult::Type::STR_HEX, "", "The transaction id"}}}, {RPCResult::Type::NUM_TIME, "time", "The block time expressed in " + UNIX_EPOCH_TIME}, {RPCResult::Type::NUM_TIME, "mediantime", "The median block time expressed in " + UNIX_EPOCH_TIME}, - {RPCResult::Type::NUM, "nonce", "The nonce"}, - {RPCResult::Type::STR_HEX, "bits", "The bits"}, - {RPCResult::Type::NUM, "difficulty", "The difficulty"}, - {RPCResult::Type::STR_HEX, "chainwork", "Expected number of hashes required to produce the chain up to this block (in hex)"}, + {RPCResult::Type::NUM, "nonce", /*optional=*/true, "The nonce"}, + {RPCResult::Type::STR_HEX, "bits", /*optional=*/true, "The bits"}, + {RPCResult::Type::NUM, "difficulty", /*optional=*/true, "The difficulty"}, + {RPCResult::Type::STR_HEX, "chainwork", /*optional=*/true, "Expected number of hashes required to produce the chain up to this block"}, {RPCResult::Type::NUM, "nTx", "The number of transactions in the block"}, - {RPCResult::Type::STR, "signblock_witness_asm", "ASM of sign block witness data"}, - {RPCResult::Type::STR_HEX, "signblock_witness_hex", "Hex of sign block witness data"}, - {RPCResult::Type::OBJ, "dynamic_parameters", "Dynamic federation parameters in the block, if any", + {RPCResult::Type::STR, "signblock_witness_asm", /*optional=*/true, "ASM of sign block witness data"}, + {RPCResult::Type::STR_HEX, "signblock_witness_hex", /*optional=*/true, "Hex of sign block witness data"}, + {RPCResult::Type::STR_HEX, "signblock_challenge", /*optional=*/true, "Hex of sign block challenge"}, + {RPCResult::Type::STR, "warning", /*optional=*/true, "Warning message if block was not loaded cleanly"}, + {RPCResult::Type::OBJ, "dynamic_parameters", /*optional=*/true, "Dynamic federation parameters in the block, if any", { {RPCResult::Type::OBJ, "current", "enforced dynamic federation parameters. The signblockscript is published for each block, while others are published only at epoch start", { - {RPCResult::Type::STR_HEX, "signblockscript", "signblock script"}, - {RPCResult::Type::NUM, "max_block_witness", "Maximum serialized size of the block witness stack"}, - {RPCResult::Type::STR_HEX, "fedpegscript", "fedpeg script"}, - {RPCResult::Type::ARR, "extension_space", "array of hex-encoded strings", + {RPCResult::Type::STR, "type", "one of \"null\", \"compact\", \"full\""}, + {RPCResult::Type::STR_HEX, "root", /*optional=*/true, "parameter root"}, + {RPCResult::Type::STR_HEX, "signblockscript", /*optional=*/true, "signblock script as hex"}, + {RPCResult::Type::NUM, "max_block_witness", /*optional=*/true, "maximum serialized size of the block witness stack"}, + {RPCResult::Type::STR_HEX, "extra_root", /*optional=*/true, "extra root"}, + {RPCResult::Type::STR_HEX, "fedpeg_program", /*optional=*/true, "fedpeg program scriptPubKey in hex"}, + {RPCResult::Type::STR_HEX, "fedpegscript", /*optional=*/true, "fedpeg script in hex"}, + {RPCResult::Type::ARR, "extension_space", /*optional=*/true, "extension space as hex strings", { {RPCResult::Type::ELISION, "", ""} }}, }}, {RPCResult::Type::OBJ, "proposed", "Proposed parameters. Uninforced. Must be published in full", { - {RPCResult::Type::ELISION, "", "same entries as current"} + {RPCResult::Type::ELISION, "", "same entries as \"current\""} }}, }}, {RPCResult::Type::STR_HEX, "previousblockhash", /*optional=*/true, "The hash of the previous block (if available)"}, @@ -1459,7 +1470,11 @@ static RPCHelpMan gettxout() RPCResult{"Otherwise", RPCResult::Type::OBJ, "", "", { {RPCResult::Type::STR_HEX, "bestblock", "The hash of the block at the tip of the chain"}, {RPCResult::Type::NUM, "confirmations", "The number of confirmations"}, - {RPCResult::Type::STR_AMOUNT, "value", "The transaction value in " + CURRENCY_UNIT}, + {RPCResult::Type::STR_AMOUNT, "value", /*optional=*/true, "The transaction value in " + CURRENCY_UNIT}, + {RPCResult::Type::STR_HEX, "valuecommitment", /*optional=*/true, "Hex-encoded value commitment"}, + {RPCResult::Type::STR_HEX, "asset", /*optional=*/true, "Explicit asset id"}, + {RPCResult::Type::STR_HEX, "assetcommitment", /*optional=*/true, "Hex-encoded asset commitment"}, + {RPCResult::Type::STR_HEX, "commitmentnonce", /*optional=*/true, "Output nonce / commitment field"}, {RPCResult::Type::OBJ, "scriptPubKey", "", { {RPCResult::Type::STR, "asm", ""}, {RPCResult::Type::STR, "desc", "Inferred descriptor for the output"}, @@ -1677,24 +1692,25 @@ RPCHelpMan getblockchaininfo() {RPCResult::Type::NUM, "blocks", "the height of the most-work fully-validated chain. The genesis block has height 0"}, {RPCResult::Type::NUM, "headers", "the current number of headers we have validated"}, {RPCResult::Type::STR, "bestblockhash", "the hash of the currently best block"}, - {RPCResult::Type::NUM, "difficulty", "the current difficulty"}, + {RPCResult::Type::NUM, "difficulty", /*optional=*/true, "the current difficulty"}, {RPCResult::Type::NUM_TIME, "time", "The block time expressed in " + UNIX_EPOCH_TIME}, {RPCResult::Type::NUM_TIME, "mediantime", "The median block time expressed in " + UNIX_EPOCH_TIME}, {RPCResult::Type::NUM, "verificationprogress", "estimate of verification progress [0..1]"}, {RPCResult::Type::BOOL, "initialblockdownload", "(debug information) estimate of whether this node is in Initial Block Download mode"}, - {RPCResult::Type::STR_HEX, "chainwork", "total amount of work in active chain, in hexadecimal"}, + {RPCResult::Type::STR_HEX, "chainwork", /*optional=*/true, "total amount of work in active chain, in hexadecimal"}, {RPCResult::Type::NUM, "size_on_disk", "the estimated size of the block and undo files on disk"}, {RPCResult::Type::BOOL, "pruned", "if the blocks are subject to pruning"}, - {RPCResult::Type::STR_HEX, "current_params_root", "the root of the currently active dynafed params"}, - {RPCResult::Type::STR, "signblock_asm", "ASM of sign block challenge data from genesis block"}, - {RPCResult::Type::STR_HEX, "signblock_hex", "Hex of sign block challenge data from genesis block"}, - {RPCResult::Type::STR, "current_signblock_asm", "ASM of sign block challenge data enforced on the next block"}, - {RPCResult::Type::STR_HEX, "current_signblock_hex", "Hex of sign block challenge data enforced on the next block"}, - {RPCResult::Type::NUM, "max_block_witness", "maximum sized block witness serialized size for the next block"}, - {RPCResult::Type::NUM, "epoch_length", "length of dynamic federations epoch, or signaling period"}, - {RPCResult::Type::NUM, "total_valid_epochs", "number of epochs a given fedpscript is valid for, defined per chain"}, - {RPCResult::Type::NUM, "epoch_age", "number of blocks into a dynamic federation epoch chain tip is. This number is between 0 to epoch_length-1"}, - {RPCResult::Type::ARR, "extension_space", "array of extension fields in dynamic blockheader", + {RPCResult::Type::BOOL, "trim_headers", "whether header trimming is enabled (-trim-headers)"}, + {RPCResult::Type::STR_HEX, "current_params_root", /*optional=*/true, "the root of the currently active dynafed params"}, + {RPCResult::Type::STR_HEX, "current_fedpeg_program", /*optional=*/true, "The fedpeg program enforced on the next block"}, + {RPCResult::Type::STR_HEX, "current_fedpeg_script", /*optional=*/true, "The fedpeg script enforced on the next block"}, + {RPCResult::Type::STR, "current_signblock_asm", /*optional=*/true, "ASM of sign block challenge data enforced on the next block"}, + {RPCResult::Type::STR_HEX, "current_signblock_hex", /*optional=*/true, "Hex of sign block challenge data enforced on the next block"}, + {RPCResult::Type::NUM, "max_block_witness", /*optional=*/true, "maximum sized block witness serialized size for the next block"}, + {RPCResult::Type::NUM, "epoch_length", /*optional=*/true, "length of dynamic federations epoch, or signaling period"}, + {RPCResult::Type::NUM, "total_valid_epochs", /*optional=*/true, "number of epochs a given fedpegscript is valid for, defined per chain"}, + {RPCResult::Type::NUM, "epoch_age", /*optional=*/true, "number of blocks into a dynamic federation epoch chain tip is. This number is between 0 to epoch_length-1"}, + {RPCResult::Type::ARR, "extension_space", /*optional=*/true, "array of extension fields in dynamic blockheader", { {RPCResult::Type::ELISION, "", ""} }}, @@ -2719,9 +2735,9 @@ static RPCHelpMan scantxoutset() {RPCResult::Type::STR_HEX, "asset", "The asset ID"}, {RPCResult::Type::NUM, "height", "Height of the unspent transaction output"}, }}, - {RPCResult::Type::STR_AMOUNT, "total_unblinded_bitcoin_amount", "The total amount of all found unspent unblinded outputs in " + CURRENCY_UNIT}, }}, - {RPCResult::Type::STR_AMOUNT, "total_amount", "The total amount of all found unspent outputs in " + CURRENCY_UNIT}, + {RPCResult::Type::STR_AMOUNT, "total_unblinded_bitcoin_amount", /*optional=*/true, "The total amount of all found unspent unblinded outputs in " + CURRENCY_UNIT}, + {RPCResult::Type::STR_AMOUNT, "total_amount", /*optional=*/true, "The total amount of all found unspent outputs in " + CURRENCY_UNIT}, }}, }, RPCExamples{ @@ -3093,11 +3109,17 @@ static RPCHelpMan getsidechaininfo() {RPCResult::Type::STR, "min_peg_diff", "The minimum difficulty parent chain header target. Peg-in headers that have less work will be rejected as an anti-Dos measure"}, {RPCResult::Type::STR_HEX, "parent_blockhash", "The parent genesis blockhash as source of pegged-in funds"}, {RPCResult::Type::BOOL, "parent_chain_has_pow", "Whether parent chain has pow or signed blocks"}, - {RPCResult::Type::STR, "parent_chain_signblockscript_asm", "If the parent chain has signed blocks, its signblockscript in ASM"}, - {RPCResult::Type::STR_HEX, "parent_chain_signblockscript_hex", "If the parent chain has signed blocks, its signblockscript in hex"}, - {RPCResult::Type::STR_HEX, "parent_pegged_asset", "If the parent chain has Confidential Assets, the asset id of the pegged asset in that chain"}, + {RPCResult::Type::STR, "parent_chain_signblockscript_asm", /*optional=*/true, "If the parent chain has signed blocks, its signblockscript in ASM"}, + {RPCResult::Type::STR_HEX, "parent_chain_signblockscript_hex", /*optional=*/true, "If the parent chain has signed blocks, its signblockscript in hex"}, + {RPCResult::Type::STR_HEX, "parent_pegged_asset", /*optional=*/true, "If the parent chain has Confidential Assets, the asset id of the pegged asset in that chain"}, {RPCResult::Type::NUM, "pegin_confirmation_depth", "The number of mainchain confirmations required for a peg-in transaction to become valid"}, {RPCResult::Type::BOOL, "enforce_pak", "If peg-out authorization is being enforced"}, + {RPCResult::Type::STR, "pegin_min_amount", /*optional=*/true, "minimum peg-in amount enforced by consensus"}, + {RPCResult::Type::NUM, "pegin_min_height", /*optional=*/true, "block height from which the minimum peg-in amount applies"}, + {RPCResult::Type::BOOL, "pegin_min_active", /*optional=*/true, "whether the minimum peg-in rule is active at the current tip"}, + {RPCResult::Type::STR, "pegin_subsidy_threshold", /*optional=*/true, "peg-in subsidy threshold amount"}, + {RPCResult::Type::NUM, "pegin_subsidy_height", /*optional=*/true, "block height from which the peg-in subsidy rule applies"}, + {RPCResult::Type::BOOL, "pegin_subsidy_active", /*optional=*/true, "whether the peg-in subsidy rule is active at the current tip"}, }}, RPCExamples{ HelpExampleCli("getsidechaininfo", "") diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index d3c56a351a3..53d75548ec8 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -441,8 +441,8 @@ static RPCHelpMan getmininginfo() {RPCResult::Type::NUM, "blocks", "The current block"}, {RPCResult::Type::NUM, "currentblockweight", /*optional=*/true, "The block weight of the last assembled block (only present if a block was ever assembled)"}, {RPCResult::Type::NUM, "currentblocktx", /*optional=*/true, "The number of block transactions of the last assembled block (only present if a block was ever assembled)"}, - {RPCResult::Type::NUM, "difficulty", "The current difficulty"}, - {RPCResult::Type::NUM, "networkhashps", "The network hashes per second"}, + {RPCResult::Type::NUM, "difficulty", /*optional=*/true, "The current difficulty"}, + {RPCResult::Type::NUM, "networkhashps", /*optional=*/true, "The network hashes per second"}, {RPCResult::Type::NUM, "pooledtx", "The size of the mempool"}, {RPCResult::Type::STR, "chain", "current network name (main, test, signet, regtest, liquidv1, liquidv1test, liquidtestnet)"}, {RPCResult::Type::STR, "warnings", "any network and blockchain warnings"}, @@ -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"}, @@ -1556,7 +1555,7 @@ static RPCHelpMan consumecompactsketch() { {RPCResult::Type::STR_HEX, "blockhex", "The filled block hex. Only returns when block is final"}, {RPCResult::Type::STR_HEX, "block_tx_req", "The serialized structure of missing transaction indices, given to serving node"}, - {RPCResult::Type::STR_HEX, "found_tranasctions", "The serialized list of found transactions to be used in finalizecompactblock"}, + {RPCResult::Type::STR_HEX, "found_transactions", "The serialized list of found transactions to be used in finalizecompactblock"}, }, }, RPCExamples{ @@ -1624,8 +1623,8 @@ static RPCHelpMan consumegetblocktxn() return RPCHelpMan{"consumegetblocktxn", "Consumes a transaction request for a compact block sketch.", { - {"full_block", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Hex serialied block that corresponds to the block request `block_tx_req`."}, - {"block_tx_req", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Hex serialied BlockTransactionsRequest, aka getblocktxn network message."}, + {"full_block", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Hex serialized block that corresponds to the block request `block_tx_req`."}, + {"block_tx_req", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "Hex serialized BlockTransactionsRequest, aka getblocktxn network message."}, }, RPCResult{ RPCResult::Type::STR_HEX, "block_transactions", "The serialized list of found transactions aka BlockTransactions", diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index b1a941e9aab..6cdb80a3364 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -851,7 +851,8 @@ static RPCHelpMan tweakfedpegscript() RPCResult::Type::OBJ, "", "", { {RPCResult::Type::STR_HEX, "script", "The fedpegscript tweaked with claim_script"}, - {RPCResult::Type::STR, "address", "The address corresponding to the tweaked fedpegscript"}, + {RPCResult::Type::STR, "p2wsh", "Native segwit address (P2WSH) for the tweaked fedpegscript"}, + {RPCResult::Type::STR, "p2shwsh", "Wrapped segwit address (P2SH-P2WSH) for the tweaked fedpegscript"}, } }, RPCExamples{""}, @@ -918,9 +919,11 @@ static RPCHelpMan getpakinfo() RPCResult{ RPCResult::Type::OBJ, "", "", { - {RPCResult::Type::ARR, "block_paklist", "The PAK list loaded from latest epoch", + {RPCResult::Type::OBJ, "block_paklist", "The PAK list loaded from the latest epoch", { - {RPCResult::Type::ELISION, "", ""} + {RPCResult::Type::ARR, "online", "Online keys (hex-encoded)", {{RPCResult::Type::STR_HEX, "", ""}}}, + {RPCResult::Type::ARR, "offline", "Offline keys (hex-encoded)", {{RPCResult::Type::STR_HEX, "", ""}}}, + {RPCResult::Type::BOOL, "reject", "True when there are no offline keys (reject pegouts)"}, }}, } }, @@ -976,12 +979,14 @@ static RPCHelpMan calcfastmerkleroot() static RPCHelpMan dumpassetlabels() { return RPCHelpMan{"dumpassetlabels", - "\nLists all known asset id/label pairs in this wallet. This list can be modified with `-assetdir` configuration argument.\n", + "\nLists all known asset label/id pairs for this node. Object keys are asset labels and values are hex-encoded asset identifiers. This list can be modified with the `-assetdir` configuration argument.\n", {}, RPCResult{ - RPCResult::Type::OBJ, "labels", "", + RPCResult::Type::OBJ_DYN, + "", + "Map from asset label (object key) to asset id (hex string value)", { - {RPCResult::Type::ELISION, "", "the label for each asset id"}, + {RPCResult::Type::STR_HEX, "xxxx", "asset id for the label named by each dynamic object key"}, }, }, RPCExamples{ @@ -1050,7 +1055,7 @@ static RPCHelpMan createblindedaddress() {"blinding_key", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The blinding public key. This can be obtained for a given address using `getaddressinfo` (`confidential_key` field)."}, }, RPCResult{ - RPCResult::Type::STR, "blinded_address", "The blinded address" + RPCResult::Type::STR, "", "The blinded address string" }, RPCExamples{ "\nCreate a blinded address\n" diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 6a20cbb3f63..c6757d4996f 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -580,17 +580,17 @@ static RPCHelpMan getnetworkinfo() {RPCResult::Type::NUM, "version", "the server version"}, {RPCResult::Type::STR, "subversion", "the server subversion string"}, {RPCResult::Type::NUM, "protocolversion", "the protocol version"}, - {RPCResult::Type::STR_HEX, "localservices", "the services we offer to the network"}, - {RPCResult::Type::ARR, "localservicesnames", "the services we offer to the network, in human-readable form", + {RPCResult::Type::STR_HEX, "localservices", /*optional=*/true, "the services we offer to the network"}, + {RPCResult::Type::ARR, "localservicesnames", /*optional=*/true, "the services we offer to the network, in human-readable form", { {RPCResult::Type::STR, "SERVICE_NAME", "the service name"}, }}, - {RPCResult::Type::BOOL, "localrelay", "true if transaction relay is requested from peers"}, + {RPCResult::Type::BOOL, "localrelay", /*optional=*/true, "true if transaction relay is requested from peers"}, {RPCResult::Type::NUM, "timeoffset", "the time offset"}, - {RPCResult::Type::NUM, "connections", "the total number of connections"}, - {RPCResult::Type::NUM, "connections_in", "the number of inbound connections"}, - {RPCResult::Type::NUM, "connections_out", "the number of outbound connections"}, - {RPCResult::Type::BOOL, "networkactive", "whether p2p networking is enabled"}, + {RPCResult::Type::NUM, "connections", /*optional=*/true, "the total number of connections"}, + {RPCResult::Type::NUM, "connections_in", /*optional=*/true, "the number of inbound connections"}, + {RPCResult::Type::NUM, "connections_out", /*optional=*/true, "the number of outbound connections"}, + {RPCResult::Type::BOOL, "networkactive", /*optional=*/true, "whether p2p networking is enabled"}, {RPCResult::Type::ARR, "networks", "information per network", { {RPCResult::Type::OBJ, "", "", diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index d1497c19c1e..65e47e29b54 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, "", @@ -180,6 +183,14 @@ static RPCHelpMan getrawtransaction() {RPCResult::Type::NUM, "size", "The serialized transaction size"}, {RPCResult::Type::NUM, "vsize", "The virtual transaction size (differs from size for witness transactions)"}, {RPCResult::Type::NUM, "weight", "The transaction's weight (between vsize*4-3 and vsize*4)"}, + {RPCResult::Type::NUM, "discountvsize", /*optional=*/true, "Discounted virtual size when CT fee discount is enabled (-acceptdiscountct)"}, + {RPCResult::Type::NUM, "discountweight", /*optional=*/true, "Discounted transaction weight when CT fee discount is enabled"}, + {RPCResult::Type::STR_HEX, "wtxid", /*optional=*/true, "The witness transaction id"}, + {RPCResult::Type::STR_HEX, "withash", /*optional=*/true, "Hash of witness serialization only"}, + {RPCResult::Type::OBJ_DYN, "fee", "Map of asset id (hex) to fee amount paid in that asset; empty object if no explicit fee outputs", + { + {RPCResult::Type::STR_AMOUNT, "xxxx", "fee amount for the asset whose id is the object key (hex-encoded asset id)"}, + }}, {RPCResult::Type::NUM, "version", "The version"}, {RPCResult::Type::NUM_TIME, "locktime", "The lock time"}, {RPCResult::Type::ARR, "vin", "", @@ -194,6 +205,23 @@ static RPCHelpMan getrawtransaction() {RPCResult::Type::STR_HEX, "hex", "hex"}, }}, {RPCResult::Type::NUM, "sequence", "The script sequence number"}, + {RPCResult::Type::BOOL, "is_pegin", /*optional=*/true, "Whether this input is a peg-in; non-coinbase inputs only"}, + {RPCResult::Type::ARR, "pegin_witness", /*optional=*/true, "Witness data for the peg-in parent chain transaction", + { + {RPCResult::Type::STR_HEX, "hex", "hex-encoded witness stack item"}, + }}, + {RPCResult::Type::OBJ, "issuance", /*optional=*/true, "Asset issuance or reissuance data", + { + {RPCResult::Type::STR_HEX, "assetBlindingNonce", ""}, + {RPCResult::Type::STR_HEX, "assetEntropy", ""}, + {RPCResult::Type::BOOL, "isreissuance", ""}, + {RPCResult::Type::STR_HEX, "asset", "asset id"}, + {RPCResult::Type::STR_HEX, "token", /*optional=*/true, "reissuance token id; new issuance only"}, + {RPCResult::Type::STR_AMOUNT, "assetamount", /*optional=*/true, ""}, + {RPCResult::Type::STR_HEX, "assetamountcommitment", /*optional=*/true, ""}, + {RPCResult::Type::STR_AMOUNT, "tokenamount", /*optional=*/true, ""}, + {RPCResult::Type::STR_HEX, "tokenamountcommitment", /*optional=*/true, ""}, + }}, {RPCResult::Type::ARR, "txinwitness", /*optional=*/true, "", { {RPCResult::Type::STR_HEX, "hex", "hex-encoded witness data (if any)"}, @@ -204,7 +232,17 @@ static RPCHelpMan getrawtransaction() { {RPCResult::Type::OBJ, "", "", { - {RPCResult::Type::NUM, "value", "The value in " + CURRENCY_UNIT}, + {RPCResult::Type::STR_AMOUNT, "value", /*optional=*/true, "The value in " + CURRENCY_UNIT}, + {RPCResult::Type::STR_AMOUNT, "value-minimum", /*optional=*/true, "Minimum decoded value for confidential outputs"}, + {RPCResult::Type::STR_AMOUNT, "value-maximum", /*optional=*/true, "Maximum decoded value for confidential outputs"}, + {RPCResult::Type::NUM, "ct-exponent", /*optional=*/true, "Confidential transaction exponent"}, + {RPCResult::Type::NUM, "ct-bits", /*optional=*/true, "Confidential transaction mantissa bits"}, + {RPCResult::Type::STR_HEX, "valuecommitment", /*optional=*/true, "Hex value commitment for confidential outputs"}, + {RPCResult::Type::STR_HEX, "surjectionproof", /*optional=*/true, "Asset surjection proof"}, + {RPCResult::Type::STR_HEX, "asset", /*optional=*/true, "Explicit asset id"}, + {RPCResult::Type::STR_HEX, "assetcommitment", /*optional=*/true, "Asset commitment"}, + {RPCResult::Type::STR_HEX, "commitmentnonce", /*optional=*/true, "Nonce commitment for confidential outputs"}, + {RPCResult::Type::BOOL, "commitmentnonce_fully_valid", /*optional=*/true, "Whether the nonce commitment parses as a valid pubkey"}, {RPCResult::Type::NUM, "n", "index"}, {RPCResult::Type::OBJ, "scriptPubKey", "", { @@ -520,6 +558,14 @@ static RPCHelpMan decoderawtransaction() {RPCResult::Type::NUM, "size", "The transaction size"}, {RPCResult::Type::NUM, "vsize", "The virtual transaction size (differs from size for witness transactions)"}, {RPCResult::Type::NUM, "weight", "The transaction's weight (between vsize*4 - 3 and vsize*4)"}, + {RPCResult::Type::NUM, "discountvsize", /*optional=*/true, "Discounted virtual size when CT fee discount is enabled (-acceptdiscountct)"}, + {RPCResult::Type::NUM, "discountweight", /*optional=*/true, "Discounted transaction weight when CT fee discount is enabled"}, + {RPCResult::Type::STR_HEX, "wtxid", /*optional=*/true, "The witness transaction id"}, + {RPCResult::Type::STR_HEX, "withash", /*optional=*/true, "Hash of witness serialization only"}, + {RPCResult::Type::OBJ_DYN, "fee", "Per-asset fee amounts; empty object when there are no explicit fee outputs", + { + {RPCResult::Type::STR_AMOUNT, "xxxx", "fee amount for the asset whose id is the object key (hex-encoded asset id)"}, + }}, {RPCResult::Type::NUM, "version", "The version"}, {RPCResult::Type::NUM_TIME, "locktime", "The lock time"}, {RPCResult::Type::ARR, "vin", "", @@ -534,6 +580,23 @@ static RPCHelpMan decoderawtransaction() {RPCResult::Type::STR, "asm", "asm"}, {RPCResult::Type::STR_HEX, "hex", "hex"}, }}, + {RPCResult::Type::BOOL, "is_pegin", /*optional=*/true, "Whether this input is a peg-in; non-coinbase inputs only"}, + {RPCResult::Type::ARR, "pegin_witness", /*optional=*/true, "Witness data for the peg-in parent chain transaction", + { + {RPCResult::Type::STR_HEX, "hex", "hex-encoded witness stack item"}, + }}, + {RPCResult::Type::OBJ, "issuance", /*optional=*/true, "Asset issuance or reissuance data", + { + {RPCResult::Type::STR_HEX, "assetBlindingNonce", ""}, + {RPCResult::Type::STR_HEX, "assetEntropy", ""}, + {RPCResult::Type::BOOL, "isreissuance", ""}, + {RPCResult::Type::STR_HEX, "asset", "asset id"}, + {RPCResult::Type::STR_HEX, "token", /*optional=*/true, "reissuance token id (new issuance only)"}, + {RPCResult::Type::STR_AMOUNT, "assetamount", /*optional=*/true, ""}, + {RPCResult::Type::STR_HEX, "assetamountcommitment", /*optional=*/true, ""}, + {RPCResult::Type::STR_AMOUNT, "tokenamount", /*optional=*/true, ""}, + {RPCResult::Type::STR_HEX, "tokenamountcommitment", /*optional=*/true, ""}, + }}, {RPCResult::Type::ARR, "txinwitness", /*optional=*/true, "", { {RPCResult::Type::STR_HEX, "hex", "hex-encoded witness data (if any)"}, @@ -545,7 +608,17 @@ static RPCHelpMan decoderawtransaction() { {RPCResult::Type::OBJ, "", "", { - {RPCResult::Type::NUM, "value", "The value in " + CURRENCY_UNIT}, + {RPCResult::Type::STR_AMOUNT, "value", /*optional=*/true, "The value in " + CURRENCY_UNIT}, + {RPCResult::Type::STR_AMOUNT, "value-minimum", /*optional=*/true, "Minimum decoded value for confidential outputs"}, + {RPCResult::Type::STR_AMOUNT, "value-maximum", /*optional=*/true, "Maximum decoded value for confidential outputs"}, + {RPCResult::Type::NUM, "ct-exponent", /*optional=*/true, "Confidential transaction exponent"}, + {RPCResult::Type::NUM, "ct-bits", /*optional=*/true, "Confidential transaction mantissa bits"}, + {RPCResult::Type::STR_HEX, "valuecommitment", /*optional=*/true, "Hex value commitment for confidential outputs"}, + {RPCResult::Type::STR_HEX, "surjectionproof", /*optional=*/true, "Asset surjection proof"}, + {RPCResult::Type::STR_HEX, "asset", /*optional=*/true, "Explicit asset id"}, + {RPCResult::Type::STR_HEX, "assetcommitment", /*optional=*/true, "Asset commitment"}, + {RPCResult::Type::STR_HEX, "commitmentnonce", /*optional=*/true, "Nonce commitment for confidential outputs"}, + {RPCResult::Type::BOOL, "commitmentnonce_fully_valid", /*optional=*/true, "Whether the nonce commitment parses as a valid pubkey"}, {RPCResult::Type::NUM, "n", "index"}, {RPCResult::Type::OBJ, "scriptPubKey", "", { @@ -1160,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, "", "", { @@ -1184,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"}, }}, @@ -1243,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"}, @@ -1330,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_commiment", "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"}, @@ -1360,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{ @@ -2087,12 +2163,12 @@ 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 asaset entropy"}, + {"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"}, {"asset_blinding_nonce", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "Do not set for new asset issuance. For reissuance, this is the blinding factor for reissuance token output for the asset being reissued"}, {"blind_reissuance", RPCArg::Type::BOOL, RPCArg::Default{true}, "Whether to mark the issuance input for blinding or not. Only affects issuances with re-issuance tokens."}, }, @@ -3286,7 +3362,7 @@ static RPCHelpMan updatepsbtpegin() {"input", RPCArg::Type::NUM, RPCArg::Optional::NO, "The index of the input to update"}, {"value", RPCArg::Type::AMOUNT, RPCArg::Optional::OMITTED, "The value of the peg-in"}, {"bitcoin_tx", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "The raw bitcoin transaction (in hex) depositing bitcoin to the mainchain_address generated by getpeginaddress"}, - {"txout_proof", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "A rawtxoutproof (in hex) generated by the mainchain daemon'sgettxoutproof containing a proof of only bitcoin_tx"}, + {"txout_proof", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "A rawtxoutproof (in hex) generated by the mainchain daemon's gettxoutproof containing a proof of only bitcoin_tx"}, {"claim_script", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "The witness program generated by getpeginaddress."}, {"genesis_hash", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "The hash of the genesis block of the chain the bitcoin_tx is in"}, }, diff --git a/src/wallet/rpc/addresses.cpp b/src/wallet/rpc/addresses.cpp index eec9767edfc..acbf61f357b 100644 --- a/src/wallet/rpc/addresses.cpp +++ b/src/wallet/rpc/addresses.cpp @@ -24,7 +24,7 @@ RPCHelpMan getnewaddress() "the address type \"blech32\" can still be used to get a blinded address.\n", { {"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."}, - {"address_type", RPCArg::Type::STR, RPCArg::DefaultHint{"set by -addresstype"}, "The address type to use. Options are \"legacy\", \"p2sh-segwit\", \"bech32\", and \"bech32m\"."}, + {"address_type", RPCArg::Type::STR, RPCArg::DefaultHint{"set by -addresstype"}, "The address type to use. Options are \"legacy\", \"p2sh-segwit\", \"bech32\", \"bech32m\", \"blech32\"."}, }, RPCResult{ RPCResult::Type::STR, "address", "The new address" @@ -87,7 +87,7 @@ RPCHelpMan getrawchangeaddress() "\nReturns a new Bitcoin address, for receiving change.\n" "This is for use with raw transactions, NOT normal use.\n", { - {"address_type", RPCArg::Type::STR, RPCArg::DefaultHint{"set by -changetype"}, "The address type to use. Options are \"legacy\", \"p2sh-segwit\", \"bech32\", and \"bech32m\"."}, + {"address_type", RPCArg::Type::STR, RPCArg::DefaultHint{"set by -changetype"}, "The address type to use. Options are \"legacy\", \"p2sh-segwit\", \"bech32\", \"bech32m\", \"blech32\"."}, }, RPCResult{ RPCResult::Type::STR, "address", "The address" diff --git a/src/wallet/rpc/backup.cpp b/src/wallet/rpc/backup.cpp index 9e23a0b2de8..e83e3380535 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 */ "", {"\"