Skip to content

Commit

Permalink
Add nftoken_id, nftoken_ids, offer_id to meta for transaction stream
Browse files Browse the repository at this point in the history
  • Loading branch information
tequdev committed Dec 20, 2024
1 parent ea1fffe commit efda362
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions include/xrpl/protocol/NFTSyntheticSerializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

namespace ripple {

namespace RPC {

/**
Adds common synthetic fields to transaction-related JSON responses
Expand All @@ -40,6 +42,7 @@ insertNFTSyntheticInJson(
TxMeta const&);
/** @} */

} // namespace RPC
} // namespace ripple

#endif
2 changes: 2 additions & 0 deletions src/libxrpl/protocol/NFTSyntheticSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <xrpl/protocol/jss.h>

namespace ripple {
namespace RPC {

void
insertNFTSyntheticInJson(
Expand All @@ -34,4 +35,5 @@ insertNFTSyntheticInJson(
insertNFTokenOfferID(response[jss::meta], transaction, transactionMeta);
}

} // namespace RPC
} // namespace ripple
3 changes: 3 additions & 0 deletions src/xrpld/app/misc/NetworkOPs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
#include <xrpl/protocol/MultiApiJson.h>
#include <xrpl/protocol/RPCErr.h>
#include <xrpl/protocol/STParsedJSON.h>
#include <xrpl/protocol/NFTSyntheticSerializer.h>
#include <xrpl/protocol/jss.h>
#include <xrpl/resource/Fees.h>
#include <xrpl/resource/ResourceManager.h>
Expand Down Expand Up @@ -2986,6 +2987,8 @@ NetworkOPsImp::transJson(
jvObj[jss::meta] = meta->get().getJson(JsonOptions::none);
RPC::insertDeliveredAmount(
jvObj[jss::meta], *ledger, transaction, meta->get());
RPC::insertNFTSyntheticInJson(
jvObj[jss::meta], transaction, meta->get());
RPC::insertMPTokenIssuanceID(
jvObj[jss::meta], transaction, meta->get());
}
Expand Down
2 changes: 1 addition & 1 deletion src/xrpld/rpc/handlers/AccountTx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ populateJsonResponse(
txnMeta->getJson(JsonOptions::include_date);
insertDeliveredAmount(
jvObj[jss::meta], context, txn, *txnMeta);
insertNFTSyntheticInJson(jvObj, sttx, *txnMeta);
RPC::insertNFTSyntheticInJson(jvObj, sttx, *txnMeta);
RPC::insertMPTokenIssuanceID(
jvObj[jss::meta], sttx, *txnMeta);
}
Expand Down
2 changes: 1 addition & 1 deletion src/xrpld/rpc/handlers/Tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ populateJsonResponse(
response[jss::meta] = meta->getJson(JsonOptions::none);
insertDeliveredAmount(
response[jss::meta], context, result.txn, *meta);
insertNFTSyntheticInJson(response, sttx, *meta);
RPC::insertNFTSyntheticInJson(response, sttx, *meta);
RPC::insertMPTokenIssuanceID(response[jss::meta], sttx, *meta);
}
}
Expand Down

0 comments on commit efda362

Please sign in to comment.