Skip to content

In-app ledger explorer for party, contract, and update ids #113

Description

@gabitoesmiapodo

User story / Problem statement

As a dApp user, I want the party, contract, and update ids the dApp renders to be clickable and resolve to their ledger record, so I can verify what happened without leaving the app. Today they link nowhere unless VITE_EXPLORER_URL points at an external explorer.

Expected outcome

Three routes — /party/:id, /contract/:id, /update/:id — render the record read through the connected wallet session's ledgerApi, plus a search box that resolves a pasted id. Pointing VITE_EXPLORER_URL at the app's own origin makes every existing Identifier link land in-app, with no change to the components rendering them.

Acceptance criteria

  • src/pages/Explorer/ holds the three route components, registered in src/routes.tsx
  • A reader module beside src/backend/config.ts shares the ledgerApi seam, as LiteBackend does
  • Party route reads GET /v2/parties/{party}
  • Contract route reads POST /v2/events/events-by-contract-id with an eventFormat body
  • Update route reads POST /v2/updates/update-by-id
  • Activity list reads POST /v2/updates/flats with an updateFormat body
  • Search box routes a pasted id by shape, matching getExplorerLink's detection
  • A record the connected party cannot read renders an explanatory empty state, not a crash
  • VITE_EXPLORER_URL can resolve to the app's own origin
  • .env.example, the architecture.md seam and the README env note updated

Alternatives considered

scan-web-ui expects a super validator's full scan API; a separate proxy backend adds a deployment. The wallet session already carries a token that reads.

Technical notes

Every read needs filtersByParty naming a party the token can read — filtersForAnyParty returns 403. These endpoints require an eventFormat body and reject requestingParties. A contract resolves only for a stakeholder party, else CONTRACT_EVENTS_NOT_FOUND, so coverage is the connected party and the vesting operator, not the network. src/utils/env.ts demands an absolute http(s) URL, so an own-origin EXPLORER needs a per-environment value or a src/utils/config.ts change.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions