chain_info

package
v0.3.12 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 4 Imported by: 11

Documentation

Index

Constants

View Source
const (
	ChainTypeBsc      = 1
	ChainTypeMetis    = 2
	ChainTypePolygon  = 3
	ChainTypeKlaytn   = 4
	ChainTypeOkc      = 5
	ChainTypeEvmos    = 6
	ChainTypeCronos   = 7
	ChainTypeAurora   = 8
	ChainTypeArbitrum = 9
	ChainTypeConflux  = 10
	ChainTypeEthereum = 100
)
View Source
const (
	NetworkTypeMainNet = iota + 1
	NetworkTypeTestNet
)

Variables

This section is empty.

Functions

func GetExplorerTargetUrl added in v0.0.4

func GetExplorerTargetUrl(chainId uint64, txHash string, targetType ExplorerTargetType) string

func GetSupportChainTypeList

func GetSupportChainTypeList() []uint32

Types

type Chain

type Chain struct {
	ChainType    uint32 `json:"chain_type"`
	Name         string `json:"name"`
	Remark       string `json:"remark"`
	Icon         string `json:"icon"`
	Symbol       string `json:"coin_symbol"`
	CoinDecimals uint8  `json:"coin_decimals"`
	Type         uint8  `json:"type"`
}

func GetChainInfo

func GetChainInfo(chainType uint32) *Chain

func GetSupportChainList

func GetSupportChainList() []*Chain

type ExplorerTargetType added in v0.0.4

type ExplorerTargetType int
const (
	ExplorerTargetTransaction ExplorerTargetType = 1
	ExplorerTargetAddress     ExplorerTargetType = 2
)

type Net

type Net struct {
	ChainType        uint32 `json:"chain_type"`
	ChainId          uint64 `json:"chain_id"`
	NetworkName      string `json:"network_name"`
	Symbol           string `json:"symbol"`
	Decimals         uint8  `json:"decimals"`
	RpcUrl           string `json:"rpc_url"`
	OriginRpcUrl     string `json:"origin_rpc_url"`
	WssUrl           string `json:"-"`
	BlockExplorer    string `json:"block_explorer"`
	ExplorerApiUrl   string `json:"-"`
	ExplorerApiKey   string `json:"-"`
	Type             uint8  `json:"type"`
	PollingInterval  int64  `json:"polling_interval"`
	AverageBlockTime int64  `json:"average_block_time"`
}

func GetNetByChainId

func GetNetByChainId(chainId uint64) *Net

func GetNetByChainType added in v0.0.8

func GetNetByChainType(chainType uint32) *Net

func GetSupportNetList

func GetSupportNetList() []*Net

func (*Net) GetAverageBlockTime

func (c *Net) GetAverageBlockTime() int64

func (*Net) GetPollingInterval

func (c *Net) GetPollingInterval() int64

func (*Net) IsAvailable

func (c *Net) IsAvailable() bool

func (*Net) UseWssSubscribe

func (c *Net) UseWssSubscribe() bool

Jump to

Keyboard shortcuts

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