feat(node): wallet-serving APIs — address-tx history, rewards, tx status, L1 SSE - #58
Open
satran004 wants to merge 1 commit into
Open
feat(node): wallet-serving APIs — address-tx history, rewards, tx status, L1 SSE#58satran004 wants to merge 1 commit into
satran004 wants to merge 1 commit into
Conversation
…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>
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.
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 release —v0.1.0-pre12was cut frommain, 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 indexTYPE_REWARD— reward historyEach 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.AddressKeyUtilcentralises payment/stake credential scoping;UtxoKeyUtilnow delegates to it rather than keeping its own copy (the only real deletion here, −22).REST
GET /addresses/{address}GET /addresses/{address}/transactionsGET /accounts/{stake}/transactionsGET /accounts/{stake}/rewardsGET /tx/{hash}/statusGET /eventsL1EventFanoutRisk
Low, and opt-in. Everything is gated behind
ADDRESS_TX_ENABLED, which defaults tofalse; thewalletprofile 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) andUtxoKeyUtil(+5/−22, theAddressKeyUtilextraction).Verification
Against current
main:ledger-state— 276 tests, 0 failurescore-api— 118 tests, 0 failuresruntime— 871 tests, 0 failuresapp— compiles and tests greenAccountHistoryStoreAddressTxTest(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