UniValue

A dynamically typed JSON value used across Bitcoin Core's RPC layer.

Synopsis

Declared in <univalue/include/univalue.h>

class UniValue;

Non-Member Functions

NameDescription
AmountFromValueValidate and return a CAmount from a UniValue number or string.
BanMapFromJsonConvert a JSON array to a banmap_t object.
BanMapToJsonConvert a banmap_t object to a JSON array.
ConstructTransactionCreate a transaction from univalue parameters
CreateUTXOSnapshotHelper to create UTXO snapshots given a chainstate and a file handle.
DescribeAddressDescribe an address as a JSON object for RPC output.
EvalDescriptorStringOrObjectEvaluate a descriptor given as a string, or as a {"desc":...,"range":...} object, with default range of 1000.
ExecuteHTTPRPCExecute a single HTTP request containing one or more JSONRPC requests. Specified jreq will be modified and status will be returned.
JSONRPCErrorBuild a JSON-RPC error object.
JSONRPCExecExecute an RPC request and return its JSON-RPC reply.
JSONRPCPSBTErrorBuild a JSON-RPC error object for a PSBT error.
JSONRPCProcessBatchReplyParse JSON-RPC batch reply into a vector
JSONRPCReplyObjBuild a JSON-RPC reply object from a result or error.
JSONRPCRequestObjJSON-RPC 2.0 request, only used in bitcoin-cli
JSONRPCTransactionErrorBuild a JSON-RPC error object for a transaction error.
MempoolInfoToJSONMempool information to JSON
MempoolToJSONMempool to JSON
NormalizeOutputsNormalize univalue-represented outputs
ParseConfirmTargetParse a confirm target option and raise an RPC error if it is invalid.
ParseDescriptorRangeParse a JSON range specified as an int64 or as a [int64, int64]pair.
ParseFeeRateParse a json number or string, denoting BTC/kvB, into a CFeeRate (sat/kvB). Reject negative values or rates larger than 1BTC/kvB.
ParseHashOParse a hex-encoded hash from a named field of an object.
ParseHashVParse a hex-encoded hash from a UniValue, throwing an RPC error if it is not valid hex.
ParseHexOParse a hex-encoded byte vector from a named field of an object.
ParseHexVParse a hex-encoded byte vector from a UniValue, throwing an RPC error if it is not valid hex.
ParseOutputsParse normalized outputs into destination, amount tuples
ParsePrevoutsParse a prevtxs UniValue array and get the map of coins from it
ParseSighashStringParse a sighash string representation and raise an RPC error if it is invalid.
ParseVerbosityParses verbosity from provided UniValue.
PushWarningsPush warning messages to an RPC "warnings" field as a JSON array of strings.
RPCConvertNamedValuesConvert named arguments to command-specific RPC representation
RPCConvertValuesConvert positional arguments to command-specific RPC representation
RPCTypeCheckObjCheck that an object contains the expected keys with the expected value types.
RunCommandParseJSONExecute a command which returns JSON, and parse the result.
ValueFromAmountConvert an amount in satoshis into a JSON value denominated in whole coins.
blockToJSONBlock description to JSON
blockheaderToJSONBlock header to JSON
node::GetWarningsForRpcRPC helper function that wraps warnings.GetMessages().
wallet::AppendLastProcessedBlockAppends the wallet's last processed block to an RPC result object.
wallet::LabelFromValueValidates and extracts an address label from an RPC value.