Documentation
¶
Overview ¶
Package chains provides static metadata for known EVM-compatible chains.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainCurrency ¶
type ChainCurrency struct {
Name string `json:"name"`
Symbol string `json:"symbol"`
Decimals int `json:"decimals"`
}
ChainCurrency describes a chain's native currency.
type ChainENS ¶
type ChainENS struct {
Registry string `json:"registry"`
}
ChainENS holds ENS registry information for a chain.
type ChainExplorer ¶
type ChainExplorer struct {
Name string `json:"name"`
URL string `json:"url"`
Standard string `json:"standard"` // EIP3091
}
ChainExplorer describes a block explorer for a chain.
type ChainFeature ¶
type ChainFeature struct {
Name string `json:"name"`
}
ChainFeature represents a feature supported by a chain (e.g. EIP155, EIP1559).
type ChainInfo ¶
type ChainInfo struct {
Name string `json:"name"`
Chain string `json:"chain"`
Icon string `json:"icon"`
RPC []string `json:"rpc"`
Features []*ChainFeature `json:"features"`
Faucets []string `json:"faucets"`
NativeCurrency *ChainCurrency `json:"nativeCurrency"`
InfoURL string `json:"infoURL"`
ShortName string `json:"shortName"`
ChainId uint64 `json:"chainId"`
NetworkId uint64 `json:"networkId"`
Slip44 int `json:"slip44,omitempty"`
ENS *ChainENS `json:"ens"`
Explorers []*ChainExplorer `json:"explorers"`
}
ChainInfo holds metadata for an EVM-compatible chain.
func Get ¶
Get returns the ChainInfo for the given chain ID, or nil if unknown. Results are cached after the first lookup.
func (*ChainInfo) ExplorerURL ¶
ExplorerURL returns the URL of the chain's first block explorer, or an empty string if none.
func (*ChainInfo) HasFeature ¶
HasFeature reports whether the chain supports the named feature.
func (*ChainInfo) TransactionUrl ¶
TransactionUrl returns a URL to view the given transaction hash on the chain's first explorer. Returns an empty string if no explorer is configured.