Skip to content

refactor(utxo): Esplora client helpers, class, and per-chain factory - #838

Draft
graciangabriel8 wants to merge 2 commits into
refactor/716-1-esplora-shapesfrom
refactor/716-2-client-factory
Draft

refactor(utxo): Esplora client helpers, class, and per-chain factory#838
graciangabriel8 wants to merge 2 commits into
refactor/716-1-esplora-shapesfrom
refactor/716-2-client-factory

Conversation

@graciangabriel8

Copy link
Copy Markdown
Contributor

Adds the shared retry/URL-resolution helpers, EsploraIndexerClient (BTC's EsploraIndexer logic copied verbatim, parametrized by baseUrl + chain profile), a BtcEsploraIndexerClient subclass layering getTx on top, and getEsploraClient(chain) returning a per-chain singleton keyed off the resolved URL — mirroring getBitcoinIndexer/getLitecoinIndexer's existing cache shape.

getTx lives 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

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.
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