7 #ifndef PIVX_RPC_SERVER_H
8 #define PIVX_RPC_SERVER_H
25 void OnStarted(std::function<
void ()> slot);
26 void OnStopped(std::function<
void ()> slot);
75 const std::list<UniValue::VType>& typesExpected,
bool fAllowNull=
false);
86 const std::map<std::string, UniValueType>& typesExpected,
87 bool fAllowNull=
false,
108 virtual const char *
Name() = 0;
129 void RPCRunLater(
const std::string&
name, std::function<
void(
void)> func, int64_t nSeconds);
188 extern std::vector<unsigned char>
ParseHexV(
const UniValue& v, std::string strName);
189 extern std::vector<unsigned char>
ParseHexO(
const UniValue& o, std::string strKey);
197 extern std::string
HelpExampleCli(std::string methodname, std::string args);
198 extern std::string
HelpExampleRpc(std::string methodname, std::string args);
int64_t CAmount
Amount in PIV (Can be negative)
The block chain is a tree shaped structure starting with the genesis block at the root,...
std::vector< std::string > argNames
PIVX RPC command dispatcher.
std::vector< std::string > listCommands() const
Returns a list of registered commands.
const CRPCCommand * operator[](const std::string &name) const
bool appendCommand(const std::string &name, const CRPCCommand *pcmd)
Appends a CRPCCommand to the dispatch table.
UniValue execute(const JSONRPCRequest &request) const
Execute a method.
std::map< std::string, const CRPCCommand * > mapCommands
std::string help(const std::string &name, const JSONRPCRequest &helpreq) const
Note: This interface may still be subject to change.
void parse(const UniValue &valRequest)
Opaque base class for timers returned by NewTimerFunc.
virtual ~RPCTimerInterface()
virtual RPCTimerBase * NewTimer(std::function< void(void)> &func, int64_t millis)=0
Factory function for timers.
virtual const char * Name()=0
Implementation name.
void OnPreCommand(std::function< void(const CRPCCommand &)> slot)
void OnStarted(std::function< void()> slot)
void OnStopped(std::function< void()> slot)
void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface)
Set factory function for timers, but only if unset.
bool IsDeprecatedRPCEnabled(const std::string &method)
bool RPCIsInWarmup(std::string *statusOut)
void SetRPCWarmupFinished()
double GetDifficulty(const CBlockIndex *blockindex=nullptr)
std::vector< unsigned char > ParseHexV(const UniValue &v, std::string strName)
void RPCNotifyBlockChange(bool fInitialDownload, const CBlockIndex *pindex)
void RPCTypeCheckArgument(const UniValue &value, const UniValueType &typeExpected)
Type-check one argument; throws JSONRPCError if wrong type given.
void RPCUnsetTimerInterface(RPCTimerInterface *iface)
Unset factory function for timers.
bool ParseBool(const UniValue &o, std::string strKey)
UniValue ValueFromAmount(const CAmount &amount)
bool IsRPCRunning()
Query whether RPC is running.
void RPCRunLater(const std::string &name, std::function< void(void)> func, int64_t nSeconds)
Run func nSeconds from now.
std::string JSONRPCExecBatch(const UniValue &vReq)
int ParseInt(const UniValue &o, std::string strKey)
std::string HelpExampleCli(std::string methodname, std::string args)
void RPCTypeCheck(const UniValue ¶ms, const std::list< UniValue::VType > &typesExpected, bool fAllowNull=false)
Type-check arguments; throws JSONRPCError if wrong type given.
void RPCTypeCheckObj(const UniValue &o, const std::map< std::string, UniValueType > &typesExpected, bool fAllowNull=false, bool fStrict=false)
Check for expected keys/value types in an Object.
CAmount AmountFromValue(const UniValue &value)
UniValue(* rpcfn_type)(const JSONRPCRequest &jsonRequest)
uint256 ParseHashO(const UniValue &o, std::string strKey)
double ParseDoubleV(const UniValue &v, const std::string &strName)
std::vector< unsigned char > ParseHexO(const UniValue &o, std::string strKey)
uint256 ParseHashV(const UniValue &v, std::string strName)
Utilities: convert hex-encoded Values (throws error if not hex).
std::string HelpExampleRpc(std::string methodname, std::string args)
void SetRPCWarmupStatus(const std::string &newStatus)
Set the RPC warmup status.
void RPCSetTimerInterface(RPCTimerInterface *iface)
Set factory function for timers.
Wrapper for UniValue::VType, which includes typeAny: Used to denote don't care type.
UniValueType(UniValue::VType _type)
const UniValue NullUniValue