![]() |
Bitcoin Core 31.1.0
P2P Digital Currency
|
#include <server.h>
Public Types | |
| using | Actor = std::function<bool(const JSONRPCRequest& request, UniValue& result, bool last_handler)> |
Public Member Functions | |
| CRPCCommand (std::string category, std::string name, Actor actor, std::vector< std::pair< std::string, bool > > args, intptr_t unique_id) | |
| Constructor taking Actor callback supporting multiple handlers. | |
| CRPCCommand (std::string category, RpcMethodFnType fn) | |
| Simplified constructor taking plain RpcMethodFnType function pointer. | |
Public Attributes | |
| std::string | category |
| std::string | name |
| Actor | actor |
| std::vector< std::pair< std::string, bool > > | argNames |
| intptr_t | unique_id |
| using CRPCCommand::Actor = std::function<bool(const JSONRPCRequest& request, UniValue& result, bool last_handler)> |
|
inline |
|
inline |
Simplified constructor taking plain RpcMethodFnType function pointer.
Definition at line 57 of file server.h.
| std::vector<std::pair<std::string, bool> > CRPCCommand::argNames |
List of method arguments and whether they are named-only. Incoming RPC requests contain a "params" field that can either be an array containing unnamed arguments or an object containing named arguments. The "argNames" vector is used in the latter case to transform the params object into an array. Each argument in "argNames" gets mapped to a unique position in the array, based on the order it is listed, unless the argument is a named-only argument with argNames[x].second set to true. Named-only arguments are combined into a JSON object that is appended after other arguments, see transformNamedArguments for details.