Skip to content

Formal ChainScanner adapter contract for third-party chains #176

Description

@truthixify

Tier: M (2-4 days) | Type: refactor

Context. scanAll (PR #149) hard-wires the four supported chains via SupportedChain = 'evm' | 'stellar' | 'solana' | 'ckb' in src/scanner/unified.ts. To let downstream projects add a chain without patching the SDK, formalise the contract each chain adapter must satisfy and expose it as a public interface. This is the v1.0 extensibility story we punted on in PR #152.

Scope.

  • Extract a ChainScannerAdapter<TAnnouncement, TMatch> interface: { id, scan(source, keys), decodeMetaAddress, encodeMetaAddress }.
  • Refactor each src/chains/*/scan.ts to also export an adapter object satisfying the interface.
  • scanAll accepts either the built-in SupportedChain shorthand or an arbitrary adapter.
  • Api-extractor snapshot updated; conformance test loops over registered adapters.

Acceptance.

  • Interface documented in the reference with a runnable third-party example under examples/
  • All four in-tree chains implement the interface
  • scanAll({ adapters: [customChain] }) compiles and runs against a fixture
  • etc/sdk.api.md reviewed and updated

Files. src/scanner/unified.ts, src/chains/*/scan.ts, src/index.ts, etc/sdk.api.md, examples/custom-chain-adapter/ (new).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programdripsFunded via Drips NetworkdxDeveloper experiencehelp wantedExtra attention is neededreleasestellar-waveAuto-created for Wave 8wave-8Auto-created for Wave 8

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions