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.
Files. src/scanner/unified.ts, src/chains/*/scan.ts, src/index.ts, etc/sdk.api.md, examples/custom-chain-adapter/ (new).
Tier: M (2-4 days) | Type: refactor
Context.
scanAll(PR #149) hard-wires the four supported chains viaSupportedChain = 'evm' | 'stellar' | 'solana' | 'ckb'insrc/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.
ChainScannerAdapter<TAnnouncement, TMatch>interface:{ id, scan(source, keys), decodeMetaAddress, encodeMetaAddress }.src/chains/*/scan.tsto also export an adapter object satisfying the interface.scanAllaccepts either the built-inSupportedChainshorthand or an arbitrary adapter.Acceptance.
examples/scanAll({ adapters: [customChain] })compiles and runs against a fixtureetc/sdk.api.mdreviewed and updatedFiles.
src/scanner/unified.ts,src/chains/*/scan.ts,src/index.ts,etc/sdk.api.md,examples/custom-chain-adapter/(new).