Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support deleted object in ledger_entry #1306

Closed
shawnxie999 opened this issue Mar 28, 2024 · 0 comments · Fixed by #1483
Closed

Support deleted object in ledger_entry #1306

shawnxie999 opened this issue Mar 28, 2024 · 0 comments · Fixed by #1483
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@shawnxie999
Copy link
Collaborator

shawnxie999 commented Mar 28, 2024

Summary

Modifying the ledger_entry API as follows:

New Request Parameter

Field Name Type Description
include_deleted ️boolean (Optional) If set to true and the queried object has been deleted, return its complete data prior to its deletion. If set to false or not provided and the queried object has been deleted, return objectNotFound (current behavior) .

New Response Parameter

Field Name Type Description
deleted_ledger_index number (Optional) Indicates the ledger index at which the object was deleted.

Motivation

Currently, ledger_entry API returns objectNotFound if the object has been deleted. But perhaps someone may want to find the object data before its deletion, without the need to dig through transaction history to find the index at which this particular object was deleted.

I think clio can introduce an improved ledger_entry API with the a change - rather than returning objectNotFound for a deleted object, it would return the complete object data prior to its deletion, as well as an additional field to indicated the ledger index at which the object wad deleted.

This is useful it for something like XRPL explorer. For example, if I create a MPT page that queries ledger_entry, it would work fine as long as the MPT is not destroyed. However, after the MPT is destroyed, the MPT page will no longer be available because ledger_entry will now return objectNotFound. This would result in suboptimal experience in the explorer. This would improve the user experience on explorers in the long term, as explorer adds new page for each object type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: ✅ Merged
Development

Successfully merging a pull request may close this issue.

4 participants