Bitcoin
Classes | Functions | Variables
util.h File Reference
#include <node/transaction.h>
#include <outputtype.h>
#include <pubkey.h>
#include <rpc/protocol.h>
#include <rpc/request.h>
#include <script/script.h>
#include <script/sign.h>
#include <script/standard.h>
#include <univalue.h>
#include <string>
#include <vector>
#include <boost/variant.hpp>

Go to the source code of this file.

Classes

struct  UniValueType
 
struct  RPCArg
 
struct  RPCResult
 
struct  RPCResults
 
struct  RPCExamples
 
class  RPCHelpMan
 

Functions

void RPCTypeCheck (const UniValue &params, const std::list< UniValueType > &typesExpected, bool fAllowNull=false)
 
void RPCTypeCheckArgument (const UniValue &value, const UniValueType &typeExpected)
 
void RPCTypeCheckObj (const UniValue &o, const std::map< std::string, UniValueType > &typesExpected, bool fAllowNull=false, bool fStrict=false)
 
uint256 ParseHashV (const UniValue &v, std::string strName)
 
uint256 ParseHashO (const UniValue &o, std::string strKey)
 
std::vector< unsigned char > ParseHexV (const UniValue &v, std::string strName)
 
std::vector< unsigned char > ParseHexO (const UniValue &o, std::string strKey)
 
CAmount AmountFromValue (const UniValue &value)
 
std::string HelpExampleCli (const std::string &methodname, const std::string &args)
 
std::string HelpExampleRpc (const std::string &methodname, const std::string &args)
 
CPubKey HexToPubKey (const std::string &hex_in)
 
CPubKey AddrToPubKey (FillableSigningProvider *const keystore, const std::string &addr_in)
 
CTxDestination AddAndGetMultisigDestination (const int required, const std::vector< CPubKey > &pubkeys, OutputType type, FillableSigningProvider &keystore, CScript &script_out)
 
UniValue DescribeAddress (const CTxDestination &dest)
 
unsigned int ParseConfirmTarget (const UniValue &value, unsigned int max_target)
 Parse a confirm target option and raise an RPC error if it is invalid. More...
 
RPCErrorCode RPCErrorFromTransactionError (TransactionError terr)
 
UniValue JSONRPCTransactionError (TransactionError terr, const std::string &err_string="")
 
std::pair< int64_t, int64_tParseDescriptorRange (const UniValue &value)
 Parse a JSON range specified as int64, or [int64, int64]. More...
 
std::vector< CScriptEvalDescriptorStringOrObject (const UniValue &scanobject, FlatSigningProvider &provider)
 

Variables

InitInterfacesg_rpc_interfaces
 

Function Documentation

◆ AddAndGetMultisigDestination()

CTxDestination AddAndGetMultisigDestination ( const int  required,
const std::vector< CPubKey > &  pubkeys,
OutputType  type,
FillableSigningProvider keystore,
CScript script_out 
)

◆ AddrToPubKey()

CPubKey AddrToPubKey ( FillableSigningProvider *const  keystore,
const std::string &  addr_in 
)

◆ AmountFromValue()

CAmount AmountFromValue ( const UniValue value)

◆ DescribeAddress()

UniValue DescribeAddress ( const CTxDestination dest)

◆ EvalDescriptorStringOrObject()

std::vector<CScript> EvalDescriptorStringOrObject ( const UniValue scanobject,
FlatSigningProvider provider 
)

Evaluate a descriptor given as a string, or as a {"desc":...,"range":...} object, with default range of 1000.

◆ HelpExampleCli()

std::string HelpExampleCli ( const std::string &  methodname,
const std::string &  args 
)

◆ HelpExampleRpc()

std::string HelpExampleRpc ( const std::string &  methodname,
const std::string &  args 
)

◆ HexToPubKey()

CPubKey HexToPubKey ( const std::string &  hex_in)

◆ JSONRPCTransactionError()

UniValue JSONRPCTransactionError ( TransactionError  terr,
const std::string &  err_string = "" 
)

◆ ParseConfirmTarget()

unsigned int ParseConfirmTarget ( const UniValue value,
unsigned int  max_target 
)

Parse a confirm target option and raise an RPC error if it is invalid.

◆ ParseDescriptorRange()

std::pair<int64_t, int64_t> ParseDescriptorRange ( const UniValue value)

Parse a JSON range specified as int64, or [int64, int64].

◆ ParseHashO()

uint256 ParseHashO ( const UniValue o,
std::string  strKey 
)

◆ ParseHashV()

uint256 ParseHashV ( const UniValue v,
std::string  strName 
)

Utilities: convert hex-encoded Values (throws error if not hex).

◆ ParseHexO()

std::vector<unsigned char> ParseHexO ( const UniValue o,
std::string  strKey 
)

◆ ParseHexV()

std::vector<unsigned char> ParseHexV ( const UniValue v,
std::string  strName 
)

◆ RPCErrorFromTransactionError()

RPCErrorCode RPCErrorFromTransactionError ( TransactionError  terr)

◆ RPCTypeCheck()

void RPCTypeCheck ( const UniValue params,
const std::list< UniValueType > &  typesExpected,
bool  fAllowNull = false 
)

Type-check arguments; throws JSONRPCError if wrong type given. Does not check that the right number of arguments are passed, just that any passed are the correct type.

◆ RPCTypeCheckArgument()

void RPCTypeCheckArgument ( const UniValue value,
const UniValueType typeExpected 
)

Type-check one argument; throws JSONRPCError if wrong type given.

◆ RPCTypeCheckObj()

void RPCTypeCheckObj ( const UniValue o,
const std::map< std::string, UniValueType > &  typesExpected,
bool  fAllowNull = false,
bool  fStrict = false 
)

Variable Documentation

◆ g_rpc_interfaces

InitInterfaces* g_rpc_interfaces

Pointers to interfaces that need to be accessible from RPC methods. Due to limitations of the RPC framework, there's currently no direct way to pass in state to RPC method implementations.