6 #ifndef BITCOIN_RPC_SERVER_H 7 #define BITCOIN_RPC_SERVER_H 20 static const unsigned int DEFAULT_RPC_SERIALIZE_VERSION = 1;
26 void OnStarted(std::function<
void ()> slot);
27 void OnStopped(std::function<
void ()> slot);
73 const std::list<UniValueType>& typesExpected,
bool fAllowNull=
false);
84 const std::map<std::string, UniValueType>& typesExpected,
85 bool fAllowNull =
false,
86 bool fStrict =
false);
106 virtual const char *
Name() = 0;
127 void RPCRunLater(
const std::string&
name, std::function<
void()> func, int64_t nSeconds);
194 extern std::vector<unsigned char>
ParseHexV(
const UniValue& v, std::string strName);
195 extern std::vector<unsigned char>
ParseHexO(
const UniValue& o, std::string strKey);
198 extern std::string
HelpExampleCli(
const std::string& methodname,
const std::string& args);
199 extern std::string
HelpExampleRpc(
const std::string& methodname,
const std::string& args);
209 #endif // BITCOIN_RPC_SERVER_H UniValueType(UniValue::VType _type)
std::string help(const std::string &name, const JSONRPCRequest &helpreq) const
Note: This interface may still be subject to change.
bool IsRPCRunning()
Query whether RPC is running.
Bitcoin RPC command dispatcher.
uint256 ParseHashV(const UniValue &v, std::string strName)
Utilities: convert hex-encoded Values (throws error if not hex).
std::vector< unsigned char > ParseHexO(const UniValue &o, std::string strKey)
void SetRPCWarmupFinished()
void OnStopped(std::function< void()> slot)
void RPCTypeCheckArgument(const UniValue &value, const UniValueType &typeExpected)
Type-check one argument; throws JSONRPCError if wrong type given.
void RPCSetTimerInterface(RPCTimerInterface *iface)
Set the factory function for timers.
bool appendCommand(const std::string &name, const CRPCCommand *pcmd)
Appends a CRPCCommand to the dispatch table.
std::vector< std::string > argNames
std::string HelpExampleRpc(const std::string &methodname, const std::string &args)
int64_t CAmount
Amount in satoshis (Can be negative)
UniValue execute(const JSONRPCRequest &request) const
Execute a method.
const CRPCCommand * operator[](const std::string &name) const
CAmount AmountFromValue(const UniValue &value)
std::string HelpExampleCli(const std::string &methodname, const std::string &args)
std::vector< unsigned char > ParseHexV(const UniValue &v, std::string strName)
bool IsDeprecatedRPCEnabled(const std::string &method)
int RPCSerializationFlags()
virtual ~RPCTimerInterface()
std::map< std::string, const CRPCCommand * > mapCommands
void RPCRunLater(const std::string &name, std::function< void()> func, int64_t nSeconds)
Run func nSeconds from now.
virtual RPCTimerBase * NewTimer(std::function< void()> &func, int64_t millis)=0
Factory function for timers.
void parse(const UniValue &valRequest)
void RPCTypeCheckObj(const UniValue &o, const std::map< std::string, UniValueType > &typesExpected, bool fAllowNull=false, bool fStrict=false)
void RPCUnsetTimerInterface(RPCTimerInterface *iface)
Unset factory function for timers.
uint256 ParseHashO(const UniValue &o, std::string strKey)
Opaque base class for timers returned by NewTimerFunc.
void RPCTypeCheck(const UniValue ¶ms, const std::list< UniValueType > &typesExpected, bool fAllowNull=false)
Type-check arguments; throws JSONRPCError if wrong type given.
const UniValue NullUniValue
virtual const char * Name()=0
Implementation name.
void OnStarted(std::function< void()> slot)
void SetRPCWarmupStatus(const std::string &newStatus)
Set the RPC warmup status.
std::string JSONRPCExecBatch(const JSONRPCRequest &jreq, const UniValue &vReq)
std::vector< std::string > listCommands() const
Returns a list of registered commands.
void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface)
Set the factory function for timer, but only, if unset.
UniValue(* rpcfn_type)(const JSONRPCRequest &jsonRequest)
Wrapper for UniValue::VType, which includes typeAny: Used to denote don't care type.
bool RPCIsInWarmup(std::string *outStatus)