1#include <xrpld/rpc/Context.h>
2#include <xrpld/rpc/handlers/Handlers.h>
4#include <xrpl/core/PeerReservationTable.h>
5#include <xrpl/json/json_value.h>
6#include <xrpl/protocol/ErrorCodes.h>
7#include <xrpl/protocol/PublicKey.h>
8#include <xrpl/protocol/RPCErr.h>
9#include <xrpl/protocol/jss.h>
10#include <xrpl/protocol/tokens.h>
20 auto const& params = context.
params;
22 if (!params.isMember(jss::public_key))
38 if (!params[jss::public_key].isString())
44 if (params.isMember(jss::description))
46 if (!params[jss::description].isString())
48 desc = params[jss::description].asString();
65 result[jss::previous] = previous->toJson();
std::optional< PeerReservation > insertOrAssign(PeerReservation const &reservation)
virtual PeerReservationTable & getPeerReservations()=0
@ Object
object value (collection of name/value pairs).
json::Value missingFieldError(std::string const &name)
json::Value expectedFieldError(std::string const &name, std::string const &type)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::optional< AccountID > parseBase58(std::string const &s)
Parse AccountID from checked, base58 string.
json::Value rpcError(ErrorCodeI iError)
json::Value doPeerReservationsAdd(RPC::JsonContext &context)