Skip to content

feat(zcash): add address page with graceful RPC degradation - #412

Open
MatiasOS wants to merge 3 commits into
issue-398-zcash-searchfrom
issue-398-zcash-address
Open

MatiasOS wants to merge 3 commits into
issue-398-zcash-searchfrom
issue-398-zcash-address

Conversation

@MatiasOS

Copy link
Copy Markdown
Member

Description

Adds the Zcash address page at /zec/address/:address and /tzec/address/:address. With this PR the stack covers every acceptance criterion in #398, including the last one: address and shielded views degrade gracefully when the RPC endpoint rejects a method.

What the page shows depends on the address type:

  • Transparent (t1/t3, tm/t2): balance, total received, unspent outputs and history, all from Zebra's address index.
  • Unified (u1, utest1): its receivers, from z_listunifiedreceivers. If it has a transparent receiver, that receiver's balance and history are shown too.
  • Sapling and Sprout: a notice that shielded balances and history aren't publicly visible. The page makes no RPC calls for these.
  • TEX and unrecognized input: a notice explaining why nothing can be looked up.

Graceful degradation. Each section of the page reports whether its data was available.

  • Hosted gateways such as Tatum block the whole address index with -32601. In that case the page replaces three empty rows with one notice. It explains that a self-hosted Zebra node is needed and links to RPC settings.
  • Any other failure shows a message in the affected section and a retry button.

Related Issue

Closes #398. Stacked on #411.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Performance improvement
  • Other (please describe):

Changes Made

  • ZcashAddressPage and ZcashAddressDisplay.
  • Typed i18n keys for address types, added to the shared labels.ts.
  • Routes and lazy exports for zec|tzec/address/:address.
  • zcash locale strings and tooltips.zcash.address in all 5 locales.
  • Styles for the address notices and the receiver list.
  • Changes to the Zcash RPC mock:
    • By default, the address-index methods now return Tatum's Method not found error.
    • With addressIndex: true, it serves them the way a self-hosted node would.
  • A hermetic e2e spec, e2e/tests/shared/mocked/zcash-address.spec.ts. It includes the address search test that was deferred from feat(search): route Zcash addresses and block hashes #411.

Screenshots (if applicable)

Checked locally against mocked RPC data in these states:

  • a blocked address index
  • a transparent address with the index available
  • a unified address, at desktop width and at 400px
  • a Sapling address

Checklist

  • I have run npm run format:fix and npm run lint:fix
  • I have run npm run typecheck with no errors
  • I have run tests with npm run test:run
  • I have tested my changes locally
  • I have updated documentation if needed
  • My code follows the project's architecture patterns

Additional Notes

  • On phones, the full unified address is truncated with an ellipsis by the shared .tx-value styles. The copy button still copies the whole address.
  • AI analysis prompts for Zcash come in the last PR of the stack. They aren't part of feat: add Zcash to the explorer (adapter, pages, routes) #398's acceptance criteria.
  • Tests:
    • npm run test:run: 151 passing.
    • Hermetic Zcash e2e specs (dashboard, blocks, transactions, mempool, search, address): 20 passed, with no retries.

Each section reports its own availability. When a hosted gateway blocks Zebra's address index, one notice explains that a self-hosted node is needed instead of rendering empty rows; shielded addresses explain why their balances are private.
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.

1 participant