rippled
AccountTx.cpp
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2012-2014 Ripple Labs Inc.
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 //==============================================================================
19 
20 #include <ripple/app/ledger/LedgerMaster.h>
21 #include <ripple/app/main/Application.h>
22 #include <ripple/app/misc/NetworkOPs.h>
23 #include <ripple/app/misc/Transaction.h>
24 #include <ripple/json/json_value.h>
25 #include <ripple/ledger/ReadView.h>
26 #include <ripple/net/RPCErr.h>
27 #include <ripple/protocol/ErrorCodes.h>
28 #include <ripple/protocol/UintTypes.h>
29 #include <ripple/protocol/jss.h>
30 #include <ripple/resource/Fees.h>
31 #include <ripple/rpc/Context.h>
32 #include <ripple/rpc/DeliveredAmount.h>
33 #include <ripple/rpc/Role.h>
34 #include <ripple/rpc/impl/GRPCHelpers.h>
35 #include <ripple/rpc/impl/RPCHelpers.h>
36 
37 #include <grpcpp/grpcpp.h>
38 
39 namespace ripple {
40 
41 using LedgerSequence = uint32_t;
42 using LedgerHash = uint256;
44 
46 
48 {
49  uint32_t min;
50  uint32_t max;
51 };
52 
53 using LedgerSpecifier =
55 
57 {
60  bool binary = false;
61  bool forward = false;
62  uint32_t limit = 0;
64 };
65 
69 
71 {
74  uint32_t limit;
76 };
77 
78 // parses args into a ledger specifier, or returns a grpc status object on error
81  org::xrpl::rpc::v1::GetAccountTransactionHistoryRequest const& params)
82 {
83  grpc::Status status;
84  if (params.has_ledger_range())
85  {
86  uint32_t min = params.ledger_range().ledger_index_min();
87  uint32_t max = params.ledger_range().ledger_index_max();
88 
89  // if min is set but not max, need to set max
90  if (min != 0 && max == 0)
91  {
92  max = UINT32_MAX;
93  }
94 
95  return LedgerRange{min, max};
96  }
97  else if (params.has_ledger_specifier())
98  {
99  LedgerSpecifier ledger;
100 
101  auto& specifier = params.ledger_specifier();
102  using LedgerCase = org::xrpl::rpc::v1::LedgerSpecifier::LedgerCase;
103  LedgerCase ledgerCase = specifier.ledger_case();
104 
105  if (ledgerCase == LedgerCase::kShortcut)
106  {
107  using LedgerSpecifier = org::xrpl::rpc::v1::LedgerSpecifier;
108 
109  if (specifier.shortcut() == LedgerSpecifier::SHORTCUT_VALIDATED)
110  ledger = LedgerShortcut::VALIDATED;
111  else if (specifier.shortcut() == LedgerSpecifier::SHORTCUT_CLOSED)
112  ledger = LedgerShortcut::CLOSED;
113  else if (specifier.shortcut() == LedgerSpecifier::SHORTCUT_CURRENT)
114  ledger = LedgerShortcut::CURRENT;
115  else
116  return {};
117  }
118  else if (ledgerCase == LedgerCase::kSequence)
119  {
120  ledger = specifier.sequence();
121  }
122  else if (ledgerCase == LedgerCase::kHash)
123  {
124  if (uint256::size() != specifier.hash().size())
125  {
126  grpc::Status errorStatus{
127  grpc::StatusCode::INVALID_ARGUMENT,
128  "ledger hash malformed"};
129  return errorStatus;
130  }
131  ledger = uint256::fromVoid(specifier.hash().data());
132  }
133  return ledger;
134  }
136 }
137 
138 // parses args into a ledger specifier, or returns a Json object on error
141 {
142  Json::Value response;
143  if (params.isMember(jss::ledger_index_min) ||
144  params.isMember(jss::ledger_index_max))
145  {
146  uint32_t min = params.isMember(jss::ledger_index_min) &&
147  params[jss::ledger_index_min].asInt() >= 0
148  ? params[jss::ledger_index_min].asUInt()
149  : 0;
150  uint32_t max = params.isMember(jss::ledger_index_max) &&
151  params[jss::ledger_index_max].asInt() >= 0
152  ? params[jss::ledger_index_max].asUInt()
153  : UINT32_MAX;
154 
155  return LedgerRange{min, max};
156  }
157  else if (params.isMember(jss::ledger_hash))
158  {
159  auto& hashValue = params[jss::ledger_hash];
160  if (!hashValue.isString())
161  {
162  RPC::Status status{rpcINVALID_PARAMS, "ledgerHashNotString"};
163  status.inject(response);
164  return response;
165  }
166 
167  LedgerHash hash;
168  if (!hash.SetHex(hashValue.asString()))
169  {
170  RPC::Status status{rpcINVALID_PARAMS, "ledgerHashMalformed"};
171  status.inject(response);
172  return response;
173  }
174  return hash;
175  }
176  else if (params.isMember(jss::ledger_index))
177  {
178  LedgerSpecifier ledger;
179  if (params[jss::ledger_index].isNumeric())
180  ledger = params[jss::ledger_index].asInt();
181  else
182  {
183  std::string ledgerStr = params[jss::ledger_index].asString();
184 
185  if (ledgerStr == "current" || ledgerStr.empty())
186  ledger = LedgerShortcut::CURRENT;
187  else if (ledgerStr == "closed")
188  ledger = LedgerShortcut::CLOSED;
189  else if (ledgerStr == "validated")
190  ledger = LedgerShortcut::VALIDATED;
191  else
192  {
193  RPC::Status status{
194  rpcINVALID_PARAMS, "ledger_index string malformed"};
195  status.inject(response);
196  return response;
197  }
198  }
199  return ledger;
200  }
202 }
203 
206  RPC::Context& context,
207  std::optional<LedgerSpecifier> const& ledgerSpecifier)
208 {
209  std::uint32_t uValidatedMin;
210  std::uint32_t uValidatedMax;
211  bool bValidated =
212  context.ledgerMaster.getValidatedRange(uValidatedMin, uValidatedMax);
213 
214  if (!bValidated)
215  {
216  // Don't have a validated ledger range.
217  return rpcLGR_IDXS_INVALID;
218  }
219 
220  std::uint32_t uLedgerMin = uValidatedMin;
221  std::uint32_t uLedgerMax = uValidatedMax;
222  // Does request specify a ledger or ledger range?
223  if (ledgerSpecifier)
224  {
225  auto const status = std::visit(
226  [&](auto const& ls) -> RPC::Status {
227  using T = std::decay_t<decltype(ls)>;
228  if constexpr (std::is_same_v<T, LedgerRange>)
229  {
230  if (ls.min > uValidatedMin)
231  {
232  uLedgerMin = ls.min;
233  }
234  if (ls.max < uValidatedMax)
235  {
236  uLedgerMax = ls.max;
237  }
238  if (uLedgerMax < uLedgerMin)
239  return rpcLGR_IDXS_INVALID;
240  }
241  else
242  {
244  auto const status = getLedger(ledgerView, ls, context);
245  if (!ledgerView)
246  {
247  return status;
248  }
249 
250  bool validated = RPC::isValidated(
251  context.ledgerMaster, *ledgerView, context.app);
252 
253  if (!validated || ledgerView->info().seq > uValidatedMax ||
254  ledgerView->info().seq < uValidatedMin)
255  {
256  return rpcLGR_NOT_VALIDATED;
257  }
258  uLedgerMin = uLedgerMax = ledgerView->info().seq;
259  }
260  return RPC::Status::OK;
261  },
262  *ledgerSpecifier);
263 
264  if (status)
265  return status;
266  }
267  return LedgerRange{uLedgerMin, uLedgerMax};
268 }
269 
272 {
273  AccountTxResult result;
275 
276  auto lgrRange = getLedgerRange(context, args.ledger);
277  if (auto stat = std::get_if<RPC::Status>(&lgrRange))
278  {
279  // An error occurred getting the requested ledger range
280  return {result, *stat};
281  }
282 
283  result.ledgerRange = std::get<LedgerRange>(lgrRange);
284 
285  result.marker = args.marker;
286  if (args.binary)
287  {
288  result.transactions = context.netOps.getTxsAccountB(
289  args.account,
290  result.ledgerRange.min,
291  result.ledgerRange.max,
292  args.forward,
293  result.marker,
294  args.limit,
295  isUnlimited(context.role));
296  }
297  else
298  {
299  result.transactions = context.netOps.getTxsAccount(
300  args.account,
301  result.ledgerRange.min,
302  result.ledgerRange.max,
303  args.forward,
304  result.marker,
305  args.limit,
306  isUnlimited(context.role));
307  }
308 
309  result.limit = args.limit;
310 
311  return {result, rpcSUCCESS};
312 }
313 
314 std::pair<
315  org::xrpl::rpc::v1::GetAccountTransactionHistoryResponse,
316  grpc::Status>
319  AccountTxArgs const& args,
321  org::xrpl::rpc::v1::GetAccountTransactionHistoryRequest> const& context)
322 {
323  org::xrpl::rpc::v1::GetAccountTransactionHistoryResponse response;
324  grpc::Status status = grpc::Status::OK;
325 
326  RPC::Status const& error = res.second;
327  if (error.toErrorCode() != rpcSUCCESS)
328  {
329  if (error.toErrorCode() == rpcLGR_NOT_FOUND)
330  {
331  status = {grpc::StatusCode::NOT_FOUND, error.message()};
332  }
333  else
334  {
335  status = {grpc::StatusCode::INVALID_ARGUMENT, error.message()};
336  }
337  }
338  else
339  {
340  AccountTxResult const& result = res.first;
341 
342  // account_tx always returns validated data
343  response.set_validated(true);
344  response.set_limit(result.limit);
345  response.mutable_account()->set_address(
346  context.params.account().address());
347  response.set_ledger_index_min(result.ledgerRange.min);
348  response.set_ledger_index_max(result.ledgerRange.max);
349 
350  if (auto txnsData = std::get_if<TxnsData>(&result.transactions))
351  {
352  assert(!args.binary);
353  for (auto const& [txn, txnMeta] : *txnsData)
354  {
355  if (txn)
356  {
357  auto txnProto = response.add_transactions();
358 
359  RPC::convert(
360  *txnProto->mutable_transaction(),
361  txn->getSTransaction());
362 
363  // account_tx always returns validated data
364  txnProto->set_validated(true);
365  txnProto->set_ledger_index(txn->getLedger());
366  auto& hash = txn->getID();
367  txnProto->set_hash(hash.data(), hash.size());
368  auto closeTime =
369  context.app.getLedgerMaster().getCloseTimeBySeq(
370  txn->getLedger());
371  if (closeTime)
372  txnProto->mutable_date()->set_value(
373  closeTime->time_since_epoch().count());
374  if (txnMeta)
375  {
376  if (!txnMeta->hasDeliveredAmount())
377  {
378  std::optional<STAmount> amount = getDeliveredAmount(
379  context,
380  txn->getSTransaction(),
381  *txnMeta,
382  txn->getLedger());
383  if (amount)
384  {
385  txnMeta->setDeliveredAmount(*amount);
386  }
387  }
388  RPC::convert(*txnProto->mutable_meta(), txnMeta);
389  }
390  }
391  }
392  }
393  else
394  {
395  assert(args.binary);
396 
397  for (auto const& binaryData :
398  std::get<TxnsDataBinary>(result.transactions))
399  {
400  auto txnProto = response.add_transactions();
401  Blob const& txnBlob = std::get<0>(binaryData);
402  txnProto->set_transaction_binary(
403  txnBlob.data(), txnBlob.size());
404 
405  Blob const& metaBlob = std::get<1>(binaryData);
406  txnProto->set_meta_binary(metaBlob.data(), metaBlob.size());
407 
408  txnProto->set_ledger_index(std::get<2>(binaryData));
409 
410  // account_tx always returns validated data
411  txnProto->set_validated(true);
412 
413  auto closeTime =
414  context.app.getLedgerMaster().getCloseTimeBySeq(
415  std::get<2>(binaryData));
416  if (closeTime)
417  txnProto->mutable_date()->set_value(
418  closeTime->time_since_epoch().count());
419  }
420  }
421 
422  if (result.marker)
423  {
424  response.mutable_marker()->set_ledger_index(
425  result.marker->ledgerSeq);
426  response.mutable_marker()->set_account_sequence(
427  result.marker->txnSeq);
428  }
429  }
430  return {response, status};
431 }
432 
436  AccountTxArgs const& args,
437  RPC::JsonContext const& context)
438 {
439  Json::Value response;
440  RPC::Status const& error = res.second;
441  if (error.toErrorCode() != rpcSUCCESS)
442  {
443  error.inject(response);
444  }
445  else
446  {
447  AccountTxResult const& result = res.first;
448  response[jss::validated] = true;
449  response[jss::limit] = result.limit;
450  response[jss::account] = context.params[jss::account].asString();
451  response[jss::ledger_index_min] = result.ledgerRange.min;
452  response[jss::ledger_index_max] = result.ledgerRange.max;
453 
454  Json::Value& jvTxns = (response[jss::transactions] = Json::arrayValue);
455 
456  if (auto txnsData = std::get_if<TxnsData>(&result.transactions))
457  {
458  assert(!args.binary);
459  for (auto const& [txn, txnMeta] : *txnsData)
460  {
461  if (txn)
462  {
463  Json::Value& jvObj = jvTxns.append(Json::objectValue);
464 
465  jvObj[jss::tx] = txn->getJson(JsonOptions::include_date);
466  if (txnMeta)
467  {
468  jvObj[jss::meta] =
469  txnMeta->getJson(JsonOptions::include_date);
470  jvObj[jss::validated] = true;
471  insertDeliveredAmount(
472  jvObj[jss::meta], context, txn, *txnMeta);
473  }
474  }
475  }
476  }
477  else
478  {
479  assert(args.binary);
480 
481  for (auto const& binaryData :
482  std::get<TxnsDataBinary>(result.transactions))
483  {
484  Json::Value& jvObj = jvTxns.append(Json::objectValue);
485 
486  jvObj[jss::tx_blob] = strHex(std::get<0>(binaryData));
487  jvObj[jss::meta] = strHex(std::get<1>(binaryData));
488  jvObj[jss::ledger_index] = std::get<2>(binaryData);
489  jvObj[jss::validated] = true;
490  }
491  }
492 
493  if (result.marker)
494  {
495  response[jss::marker] = Json::objectValue;
496  response[jss::marker][jss::ledger] = result.marker->ledgerSeq;
497  response[jss::marker][jss::seq] = result.marker->txnSeq;
498  }
499  }
500  return response;
501 }
502 
503 // {
504 // account: account,
505 // ledger_index_min: ledger_index // optional, defaults to earliest
506 // ledger_index_max: ledger_index, // optional, defaults to latest
507 // binary: boolean, // optional, defaults to false
508 // forward: boolean, // optional, defaults to false
509 // limit: integer, // optional
510 // marker: object {ledger: ledger_index, seq: txn_sequence} // optional,
511 // resume previous query
512 // }
515 {
516  auto& params = context.params;
517  AccountTxArgs args;
518  Json::Value response;
519 
520  args.limit = params.isMember(jss::limit) ? params[jss::limit].asUInt() : 0;
521  args.binary = params.isMember(jss::binary) && params[jss::binary].asBool();
522  args.forward =
523  params.isMember(jss::forward) && params[jss::forward].asBool();
524 
525  if (!params.isMember(jss::account))
526  return rpcError(rpcINVALID_PARAMS);
527 
528  auto const account =
529  parseBase58<AccountID>(params[jss::account].asString());
530  if (!account)
531  return rpcError(rpcACT_MALFORMED);
532 
533  args.account = *account;
534 
535  auto parseRes = parseLedgerArgs(params);
536  if (auto jv = std::get_if<Json::Value>(&parseRes))
537  {
538  return *jv;
539  }
540  else
541  {
542  args.ledger = std::get<std::optional<LedgerSpecifier>>(parseRes);
543  }
544 
545  if (params.isMember(jss::marker))
546  {
547  auto& token = params[jss::marker];
548  if (!token.isMember(jss::ledger) || !token.isMember(jss::seq) ||
549  !token[jss::ledger].isConvertibleTo(Json::ValueType::uintValue) ||
550  !token[jss::seq].isConvertibleTo(Json::ValueType::uintValue))
551  {
552  RPC::Status status{
554  "invalid marker. Provide ledger index via ledger field, and "
555  "transaction sequence number via seq field"};
556  status.inject(response);
557  return response;
558  }
559  args.marker = {token[jss::ledger].asUInt(), token[jss::seq].asUInt()};
560  }
561 
562  auto res = doAccountTxHelp(context, args);
563  return populateJsonResponse(res, args, context);
564 }
565 
566 std::pair<
567  org::xrpl::rpc::v1::GetAccountTransactionHistoryResponse,
568  grpc::Status>
571  context)
572 {
573  // return values
574  org::xrpl::rpc::v1::GetAccountTransactionHistoryResponse response;
575  grpc::Status status = grpc::Status::OK;
576  AccountTxArgs args;
577 
578  auto& request = context.params;
579 
580  auto const account = parseBase58<AccountID>(request.account().address());
581  if (!account)
582  {
583  return {
584  {},
585  {grpc::StatusCode::INVALID_ARGUMENT, "Could not decode account"}};
586  }
587 
588  args.account = *account;
589  args.limit = request.limit();
590  args.binary = request.binary();
591  args.forward = request.forward();
592 
593  if (request.has_marker())
594  {
595  args.marker = {
596  request.marker().ledger_index(),
597  request.marker().account_sequence()};
598  }
599 
600  auto parseRes = parseLedgerArgs(request);
601  if (auto stat = std::get_if<grpc::Status>(&parseRes))
602  {
603  return {response, *stat};
604  }
605  else
606  {
607  args.ledger = std::get<std::optional<LedgerSpecifier>>(parseRes);
608  }
609 
610  auto res = doAccountTxHelp(context, args);
611  return populateProtoResponse(res, args, context);
612 }
613 
614 } // namespace ripple
ripple::ReadView::info
virtual LedgerInfo const & info() const =0
Returns information about the ledger.
ripple::LedgerMaster::getValidatedRange
bool getValidatedRange(std::uint32_t &minVal, std::uint32_t &maxVal)
Definition: LedgerMaster.cpp:627
ripple::RPC::Status::OK
static constexpr Code OK
Definition: Status.h:46
ripple::JsonOptions::include_date
@ include_date
ripple::RPC::JsonContext
Definition: Context.h:52
ripple::NetworkOPs::AccountTxs
std::vector< AccountTx > AccountTxs
Definition: NetworkOPs.h:255
ripple::rpcLGR_IDXS_INVALID
@ rpcLGR_IDXS_INVALID
Definition: ErrorCodes.h:112
std::string
STL class.
std::shared_ptr
STL class.
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
ripple::Resource::feeMediumBurdenRPC
const Charge feeMediumBurdenRPC
ripple::NetworkOPs::txnMetaLedgerType
std::tuple< Blob, Blob, std::uint32_t > txnMetaLedgerType
Definition: NetworkOPs.h:277
ripple::AccountTxArgs::binary
bool binary
Definition: AccountTx.cpp:60
Json::arrayValue
@ arrayValue
array value (ordered list)
Definition: json_value.h:42
std::pair
ripple::RPC::LedgerShortcut
LedgerShortcut
Definition: RPCHelpers.h:111
ripple::RPC::Context::loadType
Resource::Charge & loadType
Definition: Context.h:43
ripple::AccountTxResult::marker
std::optional< AccountTxMarker > marker
Definition: AccountTx.cpp:75
std::vector
STL class.
ripple::LedgerSequence
uint32_t LedgerSequence
Definition: AccountTx.cpp:41
std::vector::size
T size(T... args)
ripple::populateProtoResponse
std::pair< org::xrpl::rpc::v1::GetAccountTransactionHistoryResponse, grpc::Status > populateProtoResponse(std::pair< AccountTxResult, RPC::Status > const &res, AccountTxArgs const &args, RPC::GRPCContext< org::xrpl::rpc::v1::GetAccountTransactionHistoryRequest > const &context)
Definition: AccountTx.cpp:317
ripple::AccountTxArgs::marker
std::optional< AccountTxMarker > marker
Definition: AccountTx.cpp:63
ripple::doAccountTxGrpc
std::pair< org::xrpl::rpc::v1::GetAccountTransactionHistoryResponse, grpc::Status > doAccountTxGrpc(RPC::GRPCContext< org::xrpl::rpc::v1::GetAccountTransactionHistoryRequest > &context)
Definition: AccountTx.cpp:569
ripple::RPC::Context::ledgerMaster
LedgerMaster & ledgerMaster
Definition: Context.h:45
ripple::AccountTxArgs::ledger
std::optional< LedgerSpecifier > ledger
Definition: AccountTx.cpp:59
std::tuple
ripple::LedgerInfo::seq
LedgerIndex seq
Definition: ReadView.h:88
ripple::RPC::Context::role
Role role
Definition: Context.h:47
ripple::rpcLGR_NOT_FOUND
@ rpcLGR_NOT_FOUND
Definition: ErrorCodes.h:72
ripple::AccountTxResult::ledgerRange
LedgerRange ledgerRange
Definition: AccountTx.cpp:73
ripple::base_uint< 256 >::size
constexpr static std::size_t size()
Definition: base_uint.h:462
ripple::doAccountTxHelp
std::pair< AccountTxResult, RPC::Status > doAccountTxHelp(RPC::Context &context, AccountTxArgs const &args)
Definition: AccountTx.cpp:271
ripple::uint256
base_uint< 256 > uint256
Definition: base_uint.h:493
ripple::getLedgerRange
std::variant< LedgerRange, RPC::Status > getLedgerRange(RPC::Context &context, std::optional< LedgerSpecifier > const &ledgerSpecifier)
Definition: AccountTx.cpp:205
ripple::AccountTxResult::limit
uint32_t limit
Definition: AccountTx.cpp:74
ripple::base_uint< 256 >
ripple::RPC::convert
void convert(org::xrpl::rpc::v1::TransactionResult &to, TER from)
Definition: GRPCHelpers.cpp:897
ripple::rpcSUCCESS
@ rpcSUCCESS
Definition: ErrorCodes.h:44
Json::Value::append
Value & append(const Value &value)
Append value to array at the end.
Definition: json_value.cpp:882
ripple::NetworkOPs::MetaTxsList
std::vector< txnMetaLedgerType > MetaTxsList
Definition: NetworkOPs.h:278
Json::objectValue
@ objectValue
object value (collection of name/value pairs).
Definition: json_value.h:43
ripple::RPC::GRPCContext
Definition: Context.h:70
ripple::base_uint::SetHex
bool SetHex(const char *psz, bool bStrict=false)
Parse a hex string into a base_uint The input can be:
Definition: base_uint.h:406
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
ripple::NetworkOPs::getTxsAccount
virtual AccountTxs getTxsAccount(AccountID const &account, std::int32_t minLedger, std::int32_t maxLedger, bool forward, std::optional< AccountTxMarker > &marker, int limit, bool bUnlimited)=0
Json::Value::isMember
bool isMember(const char *key) const
Return true if the object has a member named key.
Definition: json_value.cpp:932
ripple::AccountTxArgs
Definition: AccountTx.cpp:56
std::uint32_t
ripple::rpcError
Json::Value rpcError(int iError, Json::Value jvResult)
Definition: RPCErr.cpp:29
ripple::NetworkOPs::AccountTxMarker
Definition: NetworkOPs.h:247
ripple::RPC::Status
Status represents the results of an operation that might fail.
Definition: Status.h:39
ripple::RPC::Context::netOps
NetworkOPs & netOps
Definition: Context.h:44
std::decay_t
ripple::isUnlimited
bool isUnlimited(Role const &role)
ADMIN and IDENTIFIED roles shall have unlimited resources.
Definition: Role.cpp:94
ripple::AccountTxResult
Definition: AccountTx.cpp:70
ripple::RPC::GRPCContext::params
RequestType params
Definition: Context.h:72
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::AccountTxArgs::limit
uint32_t limit
Definition: AccountTx.cpp:62
ripple::populateJsonResponse
Json::Value populateJsonResponse(std::pair< AccountTxResult, RPC::Status > const &res, AccountTxArgs const &args, RPC::JsonContext const &context)
Definition: AccountTx.cpp:434
ripple::RPC::isValidated
bool isValidated(LedgerMaster &ledgerMaster, ReadView const &ledger, Application &app)
Definition: RPCHelpers.cpp:414
ripple::rpcACT_MALFORMED
@ rpcACT_MALFORMED
Definition: ErrorCodes.h:90
ripple::AccountTxArgs::account
AccountID account
Definition: AccountTx.cpp:58
ripple::rpcLGR_NOT_VALIDATED
@ rpcLGR_NOT_VALIDATED
Definition: ErrorCodes.h:73
ripple::doAccountTxJson
Json::Value doAccountTxJson(RPC::JsonContext &context)
Definition: AccountTx.cpp:514
ripple::base_uint< 256 >::fromVoid
static base_uint fromVoid(void const *data)
Definition: base_uint.h:213
Json::Value::asUInt
UInt asUInt() const
Definition: json_value.cpp:545
ripple::LedgerRange::max
uint32_t max
Definition: AccountTx.cpp:50
std::visit
T visit(T... args)
std::string::empty
T empty(T... args)
ripple::parseLedgerArgs
std::variant< std::optional< LedgerSpecifier >, grpc::Status > parseLedgerArgs(org::xrpl::rpc::v1::GetAccountTransactionHistoryRequest const &params)
Definition: AccountTx.cpp:80
std::optional
Json::Value::asInt
Int asInt() const
Definition: json_value.cpp:503
ripple::AccountTxArgs::forward
bool forward
Definition: AccountTx.cpp:61
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:67
ripple::LedgerRange
Definition: AccountTx.cpp:47
ripple::LedgerRange::min
uint32_t min
Definition: AccountTx.cpp:49
ripple::RPC::JsonContext::params
Json::Value params
Definition: Context.h:63
ripple::NetworkOPs::getTxsAccountB
virtual MetaTxsList getTxsAccountB(AccountID const &account, std::int32_t minLedger, std::int32_t maxLedger, bool forward, std::optional< AccountTxMarker > &marker, int limit, bool bUnlimited)=0
std::vector::data
T data(T... args)
ripple::RPC::Context
The context of information needed to call an RPC.
Definition: Context.h:39
Json::Value
Represents a JSON value.
Definition: json_value.h:145
ripple::AccountTxResult::transactions
std::variant< TxnsData, TxnsDataBinary > transactions
Definition: AccountTx.cpp:72
std::variant
Json::Value::asString
std::string asString() const
Returns the unquoted string value.
Definition: json_value.cpp:469