Implement @substrate-connect/discovery package
ryanleecode opened this issue · 1 comments
Create a package (temporarily named "substrate-extension-discovery") that enables the discovery of Substrate extensions. This package should expose a single discover()
method with the following type signature: async fn discover() -> Extension[]
.
The Extension
type should have the following properties:
providerName: 'Substrate Connect'
kind: 'smoldot' | 'unstable-substrate-connect'
payload: { addChain: ..., addWellKnownChain: ... }
Note: The payload for 'unstable-substrate-connect' kind should match the interface we want to expose for the Substrate Connect extension.
When a user installs this library and runs the discover()
method, it should return an array of extensions implementing the desired interface (i.e., either 'smoldot' or 'unstable-substrate-connect' kind).
The user should then be able to interact with the extensions using the provided interfaces.
Implementation Notes:
- Define the expected interface type in this new package.
- Ensure our extensions return the expected interface type.
This approach allows us to define the interface without moving existing code.