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..8b298a72473 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"}, @@ -1556,7 +1556,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 +1624,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..dc7642b3a42 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -180,6 +180,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 +202,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 +229,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 +555,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 +577,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 +605,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", "", { @@ -1335,7 +1405,7 @@ static RPCHelpMan decodepsbt() {{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_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"}, @@ -2092,7 +2162,7 @@ static RPCHelpMan createpsbt() {"pegin_claim_script", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The witness program 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 +3356,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..ca2215e3e1f 100644 --- a/src/wallet/rpc/backup.cpp +++ b/src/wallet/rpc/backup.cpp @@ -1674,7 +1674,7 @@ RPCHelpMan importdescriptors() }, RPCExamples{ HelpExampleCli("importdescriptors", "'[{ \"desc\": \"\", \"timestamp\":1455191478, \"internal\": true }, " - "{ \"desc\": \"\", \"label\": \"example 2\", \"timestamp\": 1455191480 }]'") + + "{ \"desc\": \"\", \"label\": \"example 2\", \"timestamp\": 1455191480 }]'") + HelpExampleCli("importdescriptors", "'[{ \"desc\": \"\", \"timestamp\":1455191478, \"active\": true, \"range\": [0,100], \"label\": \"\" }]'") }, [&](const RPCHelpMan& self, const JSONRPCRequest& main_request) -> UniValue diff --git a/src/wallet/rpc/coins.cpp b/src/wallet/rpc/coins.cpp index 0068e5819dc..6d2b11a05a7 100644 --- a/src/wallet/rpc/coins.cpp +++ b/src/wallet/rpc/coins.cpp @@ -98,11 +98,17 @@ RPCHelpMan getreceivedbyaddress() {"include_immature_coinbase", RPCArg::Type::BOOL, RPCArg::Default{false}, "Include immature coinbase transactions."}, }, { - RPCResult{RPCResult::Type::OBJ, "amount_map", "The total amount, per asset if none is specified, in " + CURRENCY_UNIT + " received for this wallet.", - { - {RPCResult::Type::ELISION, "", "the amount for each asset"}, - }}, - RPCResult{RPCResult::Type::NUM, "amount", "the total amount for the asset, if one is specified"}, + RPCResult{"if in Elements mode and assetlabel is omitted or empty", + RPCResult::Type::OBJ_DYN, + "", + "Map from asset label or hex asset id to numeric amount in " + CURRENCY_UNIT + ".", + { + {RPCResult::Type::STR_AMOUNT, "n", "amount for the keyed asset"}, + }}, + RPCResult{"if not in Elements mode, or assetlabel is provided", + RPCResult::Type::STR_AMOUNT, + "amount", + "Single total in " + CURRENCY_UNIT + " for the default or requested asset."}, RPCResult{RPCResult::Type::NONE, "", ""}, // in case the wallet is disabled }, RPCExamples{ @@ -150,11 +156,17 @@ RPCHelpMan getreceivedbylabel() {"include_immature_coinbase", RPCArg::Type::BOOL, RPCArg::Default{false}, "Include immature coinbase transactions."}, }, { - RPCResult{RPCResult::Type::OBJ, "amount_map", "The total amount, per asset if none is specified, in " + CURRENCY_UNIT + " received for this wallet.", - { - {RPCResult::Type::ELISION, "", "the amount for each asset"}, - }}, - RPCResult{RPCResult::Type::NUM, "amount", "the total amount for the asset, if one is specified"}, + RPCResult{"if in Elements mode and assetlabel is omitted or empty", + RPCResult::Type::OBJ_DYN, + "", + "Map from asset label or hex asset id to numeric amount in " + CURRENCY_UNIT + ".", + { + {RPCResult::Type::STR_AMOUNT, "n", "amount for the keyed asset"}, + }}, + RPCResult{"if not in Elements mode, or assetlabel is provided", + RPCResult::Type::STR_AMOUNT, + "amount", + "Single total in " + CURRENCY_UNIT + " for the default or requested asset."}, RPCResult{RPCResult::Type::NONE, "", ""}, // in case the wallet is disabled }, RPCExamples{ @@ -205,11 +217,17 @@ RPCHelpMan getbalance() {"assetlabel", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "Hex asset id or asset label for balance."}, }, { - RPCResult{RPCResult::Type::OBJ, "amount_map", "The total amount, per asset if none is specified, in " + CURRENCY_UNIT + " received for this wallet.", - { - {RPCResult::Type::ELISION, "", "the amount for each asset"}, - }}, - RPCResult{RPCResult::Type::NUM, "amount", "the total amount for the asset, if one is specified"}, + RPCResult{"if in Elements mode and assetlabel is omitted or empty", + RPCResult::Type::OBJ_DYN, + "", + "Map from asset label or hex asset id to numeric amount in " + CURRENCY_UNIT + ".", + { + {RPCResult::Type::STR_AMOUNT, "n", "amount for the keyed asset"}, + }}, + RPCResult{"if not in Elements mode, or assetlabel is provided", + RPCResult::Type::STR_AMOUNT, + "amount", + "Single total in " + CURRENCY_UNIT + " for the default or requested asset."}, RPCResult{RPCResult::Type::NONE, "", ""}, // in case the wallet is disabled }, RPCExamples{ @@ -267,11 +285,17 @@ RPCHelpMan getunconfirmedbalance() "DEPRECATED\nIdentical to getbalances().mine.untrusted_pending\n", {}, { - RPCResult{RPCResult::Type::OBJ, "amount_map", "The total amount, per asset if none is specified, in " + CURRENCY_UNIT + " received for this wallet.", - { - {RPCResult::Type::ELISION, "", "the amount for each asset"}, - }}, - RPCResult{RPCResult::Type::NUM, "amount", "the total amount for the asset, if one is specified"}, + RPCResult{"if in Elements mode (no asset filter for this RPC)", + RPCResult::Type::OBJ_DYN, + "", + "Map from asset label or hex asset id to numeric amount in " + CURRENCY_UNIT + ".", + { + {RPCResult::Type::STR_AMOUNT, "n", "amount for the keyed asset"}, + }}, + RPCResult{"if not in Elements mode", + RPCResult::Type::STR_AMOUNT, + "amount", + "Single total in " + CURRENCY_UNIT + " for the default asset."}, RPCResult{RPCResult::Type::NONE, "", ""}, // in case the wallet is disabled }, RPCExamples{""}, diff --git a/src/wallet/rpc/elements.cpp b/src/wallet/rpc/elements.cpp index 0f0f0c7cdd4..ae5f76a846c 100644 --- a/src/wallet/rpc/elements.cpp +++ b/src/wallet/rpc/elements.cpp @@ -164,6 +164,12 @@ RPCHelpMan getpeginaddress() { {RPCResult::Type::STR, "mainchain_address", "mainchain deposit address to send bitcoin to"}, {RPCResult::Type::STR_HEX, "claim_script", "claim script committed to by the mainchain address. This may be required in `claimpegin` to retrieve pegged-in funds\n"}, + {RPCResult::Type::STR_AMOUNT, "pegin_min_amount", /*optional=*/true, "Minimum peg-in amount in " + CURRENCY_UNIT}, + {RPCResult::Type::NUM, "pegin_min_height", /*optional=*/true, "Minimum block height for peg-in amount rule"}, + {RPCResult::Type::BOOL, "pegin_min_active", /*optional=*/true, "Whether the peg-in minimum height rule is active at the current tip"}, + {RPCResult::Type::STR_AMOUNT, "pegin_subsidy_threshold", /*optional=*/true, "Peg-in subsidy threshold amount"}, + {RPCResult::Type::NUM, "pegin_subsidy_height", /*optional=*/true, "Block height at which peg-in subsidy activates"}, + {RPCResult::Type::BOOL, "pegin_subsidy_active", /*optional=*/true, "Whether peg-in subsidy is active at the current tip"}, }, }, RPCExamples{ @@ -1689,7 +1695,7 @@ RPCHelpMan listissuances() return RPCHelpMan{"listissuances", "\nList all issuances known to the wallet for the given asset, or for all issued assets if none provided.\n", { - {"asset", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "The asset whose issaunces you wish to list. Accepts either the asset hex or the locally assigned asset label."}, + {"asset", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "The asset whose issuances you wish to list. Accepts either the asset hex or the locally assigned asset label."}, }, RPCResult{ RPCResult::Type::ARR, "", "List of transaction issuances and information in wallet", @@ -1700,7 +1706,7 @@ RPCHelpMan listissuances() {RPCResult::Type::STR_HEX, "entropy", "Entropy of the asset type"}, {RPCResult::Type::STR_HEX, "asset", "Asset type for issuance if known"}, {RPCResult::Type::STR, "assetlabel", "Asset label for issuance if set"}, - {RPCResult::Type::STR_HEX, "token", "Token type for issuancen"}, + {RPCResult::Type::STR_HEX, "token", "Token type for issuance"}, {RPCResult::Type::NUM, "vin", "The input position of the issuance in the transaction"}, {RPCResult::Type::STR_AMOUNT, "assetamount", "The amount of asset issued. Is -1 if blinded and unknown to wallet"}, {RPCResult::Type::STR_AMOUNT, "tokenamount", "The reissuance token amount issued. Is -1 if blinded and unknown to wallet"}, diff --git a/src/wallet/rpc/spend.cpp b/src/wallet/rpc/spend.cpp index 8ad60b901e5..37e835226e6 100644 --- a/src/wallet/rpc/spend.cpp +++ b/src/wallet/rpc/spend.cpp @@ -1449,7 +1449,7 @@ RPCHelpMan walletcreatefundedpsbt() {"pegin_claim_script", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The witness program 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."}, {"weight", RPCArg::Type::NUM, RPCArg::DefaultHint{"Calculated from wallet and solving data"}, "The maximum weight for this input, " diff --git a/src/wallet/rpc/transactions.cpp b/src/wallet/rpc/transactions.cpp index 334ee241626..7db391e0a5c 100644 --- a/src/wallet/rpc/transactions.cpp +++ b/src/wallet/rpc/transactions.cpp @@ -282,9 +282,9 @@ RPCHelpMan listreceivedbyaddress() RPCExamples{ HelpExampleCli("listreceivedbyaddress", "") + HelpExampleCli("listreceivedbyaddress", "6 true") - + HelpExampleCli("listreceivedbyaddress", "6 true true \"\" true") + + HelpExampleCli("listreceivedbyaddress", "6 true true \"\" \"\" true") + HelpExampleRpc("listreceivedbyaddress", "6, true, true") - + HelpExampleRpc("listreceivedbyaddress", "6, true, true, \"" + EXAMPLE_ADDRESS[0] + "\", true") + + HelpExampleRpc("listreceivedbyaddress", "6, true, true, \"" + EXAMPLE_ADDRESS[0] + "\", \"\", true") }, [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue { @@ -329,6 +329,7 @@ RPCHelpMan listreceivedbylabel() RPCExamples{ HelpExampleCli("listreceivedbylabel", "") + HelpExampleCli("listreceivedbylabel", "6 true") + + HelpExampleCli("listreceivedbylabel", "6 true true true") + HelpExampleRpc("listreceivedbylabel", "6, true, true, true") }, [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue @@ -500,7 +501,7 @@ RPCHelpMan listtransactions() {RPCResult::Type::OBJ, "", "", Cat(Cat>( { {RPCResult::Type::BOOL, "involvesWatchonly", /*optional=*/true, "Only returns true if imported addresses were involved in transaction."}, - {RPCResult::Type::STR, "address", "The bitcoin address of the transaction."}, + {RPCResult::Type::STR, "address", /*optional=*/true, "The bitcoin address of the transaction."}, {RPCResult::Type::STR, "category", "The transaction category.\n" "\"send\" Transactions sent.\n" "\"receive\" Non-coinbase transactions received.\n" @@ -614,7 +615,7 @@ RPCHelpMan listsinceblock() {RPCResult::Type::OBJ, "", "", Cat(Cat>( { {RPCResult::Type::BOOL, "involvesWatchonly", /*optional=*/true, "Only returns true if imported addresses were involved in transaction."}, - {RPCResult::Type::STR, "address", "The bitcoin address of the transaction."}, + {RPCResult::Type::STR, "address", /*optional=*/true, "The bitcoin address of the transaction."}, {RPCResult::Type::STR, "category", "The transaction category.\n" "\"send\" Transactions sent.\n" "\"receive\" Non-coinbase transactions received.\n" @@ -912,7 +913,7 @@ RPCHelpMan rescanblockchain() RPCResult::Type::OBJ, "", "", { {RPCResult::Type::NUM, "start_height", "The block height where the rescan started (the requested height or 0)"}, - {RPCResult::Type::NUM, "stop_height", "The height of the last rescanned block. May be null in rare cases if there was a reorg and the call didn't scan any blocks because they were already scanned in the background."}, + {RPCResult::Type::NUM, "stop_height", /*optional=*/true, "The height of the last rescanned block. May be null in rare cases if there was a reorg and the call didn't scan any blocks because they were already scanned in the background."}, } }, RPCExamples{ diff --git a/src/wallet/rpc/wallet.cpp b/src/wallet/rpc/wallet.cpp index 550da97d8f4..6848dc5bc65 100644 --- a/src/wallet/rpc/wallet.cpp +++ b/src/wallet/rpc/wallet.cpp @@ -254,7 +254,7 @@ static RPCHelpMan setwalletflag() { {RPCResult::Type::STR, "flag_name", "The name of the flag that was modified"}, {RPCResult::Type::BOOL, "flag_state", "The new state of the flag"}, - {RPCResult::Type::STR, "warnings", "Any warnings associated with the change"}, + {RPCResult::Type::STR, "warnings", /*optional=*/true, "Any warnings associated with the change"}, } }, RPCExamples{