chain

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: MIT Imports: 7 Imported by: 36

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockChain

type BlockChain interface {
	// String returns chain name and selector "<name> (<selector>)"
	String() string
	// Name returns the name of the chain
	Name() string
	ChainSelector() uint64
}

BlockChain is an interface that represents a chain. A chain can be an EVM chain, Solana chain Aptos chain or others.

type BlockChains

type BlockChains struct {
	// contains filtered or unexported fields
}

BlockChains represents a collection of chains. It provides querying capabilities for different types of chains.

func NewBlockChains

func NewBlockChains(chains map[uint64]BlockChain) BlockChains

NewBlockChains initializes a new BlockChains instance

func (BlockChains) AptosChains

func (b BlockChains) AptosChains() (map[uint64]aptos.Chain, error)

AptosChains returns a map of all Aptos chains with their selectors.

func (BlockChains) EVMChains

func (b BlockChains) EVMChains() (map[uint64]evm.Chain, error)

EVMChains returns a map of all EVM chains with their selectors.

func (BlockChains) ListChainSelectors

func (b BlockChains) ListChainSelectors(options ...ChainSelectorsOption) []uint64

ListChainSelectors returns all chain selectors with optional filtering Options: - WithFamily: filter by family eg WithFamily(chain_selectors.FamilySolana) - WithChainSelectorsExclusion: exclude specific chain selectors

func (BlockChains) SolanaChains

func (b BlockChains) SolanaChains() (map[uint64]solana.Chain, error)

SolanaChains returns a map of all Solana chains with their selectors.

func (BlockChains) SuiChains

func (b BlockChains) SuiChains() (map[uint64]sui.Chain, error)

SuiChains returns a map of all Sui chains with their selectors.

func (BlockChains) TonChains

func (b BlockChains) TonChains() (map[uint64]ton.Chain, error)

TonChains returns a map of all Ton chains with their selectors.

type ChainSelectorsOption

type ChainSelectorsOption func(*chainSelectorsOptions)

ChainSelectorsOption defines a function type for configuring ChainSelectors

func WithChainSelectorsExclusion

func WithChainSelectorsExclusion(chainSelectors []uint64) ChainSelectorsOption

WithChainSelectorsExclusion returns an option to exclude specific chain selectors

func WithFamily

func WithFamily(family string) ChainSelectorsOption

WithFamily returns an option to filter chains by family (evm, solana, aptos) Use constants from chain_selectors package eg WithFamily(chain_selectors.FamilySolana)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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