20#include <xrpld/app/ledger/LedgerMaster.h> 
   21#include <xrpld/app/ledger/TransactionMaster.h> 
   22#include <xrpld/app/misc/DeliverMax.h> 
   23#include <xrpld/app/misc/NetworkOPs.h> 
   24#include <xrpld/app/misc/Transaction.h> 
   25#include <xrpld/app/rdb/RelationalDatabase.h> 
   26#include <xrpld/rpc/CTID.h> 
   27#include <xrpld/rpc/Context.h> 
   28#include <xrpld/rpc/DeliveredAmount.h> 
   29#include <xrpld/rpc/GRPCHandlers.h> 
   30#include <xrpld/rpc/MPTokenIssuanceID.h> 
   32#include <xrpl/basics/ToString.h> 
   33#include <xrpl/protocol/ErrorCodes.h> 
   34#include <xrpl/protocol/NFTSyntheticSerializer.h> 
   35#include <xrpl/protocol/RPCErr.h> 
   36#include <xrpl/protocol/jss.h> 
   82        constexpr uint16_t MAX_RANGE = 1000;
 
  105            args.
ctid->first, args.
ctid->second);
 
  143    if (txn->getLedger() == 0)
 
  151    if (ledger && !ledger->open())
 
  158            result.
meta = meta->getAsObject().getSerializer().getData();
 
  165            context.
ledgerMaster, ledger->info().seq, ledger->info().hash);
 
  171        if (meta->getAsObject().isFieldPresent(sfTransactionIndex))
 
  173            uint32_t lgrSeq = ledger->info().seq;
 
  175                meta->getAsObject().getFieldU32(sfTransactionIndex);
 
  178            if (txnIdx <= 0xFFFFU && netID < 0xFFFFU && lgrSeq < 0x0FFF'FFFFUL)
 
 
  203            response[jss::searched_all] =
 
  205            error.inject(response);
 
  209            error.inject(response);
 
  218            constexpr auto optionsJson =
 
  221                response[jss::tx_blob] = result.
txn->
getJson(optionsJson, 
true);
 
  224                response[jss::tx_json] = result.
txn->
getJson(optionsJson);
 
  226                    response[jss::tx_json],
 
  241                    response[jss::close_time_iso] =
 
  251                    response, sttx->getTxnType(), context.
apiVersion);
 
  258                args.
binary, 
"ripple::populateJsonResponse : binary is set");
 
  260                (context.
apiVersion > 1 ? jss::meta_blob : jss::meta);
 
  270                insertDeliveredAmount(
 
  271                    response[jss::meta], context, result.
txn, *meta);
 
  276        response[jss::validated] = result.
validated;
 
  279            response[jss::ctid] = *(result.
ctid);
 
 
  312        auto const [lgr_seq, txn_idx, net_id] = *ctid;
 
  316            out << 
"Wrong network. You should submit this request to a node " 
  317                   "running on NetworkID: " 
  321        args.
ctid = {lgr_seq, txn_idx};
 
 
std::string asString() const
Returns the unquoted string value.
 
bool isMember(char const *key) const
Return true if the object has a member named key.
 
virtual Config & config()=0
 
virtual LedgerMaster & getLedgerMaster()=0
 
virtual TransactionMaster & getMasterTransaction()=0
 
std::optional< NetClock::time_point > getCloseTimeBySeq(LedgerIndex ledgerIndex)
 
std::optional< uint256 > txnIdFromIndex(uint32_t ledgerSeq, uint32_t txnIndex)
 
std::shared_ptr< Ledger const > getLedgerBySeq(std::uint32_t index)
 
std::variant< std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > >, TxSearched > fetch(uint256 const &, error_code_i &ec)
 
LedgerIndex getLedger() const
 
std::shared_ptr< STTx const > const & getSTransaction()
 
Json::Value getJson(JsonOptions options, bool binary=false) const
 
uint256 const & getID() const
 
constexpr bool parseHex(std::string_view sv)
Parse a hex string into a base_uint.
 
@ objectValue
object value (collection of name/value pairs).
 
std::optional< std::string > encodeCTID(uint32_t ledgerSeq, uint32_t txnIndex, uint32_t networkID) noexcept
Encodes ledger sequence, transaction index, and network ID into a CTID string.
 
Json::Value make_error(error_code_i code)
Returns a new json object that reflects the error code.
 
void insertNFTSyntheticInJson(Json::Value &, std::shared_ptr< STTx const > const &, TxMeta const &)
Adds common synthetic fields to transaction-related JSON responses.
 
void insertMPTokenIssuanceID(Json::Value &response, std::shared_ptr< STTx const > const &transaction, TxMeta const &transactionMeta)
 
void insertDeliverMax(Json::Value &tx_json, TxType txnType, unsigned int apiVersion)
Copy Amount field to DeliverMax field in transaction output JSON.
 
std::optional< std::tuple< uint32_t, uint16_t, uint16_t > > decodeCTID(T const ctid) noexcept
Decodes a CTID string or integer into its component parts.
 
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
 
std::pair< TxResult, RPC::Status > doTxHelp(RPC::Context &context, TxArgs args)
 
Json::Value doTxJson(RPC::JsonContext &)
 
Json::Value rpcError(int iError)
 
boost::icl::closed_interval< T > ClosedInterval
A closed interval over the domain T.
 
std::string strHex(FwdIt begin, FwdIt end)
 
static bool isValidated(LedgerMaster &ledgerMaster, std::uint32_t seq, uint256 const &hash)
 
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
 
std::string to_string_iso(date::sys_time< Duration > tp)
 
Json::Value populateJsonResponse(std::pair< AccountTxResult, RPC::Status > const &res, AccountTxArgs const &args, RPC::JsonContext const &context)
 
std::string to_string(base_uint< Bits, Tag > const &a)
 
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
 
@ ledgerMaster
ledger master data for signing
 
The context of information needed to call an RPC.
 
LedgerMaster & ledgerMaster
 
Status represents the results of an operation that might fail.
 
std::optional< std::pair< uint32_t, uint16_t > > ctid
 
std::optional< uint256 > hash
 
std::optional< std::pair< uint32_t, uint32_t > > ledgerRange
 
std::variant< std::shared_ptr< TxMeta >, Blob > meta
 
std::optional< NetClock::time_point > closeTime
 
std::optional< std::string > ctid
 
std::optional< uint256 > ledgerHash