Add NFT RPC infrastructure

This commit is contained in:
Devon White
2022-02-24 15:22:14 -06:00
committed by CJ Cobb
parent a72aa73afe
commit 9939f6e6f4
30 changed files with 1095 additions and 734 deletions

View File

@@ -13,7 +13,7 @@ doTransactionEntry(Context const& context)
auto lgrInfo = std::get<ripple::LedgerInfo>(v);
ripple::uint256 hash;
if (!hash.parseHex(getRequiredString(context.params, "tx_hash")))
if (!hash.parseHex(getRequiredString(context.params, JS(tx_hash))))
return Status{Error::rpcINVALID_PARAMS, "malformedTransaction"};
auto dbResponse = context.backend->fetchTransaction(hash, context.yield);
@@ -33,10 +33,10 @@ doTransactionEntry(Context const& context)
"Transaction not found."};
auto [txn, meta] = toExpandedJson(*dbResponse);
response["tx_json"] = std::move(txn);
response["metadata"] = std::move(meta);
response["ledger_index"] = lgrInfo.seq;
response["ledger_hash"] = ripple::strHex(lgrInfo.hash);
response[JS(tx_json)] = std::move(txn);
response[JS(metadata)] = std::move(meta);
response[JS(ledger_index)] = lgrInfo.seq;
response[JS(ledger_hash)] = ripple::strHex(lgrInfo.hash);
return response;
}