chains

package
v0.0.0-...-8f50baf Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UnknownChain = &ConfiguredChain{
	ChainId:    "0x0",
	NetVersion: "0",
	ShortNames: []string{},
	Settings:   Settings{},
	Chain:      -1,
}

Functions

func GetAllChains

func GetAllChains() map[string]*ConfiguredChain

func GetMethodSpecNameByChain

func GetMethodSpecNameByChain(chain Chain) string

func GetMethodSpecNameByChainName

func GetMethodSpecNameByChainName(chainName string) string

func IsSupported

func IsSupported(chainName string) bool

Types

type BlockchainType

type BlockchainType string
const (
	Bitcoin             BlockchainType = "bitcoin"
	Cosmos              BlockchainType = "cosmos"
	Ethereum            BlockchainType = "eth"
	EthereumBeaconChain BlockchainType = "eth-beacon-chain"
	Near                BlockchainType = "near"
	Polkadot            BlockchainType = "polkadot"
	Solana              BlockchainType = "solana"
	Starknet            BlockchainType = "starknet"
	Ton                 BlockchainType = "ton"
	Aztec               BlockchainType = "aztec"
)

type ChainConfig

type ChainConfig struct {
	ChainSettings ChainSettings `yaml:"chain-settings"`
}

type ChainData

type ChainData struct {
	ShortNames []string               `yaml:"short-names"`
	ChainId    string                 `yaml:"chain-id"`
	MethodSpec string                 `yaml:"method-spec"`
	Settings   map[string]interface{} `yaml:"settings"`
	NetVersion string                 `yaml:"net-version"`
}

type ChainSettings

type ChainSettings struct {
	Protocols []Protocol             `yaml:"protocols"`
	Default   map[string]interface{} `yaml:"default"`
}

type ConfiguredChain

type ConfiguredChain struct {
	ChainId    string
	NetVersion string
	ShortNames []string
	Type       BlockchainType
	Settings   Settings
	Chain      Chain
	MethodSpec string
}

func GetChain

func GetChain(chainName string) *ConfiguredChain

func GetChainByChainIdAndVersion

func GetChainByChainIdAndVersion(chainId, netVersion string) *ConfiguredChain

type Protocol

type Protocol struct {
	Chains   []ChainData            `yaml:"chains"`
	Settings map[string]interface{} `yaml:"settings"`
	Type     BlockchainType         `yaml:"type"`
}

type Settings

type Settings struct {
	ExpectedBlockTime time.Duration `yaml:"expected-block-time"`
}

Jump to

Keyboard shortcuts

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