1#include <xrpld/rpc/Context.h>
2#include <xrpld/rpc/handlers/Handlers.h>
4#include <xrpl/json/json_value.h>
5#include <xrpl/protocol/ErrorCodes.h>
6#include <xrpl/protocol/PublicKey.h>
7#include <xrpl/protocol/RPCErr.h>
8#include <xrpl/protocol/jss.h>
19 auto const& params = context.
params;
21 if (!params.isMember(jss::public_key))
37 if (!params[jss::public_key].isString())
43 if (params.isMember(jss::description))
45 if (!params[jss::description].isString())
47 desc = params[jss::description].asString();
64 result[jss::previous] = previous->toJson();
72 auto const& params = context.
params;
75 if (!params.isMember(jss::public_key))
77 if (!params[jss::public_key].isString())
91 result[jss::previous] = previous->toJson();
104 for (
auto const& reservation : reservations)
106 jaReservations.
append(reservation.toJson());
Value & append(Value const &value)
Append value to array at the end.
virtual PeerReservationTable & peerReservations()=0
std::optional< PeerReservation > insert_or_assign(PeerReservation const &reservation)
std::vector< PeerReservation > list() const
std::optional< PeerReservation > erase(PublicKey const &nodeId)
@ arrayValue
array value (ordered list)
@ objectValue
object value (collection of name/value pairs).
Json::Value expected_field_error(std::string const &name, std::string const &type)
Json::Value missing_field_error(std::string const &name)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Json::Value doPeerReservationsAdd(RPC::JsonContext &)
Json::Value doPeerReservationsList(RPC::JsonContext &)
Json::Value rpcError(int iError)
Json::Value doPeerReservationsDel(RPC::JsonContext &)