xrpld
Loading...
Searching...
No Matches
Handler.cpp
1#include <xrpld/rpc/detail/Handler.h>
2
3#include <xrpld/rpc/Context.h>
4#include <xrpld/rpc/MethodNames.h>
5#include <xrpld/rpc/Role.h>
6#include <xrpld/rpc/detail/SpecBridge.hpp>
7#include <xrpld/rpc/handlers/Handlers.h>
8#include <xrpld/rpc/handlers/account/AccountChannels.h>
9#include <xrpld/rpc/handlers/account/AccountCurrencies.h>
10#include <xrpld/rpc/handlers/account/AccountInfo.h>
11#include <xrpld/rpc/handlers/account/AccountLines.h>
12#include <xrpld/rpc/handlers/account/AccountNFTs.h>
13#include <xrpld/rpc/handlers/account/AccountOffers.h>
14#include <xrpld/rpc/handlers/ledger/Ledger.h>
15#include <xrpld/rpc/handlers/orderbook/BookChanges.h>
16#include <xrpld/rpc/handlers/orderbook/DepositAuthorized.h>
17#include <xrpld/rpc/handlers/orderbook/NFTBuyOffers.h>
18#include <xrpld/rpc/handlers/orderbook/NFTSellOffers.h>
19#include <xrpld/rpc/handlers/server_info/Version.h>
20#include <xrpld/rpc/handlers/transaction/TransactionEntry.h>
21
22#include <xrpl/basics/StringUtilities.h>
23#include <xrpl/beast/utility/instrumentation.h>
24#include <xrpl/json/json_value.h>
25#include <xrpl/protocol/ApiVersion.h>
26
27#include <rpcspec/Errors.hpp>
28#include <rpcspec/Types.hpp>
29
30#include <algorithm>
31#include <array>
32#include <concepts>
33#include <cstddef>
34#include <expected>
35#include <span>
36#include <string_view>
37#include <utility>
38
39namespace xrpl::rpc {
40namespace {
41
42// Shorthand: the tables below name this type once per entry.
43using Method = Handler::Method;
44
51template <auto Function>
52::rpc::Status
53byRef(JsonContext& context, json::Value& result)
54{
55 result = Function(context);
56 if (result.type() != json::ValueType::Object)
57 {
58 // LCOV_EXCL_START
59 UNREACHABLE("xrpl::rpc::byRef : result is object");
60 result = rpc::makeObjectValue(result);
61 // LCOV_EXCL_STOP
62 }
63
64 return ::rpc::Status::kOK;
65}
66
67template <typename HandlerImpl>
68concept SpecBasedHandler = std::derived_from<HandlerImpl, HandlerFor<typename HandlerImpl::Input>>;
69
70template <typename HandlerImpl>
71concept InputlessHandler = requires(HandlerImpl& handler) { handler.process(); };
72
73template <class HandlerImpl, class Output>
74::rpc::Status
75respond(
76 HandlerImpl const& handler,
77 json::Value& object,
78 std::expected<Output, ::rpc::Status> const& output,
79 ::rpc::spec::Warnings const& warnings)
80{
81 if (not output.has_value())
82 {
83 injectSpecError(object, output.error());
84 return output.error();
85 }
86
87 json::Value result;
88 handler.writeResult(result, *output);
89 injectSpecWarnings(result, warnings);
90 object = std::move(result);
91
92 return ::rpc::Status::kOK;
93}
94
95template <class HandlerImpl>
96::rpc::Status
97handle(JsonContext& context, json::Value& object)
98 requires SpecBasedHandler<HandlerImpl> or InputlessHandler<HandlerImpl>
99{
100 if constexpr (SpecBasedHandler<HandlerImpl>)
101 {
102 auto const input = HandlerImpl::parseInput(context.params, context.apiVersion);
103 if (not input.has_value())
104 {
105 injectSpecError(object, input.error());
106 return input.error();
107 }
108
109 HandlerImpl handler(context);
110 auto const output = handler.process(*input);
111 auto const warnings = output.has_value()
112 ? HandlerImpl::spec(context.apiVersion).check(context.params)
113 : ::rpc::spec::Warnings{};
114 return respond(handler, object, output, warnings);
115 }
116 else
117 {
118 HandlerImpl handler(context);
119 return respond(handler, object, handler.process(), /* warnings= */ {});
120 }
121}
122
123constexpr auto kHandlerArray = std::to_array<Handler>({
124 // Request-response methods
125 {
126 .name = method::kAccountInfo,
127 .valueMethod = Method::of<&handle<AccountInfoHandler>>(),
128 .role = Role::USER,
129 .condition = Condition::NoCondition,
130 },
131 {
133 .valueMethod = Method::of<&handle<AccountCurrenciesHandler>>(),
134 .role = Role::USER,
135 .condition = Condition::NoCondition,
136 },
137 {
138 .name = method::kAccountLines,
139 .valueMethod = Method::of<&handle<AccountLinesHandler>>(),
140 .role = Role::USER,
141 .condition = Condition::NoCondition,
142 },
143 {
145 .valueMethod = Method::of<&handle<AccountChannelsHandler>>(),
146 .role = Role::USER,
147 .condition = Condition::NoCondition,
148 },
149 {
150 .name = method::kAccountNfts,
151 .valueMethod = Method::of<&handle<AccountNFTsHandler>>(),
152 .role = Role::USER,
153 .condition = Condition::NoCondition,
154 },
155 {
157 .valueMethod = Method::of<&byRef<&doAccountObjects>>(),
158 .role = Role::USER,
159 .condition = Condition::NoCondition,
160 },
161 {
163 .valueMethod = Method::of<&handle<AccountOffersHandler>>(),
164 .role = Role::USER,
165 .condition = Condition::NoCondition,
166 },
167 {
168 .name = method::kAccountTx,
169 .valueMethod = Method::of<&byRef<&doAccountTx>>(),
170 .role = Role::USER,
171 .condition = Condition::NoCondition,
172 },
173 {
174 .name = method::kAmmInfo,
175 .valueMethod = Method::of<&byRef<&doAMMInfo>>(),
176 .role = Role::USER,
177 .condition = Condition::NoCondition,
178 },
179 {
180 .name = method::kBlacklist,
181 .valueMethod = Method::of<&byRef<&doBlackList>>(),
182 .role = Role::ADMIN,
183 .condition = Condition::NoCondition,
184 .hasCommandLineForm = false,
185 },
186 {
187 .name = method::kBookChanges,
188 .valueMethod = Method::of<&handle<BookChangesHandler>>(),
189 .role = Role::USER,
190 .condition = Condition::NoCondition,
191 },
192 {
193 .name = method::kBookOffers,
194 .valueMethod = Method::of<&byRef<&doBookOffers>>(),
195 .role = Role::USER,
196 .condition = Condition::NoCondition,
197 },
198 {
199 .name = method::kCanDelete,
200 .valueMethod = Method::of<&byRef<&doCanDelete>>(),
201 .role = Role::ADMIN,
202 .condition = Condition::NoCondition,
203 },
204 {
206 .valueMethod = Method::of<&byRef<&doChannelAuthorize>>(),
207 .role = Role::USER,
208 .condition = Condition::NoCondition,
209 },
210 {
212 .valueMethod = Method::of<&byRef<&doChannelVerify>>(),
213 .role = Role::USER,
214 .condition = Condition::NoCondition,
215 },
216 {
217 .name = method::kConnect,
218 .valueMethod = Method::of<&byRef<&doConnect>>(),
219 .role = Role::ADMIN,
220 .condition = Condition::NoCondition,
221 },
222 {
224 .valueMethod = Method::of<&byRef<&doConsensusInfo>>(),
225 .role = Role::ADMIN,
226 .condition = Condition::NoCondition,
227 },
228 {
230 .valueMethod = Method::of<&handle<DepositAuthorizedHandler>>(),
231 .role = Role::USER,
232 .condition = Condition::NoCondition,
233 },
234 {
235 .name = method::kFeature,
236 .valueMethod = Method::of<&byRef<&doFeature>>(),
237 .role = Role::USER,
238 .condition = Condition::NoCondition,
239 },
240 {
241 .name = method::kFee,
242 .valueMethod = Method::of<&byRef<&doFee>>(),
243 .role = Role::USER,
245 .hasCommandLineForm = false,
246 },
247 {
248 .name = method::kFetchInfo,
249 .valueMethod = Method::of<&byRef<&doFetchInfo>>(),
250 .role = Role::ADMIN,
251 .condition = Condition::NoCondition,
252 },
253 {
255 .valueMethod = Method::of<&byRef<&doGatewayBalances>>(),
256 .role = Role::USER,
257 .condition = Condition::NoCondition,
258 },
259 {
260 .name = method::kGetCounts,
261 .valueMethod = Method::of<&byRef<&doGetCounts>>(),
262 .role = Role::ADMIN,
263 .condition = Condition::NoCondition,
264 },
265 {
267 .valueMethod = Method::of<&byRef<&doGetAggregatePrice>>(),
268 .role = Role::USER,
269 .condition = Condition::NoCondition,
270 .hasCommandLineForm = false,
271 },
272 {
273 .name = method::kLedger,
274 .valueMethod = Method::of<&handle<LedgerHandler>>(),
275 .role = Role::USER,
276 .condition = Condition::NoCondition,
277 },
278 {
279 .name = method::kLedgerAccept,
280 .valueMethod = Method::of<&byRef<&doLedgerAccept>>(),
281 .role = Role::ADMIN,
283 },
284 {
286 .valueMethod = Method::of<&byRef<&doLedgerCleaner>>(),
287 .role = Role::ADMIN,
289 .hasCommandLineForm = false,
290 },
291 {
292 .name = method::kLedgerClosed,
293 .valueMethod = Method::of<&byRef<&doLedgerClosed>>(),
294 .role = Role::USER,
295 .condition = Condition::NeedsClosedLedger,
296 },
297 {
299 .valueMethod = Method::of<&byRef<&doLedgerCurrent>>(),
300 .role = Role::USER,
302 },
303 {
304 .name = method::kLedgerData,
305 .valueMethod = Method::of<&byRef<&doLedgerData>>(),
306 .role = Role::USER,
307 .condition = Condition::NoCondition,
308 .hasCommandLineForm = false,
309 },
310 {
311 .name = method::kLedgerEntry,
312 .valueMethod = Method::of<&byRef<&doLedgerEntry>>(),
313 .role = Role::USER,
314 .condition = Condition::NoCondition,
315 },
316 {
317 .name = method::kLedgerHeader,
318 .valueMethod = Method::of<&byRef<&doLedgerHeader>>(),
319 .role = Role::USER,
320 .condition = Condition::NoCondition,
321 .minApiVer = 1,
322 .maxApiVer = 1,
323 },
324 {
326 .valueMethod = Method::of<&byRef<&doLedgerRequest>>(),
327 .role = Role::ADMIN,
328 .condition = Condition::NoCondition,
329 },
330 {
331 .name = method::kLogLevel,
332 .valueMethod = Method::of<&byRef<&doLogLevel>>(),
333 .role = Role::ADMIN,
334 .condition = Condition::NoCondition,
335 },
336 {
337 .name = method::kLogrotate,
338 .valueMethod = Method::of<&byRef<&doLogRotate>>(),
339 .role = Role::ADMIN,
340 .condition = Condition::NoCondition,
341 },
342 {
343 .name = method::kManifest,
344 .valueMethod = Method::of<&byRef<&doManifest>>(),
345 .role = Role::USER,
346 .condition = Condition::NoCondition,
347 },
348 {
349 .name = method::kNftBuyOffers,
350 .valueMethod = Method::of<&handle<NFTBuyOffersHandler>>(),
351 .role = Role::USER,
352 .condition = Condition::NoCondition,
353 .hasCommandLineForm = false,
354 },
355 {
357 .valueMethod = Method::of<&handle<NFTSellOffersHandler>>(),
358 .role = Role::USER,
359 .condition = Condition::NoCondition,
360 .hasCommandLineForm = false,
361 },
362 {
364 .valueMethod = Method::of<&byRef<&doNoRippleCheck>>(),
365 .role = Role::USER,
366 .condition = Condition::NoCondition,
367 .hasCommandLineForm = false,
368 },
369 {
370 .name = method::kOwnerInfo,
371 .valueMethod = Method::of<&byRef<&doOwnerInfo>>(),
372 .role = Role::USER,
374 },
375 {
376 .name = method::kPeers,
377 .valueMethod = Method::of<&byRef<&doPeers>>(),
378 .role = Role::ADMIN,
379 .condition = Condition::NoCondition,
380 },
381 {
382 .name = method::kPathFind,
383 .valueMethod = Method::of<&byRef<&doPathFind>>(),
384 .role = Role::USER,
386 },
387 {
388 .name = method::kPing,
389 .valueMethod = Method::of<&byRef<&doPing>>(),
390 .role = Role::USER,
391 .condition = Condition::NoCondition,
392 },
393 {
394 .name = method::kPrint,
395 .valueMethod = Method::of<&byRef<&doPrint>>(),
396 .role = Role::ADMIN,
397 .condition = Condition::NoCondition,
398 },
399 {
400 .name = method::kRandom,
401 .valueMethod = Method::of<&byRef<&doRandom>>(),
402 .role = Role::USER,
403 .condition = Condition::NoCondition,
404 },
405 {
407 .valueMethod = Method::of<&byRef<&doPeerReservationsAdd>>(),
408 .role = Role::ADMIN,
409 .condition = Condition::NoCondition,
410 },
411 {
413 .valueMethod = Method::of<&byRef<&doPeerReservationsDel>>(),
414 .role = Role::ADMIN,
415 .condition = Condition::NoCondition,
416 },
417 {
419 .valueMethod = Method::of<&byRef<&doPeerReservationsList>>(),
420 .role = Role::ADMIN,
421 .condition = Condition::NoCondition,
422 },
423 {
425 .valueMethod = Method::of<&byRef<&doRipplePathFind>>(),
426 .role = Role::USER,
427 .condition = Condition::NoCondition,
428 },
429 {
431 .valueMethod = Method::of<&byRef<&doServerDefinitions>>(),
432 .role = Role::USER,
433 .condition = Condition::NoCondition,
434 },
435 {
436 .name = method::kServerInfo,
437 .valueMethod = Method::of<&byRef<&doServerInfo>>(),
438 .role = Role::USER,
439 .condition = Condition::NoCondition,
440 },
441 {
442 .name = method::kServerState,
443 .valueMethod = Method::of<&byRef<&doServerState>>(),
444 .role = Role::USER,
445 .condition = Condition::NoCondition,
446 },
447 {
448 .name = method::kSign,
449 .valueMethod = Method::of<&byRef<&doSign>>(),
450 .role = Role::USER,
451 .condition = Condition::NoCondition,
452 },
453 {
454 .name = method::kSignFor,
455 .valueMethod = Method::of<&byRef<&doSignFor>>(),
456 .role = Role::USER,
457 .condition = Condition::NoCondition,
458 },
459 {
460 .name = method::kSimulate,
461 .valueMethod = Method::of<&byRef<&doSimulate>>(),
462 .role = Role::USER,
464 },
465 {
466 .name = method::kStop,
467 .valueMethod = Method::of<&byRef<&doStop>>(),
468 .role = Role::ADMIN,
469 .condition = Condition::NoCondition,
470 },
471 {
472 .name = method::kSubmit,
473 .valueMethod = Method::of<&byRef<&doSubmit>>(),
474 .role = Role::USER,
476 },
477 {
479 .valueMethod = Method::of<&byRef<&doSubmitMultiSigned>>(),
480 .role = Role::USER,
482 },
483 {
485 .valueMethod = Method::of<&handle<TransactionEntryHandler>>(),
486 .role = Role::USER,
487 .condition = Condition::NoCondition,
488 },
489 {
490 .name = method::kTx,
491 .valueMethod = Method::of<&byRef<&doTxJson>>(),
492 .role = Role::USER,
494 },
495 {
496 .name = method::kTxHistory,
497 .valueMethod = Method::of<&byRef<&doTxHistory>>(),
498 .role = Role::USER,
499 .condition = Condition::NoCondition,
500 .minApiVer = 1,
501 .maxApiVer = 1,
502 },
503 {
505 .valueMethod = Method::of<&byRef<&doTxReduceRelay>>(),
506 .role = Role::USER,
507 .condition = Condition::NoCondition,
508 .hasCommandLineForm = false,
509 },
510 {
511 .name = method::kUnlList,
512 .valueMethod = Method::of<&byRef<&doUnlList>>(),
513 .role = Role::ADMIN,
514 .condition = Condition::NoCondition,
515 },
516 {
518 .valueMethod = Method::of<&byRef<&doValidationCreate>>(),
519 .role = Role::ADMIN,
520 .condition = Condition::NoCondition,
521 },
522 {
523 .name = method::kValidators,
524 .valueMethod = Method::of<&byRef<&doValidators>>(),
525 .role = Role::ADMIN,
526 .condition = Condition::NoCondition,
527 .hasCommandLineForm = false,
528 },
529 {
531 .valueMethod = Method::of<&byRef<&doValidatorListSites>>(),
532 .role = Role::ADMIN,
533 .condition = Condition::NoCondition,
534 .hasCommandLineForm = false,
535 },
536 {
538 .valueMethod = Method::of<&byRef<&doValidatorInfo>>(),
539 .role = Role::ADMIN,
540 .condition = Condition::NoCondition,
541 },
542 {
543 .name = method::kVaultInfo,
544 .valueMethod = Method::of<&byRef<&doVaultInfo>>(),
545 .role = Role::USER,
546 .condition = Condition::NoCondition,
547 },
548 {
549 .name = method::kVersion,
550 .valueMethod = Method::of<&handle<VersionHandler>>(),
551 .role = Role::USER,
552 .condition = Condition::NoCondition,
553 },
554 {
556 .valueMethod = Method::of<&byRef<&doWalletPropose>>(),
557 .role = Role::ADMIN,
558 .condition = Condition::NoCondition,
559 },
560 // Event methods
561 {
562 .name = method::kSubscribe,
563 .valueMethod = Method::of<&byRef<&doSubscribe>>(),
564 .role = Role::USER,
565 .condition = Condition::NoCondition,
566 },
567 {
568 .name = method::kUnsubscribe,
569 .valueMethod = Method::of<&byRef<&doUnsubscribe>>(),
570 .role = Role::USER,
571 .condition = Condition::NoCondition,
572 },
573});
574
575// The whole dispatch table.
576constexpr auto kHandlers = [] {
577 auto all = kHandlerArray;
578
579 // Sorted by name, so a handler can be found by binary search.
581 return all;
582}();
583
584// getHandler() relies on this being sorted to binary search it, and
585// kHandlerNames below inherits the order.
586static_assert(
587 std::ranges::is_sorted(kHandlers, {}, &Handler::name),
588 "xrpl::rpc : kHandlers must be sorted by name");
589
590// A name must select exactly one handler, otherwise a request would have two
591// answers. Where a method's behaviour differs by API version, the handler
592// branches on context.apiVersion rather than being registered once per range.
593// Checked here, at compile time, rather than on the first dispatch.
594//
595// The method is not checked: Handler::Method has no default constructor, so an
596// entry that omits it does not compile.
597static_assert(
598 [] {
599 for (std::size_t i = 0; i < kHandlers.size(); ++i)
600 {
601 auto const& h = kHandlers[i];
602 if (h.name.empty() || h.minApiVer > h.maxApiVer ||
603 h.maxApiVer > rpc::kApiMaximumValidVersion ||
605 return false;
606
607 // Sorted, so a repeat can only be of the preceding entry.
608 if (i > 0 && kHandlers[i - 1].name == h.name)
609 return false;
610 }
611 return true;
612 }(),
613 "xrpl::rpc : every handler needs a unique name and a valid API version range");
614
625template <std::size_t... I>
626consteval auto
627checkedHandlerNames(std::index_sequence<I...>)
628{
629 return std::array<NullTerminatedView, sizeof...(I)>{NullTerminatedView{kHandlers[I].name}...};
630}
631
632// The handler names, which are already distinct and sorted.
633constexpr auto kHandlerNames = checkedHandlerNames(std::make_index_sequence<kHandlers.size()>{});
634
635} // namespace
636
637Handler const*
638getHandler(unsigned version, bool betaEnabled, std::string_view name)
639{
640 if (version < rpc::kApiMinimumSupportedVersion ||
641 version > (betaEnabled ? rpc::kApiBetaVersion : rpc::kApiMaximumSupportedVersion))
642 return nullptr;
643
644 // Names are unique, so the binary search finds the only candidate; it then
645 // answers this request only if it serves this version.
646 auto const i = std::ranges::lower_bound(kHandlers, name, {}, &Handler::name);
647 if (i == kHandlers.end() || i->name != name)
648 return nullptr;
649
650 if (i->minApiVer <= version && version <= i->maxApiVer)
651 return &*i;
652
653 return nullptr;
654}
655
658{
659 return kHandlerNames;
660}
661
662} // namespace xrpl::rpc
Represents a JSON value.
Definition json_value.h:121
ValueType type() const
The function a handler dispatches to.
Definition Handler.h:49
T is_sorted(T... args)
T lower_bound(T... args)
@ Object
object value (collection of name/value pairs).
Definition json_value.h:33
constexpr std::string_view kAccountNfts
Definition MethodNames.h:23
constexpr std::string_view kPing
Definition MethodNames.h:67
constexpr std::string_view kAccountLines
Definition MethodNames.h:22
constexpr std::string_view kBookOffers
Definition MethodNames.h:30
constexpr std::string_view kNftSellOffers
Definition MethodNames.h:59
constexpr std::string_view kAccountOffers
Definition MethodNames.h:25
constexpr std::string_view kNorippleCheck
Definition MethodNames.h:60
constexpr std::string_view kConnect
Definition MethodNames.h:34
constexpr std::string_view kRipplePathFind
Definition MethodNames.h:70
constexpr std::string_view kAccountCurrencies
Definition MethodNames.h:20
constexpr std::string_view kLedgerCurrent
Definition MethodNames.h:50
constexpr std::string_view kPeerReservationsAdd
Definition MethodNames.h:63
constexpr std::string_view kChannelAuthorize
Definition MethodNames.h:32
constexpr std::string_view kAccountChannels
Names of the RPC methods the server accepts.
Definition MethodNames.h:19
constexpr std::string_view kPeerReservationsDel
Definition MethodNames.h:64
constexpr std::string_view kLogLevel
Definition MethodNames.h:55
constexpr std::string_view kSubmitMultisigned
Definition MethodNames.h:79
constexpr std::string_view kWalletPropose
Definition MethodNames.h:93
constexpr std::string_view kLedgerAccept
Definition MethodNames.h:47
constexpr std::string_view kLedger
Definition MethodNames.h:46
constexpr std::string_view kAccountTx
Definition MethodNames.h:26
constexpr std::string_view kBookChanges
Definition MethodNames.h:29
constexpr std::string_view kValidationCreate
Definition MethodNames.h:87
constexpr std::string_view kConsensusInfo
Definition MethodNames.h:35
constexpr std::string_view kOwnerInfo
Definition MethodNames.h:61
constexpr std::string_view kDepositAuthorized
Definition MethodNames.h:36
constexpr std::string_view kServerDefinitions
Definition MethodNames.h:71
constexpr std::string_view kTxReduceRelay
Definition MethodNames.h:84
constexpr std::string_view kAmmInfo
Definition MethodNames.h:27
constexpr std::string_view kCanDelete
Definition MethodNames.h:31
constexpr std::string_view kFee
Definition MethodNames.h:38
constexpr std::string_view kLogrotate
Definition MethodNames.h:56
constexpr std::string_view kLedgerData
Definition MethodNames.h:51
constexpr std::string_view kLedgerEntry
Definition MethodNames.h:52
constexpr std::string_view kChannelVerify
Definition MethodNames.h:33
constexpr std::string_view kPeers
Definition MethodNames.h:66
constexpr std::string_view kSign
Definition MethodNames.h:74
constexpr std::string_view kGetCounts
Definition MethodNames.h:42
constexpr std::string_view kValidatorListSites
Definition MethodNames.h:89
constexpr std::string_view kVersion
Definition MethodNames.h:92
constexpr std::string_view kPathFind
Definition MethodNames.h:62
constexpr std::string_view kServerInfo
Definition MethodNames.h:72
constexpr std::string_view kAccountObjects
Definition MethodNames.h:24
constexpr std::string_view kManifest
Definition MethodNames.h:57
constexpr std::string_view kLedgerHeader
Definition MethodNames.h:53
constexpr std::string_view kNftBuyOffers
Definition MethodNames.h:58
constexpr std::string_view kSubmit
Definition MethodNames.h:78
constexpr std::string_view kStop
Definition MethodNames.h:77
constexpr std::string_view kValidators
Definition MethodNames.h:90
constexpr std::string_view kLedgerClosed
Definition MethodNames.h:49
constexpr std::string_view kFetchInfo
Definition MethodNames.h:39
constexpr std::string_view kTxHistory
Definition MethodNames.h:83
constexpr std::string_view kSubscribe
Definition MethodNames.h:80
constexpr std::string_view kValidatorInfo
Definition MethodNames.h:88
constexpr std::string_view kTx
Definition MethodNames.h:82
constexpr std::string_view kPrint
Definition MethodNames.h:68
constexpr std::string_view kGetAggregatePrice
Definition MethodNames.h:41
constexpr std::string_view kTransactionEntry
Definition MethodNames.h:81
constexpr std::string_view kVaultInfo
Definition MethodNames.h:91
constexpr std::string_view kSimulate
Definition MethodNames.h:76
constexpr std::string_view kSignFor
Definition MethodNames.h:75
constexpr std::string_view kBlacklist
Definition MethodNames.h:28
constexpr std::string_view kPeerReservationsList
Definition MethodNames.h:65
constexpr std::string_view kFeature
Definition MethodNames.h:37
constexpr std::string_view kLedgerRequest
Definition MethodNames.h:54
constexpr std::string_view kUnlList
Definition MethodNames.h:85
constexpr std::string_view kLedgerCleaner
Definition MethodNames.h:48
constexpr std::string_view kRandom
Definition MethodNames.h:69
constexpr std::string_view kServerState
Definition MethodNames.h:73
constexpr std::string_view kAccountInfo
Definition MethodNames.h:21
constexpr std::string_view kUnsubscribe
Definition MethodNames.h:86
constexpr std::string_view kGatewayBalances
Definition MethodNames.h:40
The api_version numbers this server serves.
Definition ApiVersion.h:26
std::span< NullTerminatedView const > getHandlerNames()
Return the names of all methods, sorted and without duplicates.
Definition Handler.cpp:657
static constexpr auto kApiMaximumSupportedVersion
Definition ApiVersion.h:33
json::Value makeObjectValue(Value const &value, json::StaticString const &field=jss::message)
Return a json::ValueType::Object with a single entry.
Definition Handler.h:121
Handler const * getHandler(unsigned version, bool betaEnabled, std::string_view name)
Definition Handler.cpp:638
static constexpr auto kApiMaximumValidVersion
Definition ApiVersion.h:37
static constexpr auto kApiMinimumSupportedVersion
Definition ApiVersion.h:32
static constexpr auto kApiBetaVersion
Definition ApiVersion.h:36
@ USER
Definition Role.h:27
@ ADMIN
Definition Role.h:27
T sort(T... args)
std::string_view name
Definition Handler.h:87