fix(api): add per-asset indexed_at_ledger and index_error (#91) - #157
Merged
valoryyaa-byte merged 2 commits intoJul 28, 2026
Merged
Conversation
…it#91) - Add `indexed_at_ledger: u32` and `index_error: Option<String>` to the Asset model so consumers can tell which assets are stale. - Make per-asset indexing fully best-effort: a failed get_metadata or compliance read no longer aborts the whole refresh cycle. The previous snapshot's data is re-emitted with index_error set instead. - indexed_at_ledger is taken from the latest_ledger returned by the per-asset get_metadata simulation — the tightest freshness signal available without a database. - Dividend fallback now also re-uses previous data rather than Vec::new(). Closes RWA-ToolKit#91
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #91.
Summary
Adds freshness and error visibility per asset so consumers can detect stale data without relying on a full-cycle timestamp.
Changes
indexed_at_ledger: u32toAsset— taken from thelatestLedgerreturned by the per-assetget_metadatasimulation, the tightest freshness signal available without a database.index_error: Option<String>toAsset— set when a per-asset read fails so consumers can see which assets are stale and why.get_metadataor compliance read no longer aborts the whole refresh cycle. The previous snapshot's data is re-emitted withindex_errorset instead.Vec.