XRPLF / rippled

Decentralized cryptocurrency blockchain daemon implementing the XRP Ledger protocol in C++
https://xrpl.org
ISC License
4.51k stars 1.46k forks source link

Feature request: Object transaction history RPC #5039

Open mvadari opened 3 months ago

mvadari commented 3 months ago

Summary

It would be really nice to have an RPC that provides you a list of chronological transactions that have affected a certain object.

Motivation

Object history can be important; for example, to get a list of all offers that filled another offer, track edits to a DID, or get the transaction that created a certain object.

Solution

This RPC, tentatively named object_tx, could just iterate through the PreviousTxnIDs of a transaction in reverse chronological order and use PreviousTxnLgrSeq to determine how far back to go to get the previous PreviousTxnID of the transaction.

Paths Not Taken

You can theoretically do this right now with tx and ledger_entry, using the ledger_index parameter, but it would be nicer if there were a method to do this automatically.