6 #ifndef FABCOIN_RPCSERVER_H 7 #define FABCOIN_RPCSERVER_H 21 #include <condition_variable> 23 static const unsigned int DEFAULT_RPC_SERIALIZE_VERSION = 1;
30 static std::mutex cs_blockchange;
31 static std::condition_variable cond_blockchange;
74 isLongPolling =
false;
102 void PollReply(
const UniValue& result);
104 void parse(
const UniValue& valRequest);
129 const std::list<UniValue::VType>& typesExpected,
bool fAllowNull=
false);
140 const std::map<std::string, UniValueType>& typesExpected,
141 bool fAllowNull =
false,
142 bool fStrict =
false);
162 virtual const char *Name() = 0;
221 std::vector<std::string> listCommands()
const;
240 extern std::vector<unsigned char>
ParseHexV(
const UniValue& v, std::string strName);
241 extern std::vector<unsigned char>
ParseHexO(
const UniValue& o, std::string strKey);
250 extern std::string
HelpExampleCli(
const std::string& methodname,
const std::string& args);
251 extern std::string
HelpExampleRpc(
const std::string& methodname,
const std::string& args);
263 #endif // FABCOIN_RPCSERVER_H UniValueType(UniValue::VType _type)
#define function(a, b, c, d, k, s)
std::string JSONRPCExecBatch(const UniValue &vReq)
bool IsRPCRunning()
Query whether RPC is running.
Fabcoin 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 lius (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)
int64_t nWalletUnlockTime
int RPCSerializationFlags()
virtual ~RPCTimerInterface()
std::map< std::string, const CRPCCommand * > mapCommands
void RPCNotifyBlockChange(bool ibd, const CBlockIndex *)
Callback for when block tip changed.
std::string HelpRequiringPassphrase()
IP address (IPv6, or IPv4 using mapped IPv6 range (::FFFF:0:0/96))
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.
void OnPostCommand(std::function< void(const CRPCCommand &)> slot)
JSONRPCRequest()
If using batch JSON request, this object won't get the underlying HTTPRequest.
PlatformStyle::TableColorType type
uint256 ParseHashO(const UniValue &o, std::string strKey)
The block chain is a tree shaped structure starting with the genesis block at the root...
UniValue ValueFromAmount(const CAmount &amount)
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.
void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface)
Set the factory function for timer, but only, if unset.
UniValue(* rpcfn_type)(const JSONRPCRequest &jsonRequest)
double GetDifficulty(const CBlockIndex *blockindex)
Get the difficulty of the net wrt to the given block index, or the chain tip if not provided...
Wrapper for UniValue::VType, which includes typeAny: Used to denote don't care type.
bool RPCIsInWarmup(std::string *outStatus)
void EnsureWalletIsUnlocked()
void OnPreCommand(std::function< void(const CRPCCommand &)> slot)