Skip to content

feat(node): wallet-serving APIs — address-tx history, rewards, tx status, L1 SSE - #58

Open
satran004 wants to merge 1 commit into
mainfrom
feat/node-wallet-apis
Open

feat(node): wallet-serving APIs — address-tx history, rewards, tx status, L1 SSE#58
satran004 wants to merge 1 commit into
mainfrom
feat/node-wallet-apis

Conversation

@satran004

Copy link
Copy Markdown
Member

Adds the node-side APIs a wallet needs to run against Yano alone, with no third-party indexer.

These have lived only on the desktop-wallet feature branch since 2026-07-14 (bf396b81) and are in no releasev0.1.0-pre12 was cut from main, which never had them. That makes the wallet unusable against any published Yano build: balances work, History and reward pages 404. The wallet is moving to its own repository, so the node half needs to land here on its own.

Nothing wallet-side comes with this. These are node features, and any Blockfrost-shaped consumer benefits from them.

What's in it

Ledger state

AccountHistoryStore (pre-existing, since 2026-04-30) gains two record families:

  • TYPE_ADDRESS_TX — an address → transaction index
  • TYPE_REWARD — reward history

Each family keeps its own cursor (META_ADDRTX_LAST_BLOCK, META_TXEVENTS_LAST_BLOCK) instead of sharing one. That's the design point worth reviewing: a family enabled later backfills from where it actually is, rather than being skipped by a shared high-water mark and silently serving an empty index. Rollback clamps each cursor independently.

AddressKeyUtil centralises payment/stake credential scoping; UtxoKeyUtil now delegates to it rather than keeping its own copy (the only real deletion here, −22).

REST

Endpoint
GET /addresses/{address} new resource
GET /addresses/{address}/transactions new resource
GET /accounts/{stake}/transactions
GET /accounts/{stake}/rewards
GET /tx/{hash}/status confirmations + mempool state
GET /events L1 server-sent events, via the new L1EventFanout

Risk

Low, and opt-in. Everything is gated behind ADDRESS_TX_ENABLED, which defaults to false; the wallet profile turns it on. An existing node that doesn't opt in sees no new indexing work, no additional disk use, and no behaviour change.

The change is almost entirely additive — 24 of 26 files are new files or pure additions. The two exceptions are AccountHistoryStore (+226/−24) and UtxoKeyUtil (+5/−22, the AddressKeyUtil extraction).

Verification

Against current main:

  • ledger-state — 276 tests, 0 failures
  • core-api — 118 tests, 0 failures
  • runtime — 871 tests, 0 failures
  • app — compiles and tests green

AccountHistoryStoreAddressTxTest (10 tests, new) covers indexing, address scoping and rollback.

Separately, the endpoints have been exercised end-to-end by the desktop wallet against a synced preprod node (epoch 305) with Profiles wallet,preprod activated.

Follow-up

Once this is released, the wallet repo can pin that version instead of requiring a locally built node.

🤖 Generated with Claude Code

…tus, L1 SSE

Adds the node-side APIs a light or full-node wallet needs to run against Yano
alone, with no third-party indexer. Extracted from the desktop-wallet branch,
which is being split into its own repository — these are node features and
belong here; nothing wallet-side comes with them.

Ledger state (opt-in, off by default):
- AccountHistoryStore gains two record families — an address -> transaction
  index (TYPE_ADDRESS_TX) and reward history (TYPE_REWARD). Each family keeps
  its OWN cursor (META_ADDRTX_LAST_BLOCK, META_TXEVENTS_LAST_BLOCK) rather than
  sharing one, so a family enabled later backfills from where it actually is
  instead of being skipped by a shared high-water mark. Rollback clamps each
  cursor independently.
- AddressKeyUtil centralises payment/stake credential scoping; UtxoKeyUtil now
  delegates to it instead of carrying its own copy.

REST:
- GET /addresses/{address} and /addresses/{address}/transactions (new resource)
- GET /accounts/{stake}/transactions and /accounts/{stake}/rewards
- GET /tx/{hash}/status — confirmations and mempool state
- GET /events — L1 server-sent events, fed by the new L1EventFanout

Config:
- The `wallet` profile turns the above on. Everything is gated behind
  ADDRESS_TX_ENABLED, which defaults to false, so an existing node sees no new
  indexing work, no extra disk use and no behaviour change unless it opts in.

Tests: AccountHistoryStoreAddressTxTest (10) covers indexing, address scoping
and rollback. ledger-state / core-api / runtime / app all green (1,265 tests in
the three library modules, 0 failures) against current main.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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