Skip to content

fix(api): add per-asset indexed_at_ledger and index_error (#91) - #157

Merged
valoryyaa-byte merged 2 commits into
RWA-ToolKit:mainfrom
euniceamoni:fix/91-per-asset-freshness
Jul 28, 2026
Merged

fix(api): add per-asset indexed_at_ledger and index_error (#91)#157
valoryyaa-byte merged 2 commits into
RWA-ToolKit:mainfrom
euniceamoni:fix/91-per-asset-freshness

Conversation

@euniceamoni

Copy link
Copy Markdown

Closes #91.

Summary

Adds freshness and error visibility per asset so consumers can detect stale data without relying on a full-cycle timestamp.

Changes

  • Add indexed_at_ledger: u32 to Asset — taken from the latestLedger returned by the per-asset get_metadata simulation, the tightest freshness signal available without a database.
  • Add index_error: Option<String> to Asset — set when a per-asset read fails so consumers can see which assets are stale and why.
  • 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.
  • Dividend fallback now also re-uses previous data rather than an empty Vec.

Note: PR #154 has been closed and split into this PR (issue #91) and a separate PR for issue #92.

…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
@valoryyaa-byte
valoryyaa-byte merged commit ae89845 into RWA-ToolKit:main Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

api: snapshot has no per-asset 'last successfully indexed' timestamp/ledger

2 participants