Instead of Hard-coding chain native token names in the relayer, we should instead use something like
https://chainid.network/chains.json
Which contains a big list of networks/chains, each has a chainId, a name and nativeCurrency with its symbol and decimals too!
We should make use of that and bundle this file with the relayer binary, no need to fetch it every time.
Coingecko-Specific Token Ids
Coingecko uses it's own set of token ids, different than just using the token symbol or ticker, hence, the generated chains.json file should include somehow the corresponding coingecko token id by query the
Overview
Instead of Hard-coding chain native token names in the relayer, we should instead use something like
Which contains a big list of networks/chains, each has a
chainId
, aname
andnativeCurrency
with itssymbol
and decimals too!We should make use of that and bundle this file with the relayer binary, no need to fetch it every time.
Coingecko-Specific Token Ids
Coingecko uses it's own set of token ids, different than just using the token symbol or ticker, hence, the generated chains.json file should include somehow the corresponding coingecko token id by query the
endpoint which contains the
id
,symbol
andname
.The result
chains.json
file should include the minimum information needed by the relayer, for now theChainInfo
struct may look like the following:Task Checklist
chains.json
in the repos fixturesinclude_str!
macro)Chain
that contains the min info we need from that JSON fileTypedChainId
toChainInfo
and add it to the relayer context.