chain_info

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: MIT Imports: 3 Imported by: 11

Documentation

Index

Constants

View Source
const (
	ChainTypeBsc      = 1
	ChainTypeMetis    = 2
	ChainTypePolygon  = 3
	ChainTypeKlaytn   = 4
	ChainTypeOkc      = 5
	ChainTypeEthereum = 10
)
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"`
	WssUrl           string `json:"wss_url"`
	BlockExplorer    string `json:"block_explorer"`
	ExplorerApiUrl   string `json:"explorer_api_url"`
	ExplorerApiKey   string `json:"explorer_api_key"`
	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