Description
The current plan is to first add the complete set of data for the 3 initial chains. From there, I'd like to add a helper method that makes it easy to add a new chain based off an existing chain, so the diffs for new chains can be small.
With both of those in place, we can support a feature that lets chains permissionlessly add their own data using e.g. a JSON file that has the same structure as the Chain
type in src/types/chains.ts
. Assuming we go the JSON route, we'd probably want to use JSON Schema to strongly type it and so users can validate their implementations. There are at least two actively maintained packages that support converting TS types to JSON Schema which would help the conversion:
- https://github.com/YousefED/typescript-json-schema#readme
- https://github.com/vega/ts-json-schema-generator
A chain could define their JSON file and host it somewhere, then users can navigate directly to https://www.evmdiff.com/diff?base=1&target=encodedUrlToChainDiffFile
. This would compare chain ID 1 (mainnet) to the chain whose path is specified in the URL.
We'll also have to show a warning that the data is unverified and may not be accurate.
Some chains may be limited by the shape of the Chains
type depending on how EVM-(in)compatible they are. One way to mitigate this is to add a generic catch-call section to the end that supports arbitrary keys and values, which get rendered in their own section of the UI.
h/t @alcuadrado for the idea