7 #ifndef RAVEN_RPCSERVER_H 8 #define RAVEN_RPCSERVER_H 21 static const unsigned int DEFAULT_RPC_SERIALIZE_VERSION = 1;
27 void OnStarted(std::function<
void ()> slot);
28 void OnStopped(std::function<
void ()> slot);
51 void parse(
const UniValue& valRequest);
73 const std::list<UniValue::VType>& 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;
113 virtual RPCTimerBase* NewTimer(std::function<
void(
void)>& func, int64_t millis) = 0;
127 void RPCRunLater(
const std::string& name, std::function<
void(
void)> func, int64_t nSeconds);
149 const CRPCCommand* operator[](
const std::string& name)
const;
164 std::vector<std::string> listCommands()
const;
172 bool appendCommand(
const std::string& name,
const CRPCCommand* pcmd);
185 extern std::vector<unsigned char>
ParseHexV(
const UniValue& v, std::string strName);
186 extern std::vector<unsigned char>
ParseHexO(
const UniValue& o, std::string strKey);
189 extern std::string
HelpExampleCli(
const std::string& methodname,
const std::string& args);
190 extern std::string
HelpExampleRpc(
const std::string& methodname,
const std::string& args);
200 #endif // RAVEN_RPCSERVER_H UniValueType(UniValue::VType _type)
bool IsRPCRunning()
Query whether RPC is running.
Raven 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 RPCSetTimerInterface(RPCTimerInterface *iface)
Set the factory function for timers.
std::vector< std::string > argNames
std::string HelpExampleRpc(const std::string &methodname, const std::string &args)
int64_t CAmount
Amount in corbies (Can be negative)
CAmount AmountFromValue(const UniValue &value)
void RPCTypeCheck(const UniValue ¶ms, const std::list< UniValue::VType > &typesExpected, bool fAllowNull=false)
Type-check arguments; throws JSONRPCError if wrong type given.
std::string HelpExampleCli(const std::string &methodname, const std::string &args)
void RPCTypeCheckArgument(const UniValue &value, UniValue::VType typeExpected)
Type-check one argument; throws JSONRPCError if wrong type given.
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
UniValue help(const JSONRPCRequest &jsonRequest)
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.
const UniValue NullUniValue
void RPCRunLater(const std::string &name, std::function< void(void)> func, int64_t nSeconds)
Run func nSeconds from now.
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)
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)