chainId

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 3 Imported by: 6

README

Chain ids

Read the chain list from DefiLlama/chainlist

To get all chains' latest info: GetLatestChainIdsMap()(Testnets not included.)

Documentation

Index

Constants

View Source
const ArbitrumChainName string = "arbitrum"

Commonly used chains.

View Source
const AvalancheChainName string = "avalanche"
View Source
const BinanaceSmartChainName string = "binance"
View Source
const EthereumChainName string = "ethereum"
View Source
const FantomChainName string = "fantom"
View Source
const GoerliChainName string = "goerli"
View Source
const HecoChainName string = "heco"
View Source
const OkChainName string = "okexchain"
View Source
const OptimismChainName string = "optimism"
View Source
const PolygonChainName string = "polygon"
View Source
const TerraChainName string = "terra"
View Source
const XDaiChainName string = "xdai"

Variables

Map chain id to chain name.

Map chain name to chain id.

View Source
var ChainTokenSymbolList = map[string]string{
	EthereumChainName:      "eth",
	OptimismChainName:      "eth",
	BinanaceSmartChainName: "bnb",
	OkChainName:            "okt",
	XDaiChainName:          "xdai",
	HecoChainName:          "ht",
	PolygonChainName:       "matic",
	FantomChainName:        "ftm",
	ArbitrumChainName:      "eth",
	AvalancheChainName:     "avax",
}

Map chain name to chain token symbol.

Functions

func GetLatestChainIdsMap

func GetLatestChainIdsMap() (Id2NameMap map[int]string, Name2IdMap map[string]int, err error)

Chain ids given by defillama/chainlist. ChainList: https://chainlist.org.

Types

type Chain

type Chain struct {
	Id     int    // chain id
	Name   string // chain name
	Symbol string // chain token symbol
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL