Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainInfo ¶
type ChainInfo struct { Name string `json:"name"` Chain string `json:"chain"` Icon string `json:"icon,omitempty"` Tvl float64 `json:"tvl,omitempty"` LlamaChainHeader *LlamaChainHeader `json:"LlamaChainHeader,omitempty"` LlamaChainDetail *LlamaChain `json:"LlamaChainDetail,omitempty"` RPC []string `json:"rpc"` Features []struct { Name string `json:"name"` } `json:"features,omitempty"` Faucets []interface{} `json:"faucets"` NativeCurrency struct { Name string `json:"name"` Symbol string `json:"symbol"` Decimals int `json:"decimals"` } `json:"nativeCurrency"` InfoURL string `json:"infoURL"` ShortName string `json:"shortName"` ChainID int64 `json:"chainId"` NetworkID int64 `json:"networkId"` Slip44 int `json:"slip44,omitempty"` Ens struct { Registry string `json:"registry"` } `json:"ens,omitempty"` Explorers []struct { Name string `json:"name"` URL string `json:"url"` Standard string `json:"standard"` Icon string `json:"icon,omitempty"` } `json:"explorers,omitempty"` Title string `json:"title,omitempty"` Status string `json:"status,omitempty"` RedFlags []string `json:"redFlags,omitempty"` Parent struct { Type string `json:"type"` Chain string `json:"chain"` Bridges []struct { URL string `json:"url"` } `json:"bridges"` } `json:"parent,omitempty"` }
type ChainList ¶
type ChainList []*ChainInfo
ChainList is the http get response from https://chainid.network/chains.json
func GetAllChainInfo ¶
GetAllChainInfo gets all EVM chain info 1. Get all chain info from https://chainid.network/chains.json 2. Get all chain header info from https://api.llama.fi/v2/chains, and merge with the result from step 1, the key is chainID 3. Get all chain detail info from https://chainlist.org, and merge with the result from step 2, the key is chainID 4. I specially care about the rpc's url, so merge the LlamaChains.PageProps.Chain.RPC.URL with the ChainInfo.RPC, remove duplicated rpc url 5. Sort the result by Tvl in descending order GetAllChainInfo gets all EVM chain info
type LlamaChain ¶
type LlamaChain struct { Name string `json:"name"` Chain string `json:"chain"` Icon string `json:"icon,omitempty"` RPC []struct { URL string `json:"url"` Tracking string `json:"tracking,omitempty"` TrackingDetails string `json:"trackingDetails,omitempty"` IsOpenSource bool `json:"isOpenSource,omitempty"` } `json:"rpc"` Features []struct { Name string `json:"name"` } `json:"features,omitempty"` Faucets []interface{} `json:"faucets"` NativeCurrency struct { Name string `json:"name"` Symbol string `json:"symbol"` Decimals int `json:"decimals"` } `json:"nativeCurrency"` InfoURL string `json:"infoURL"` ShortName string `json:"shortName"` ChainID int64 `json:"chainId"` NetworkID int64 `json:"networkId"` Slip44 int `json:"slip44,omitempty"` Ens struct { Registry string `json:"registry"` } `json:"ens,omitempty"` Explorers []struct { Name string `json:"name"` URL string `json:"url"` Standard string `json:"standard"` Icon string `json:"icon,omitempty"` } `json:"explorers,omitempty"` Tvl float64 `json:"tvl,omitempty"` ChainSlug string `json:"chainSlug,omitempty"` Parent struct { Type string `json:"type"` Chain string `json:"chain"` Bridges []struct { URL string `json:"url"` } `json:"bridges"` } `json:"parent,omitempty"` Status string `json:"status,omitempty"` Title string `json:"title,omitempty"` RedFlags []string `json:"redFlags,omitempty"` }
type LlamaChainHeader ¶
type LlamaChainHeaders ¶
type LlamaChainHeaders []*LlamaChainHeader
LlamaChainHeaders is the http get response from https://api.llama.fi/v2/chains
type LlamaChains ¶
type LlamaChains []*LlamaChain
LlamaChains is the http get response from https://chainlist.org (after some processing)