refactor(utxo): Esplora client helpers, class, and per-chain factory - #838
Draft
graciangabriel8 wants to merge 2 commits into
Draft
refactor(utxo): Esplora client helpers, class, and per-chain factory#838graciangabriel8 wants to merge 2 commits into
graciangabriel8 wants to merge 2 commits into
Conversation
Part of #716. Adds the retry/URL-resolution helpers, the shared EsploraIndexerClient (BTC's EsploraIndexer logic verbatim, parametrized by baseUrl + chain profile), a BtcEsploraIndexerClient subclass layering getTx on top, and getEsploraClient(chain) returning a per-chain singleton. getTx exists only on the BTC subclass, so LTC instances lack it at runtime, not just in the type. Still inert — no existing file imports this module yet.
A caller holding a variable typed as the EsploraChain union (rather than a "btc"/"ltc" literal) has no matching overload to resolve against otherwise. Needed by the table-driven pin tests in the next PR of this series.
This was referenced Aug 21, 2026
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 shared retry/URL-resolution helpers,
EsploraIndexerClient(BTC'sEsploraIndexerlogic copied verbatim, parametrized bybaseUrl+ chain profile), aBtcEsploraIndexerClientsubclass layeringgetTxon top, andgetEsploraClient(chain)returning a per-chain singleton keyed off the resolved URL — mirroringgetBitcoinIndexer/getLitecoinIndexer's existing cache shape.getTxlives only on the BTC subclass, so an LTC instance lacks it at runtime as well as in the type. Still inert — stacked on #837, no existing file imports this module yet.Part of #716