Documentation
      ¶
    
    
  
    
  
    Index ¶
- type BlockChain
 - type BlockChains
 - func (b BlockChains) All() iter.Seq2[uint64, BlockChain]
 - func (b BlockChains) AptosChains() map[uint64]aptos.Chain
 - func (b BlockChains) EVMChains() map[uint64]evm.Chain
 - func (b BlockChains) Exists(selector uint64) bool
 - func (b BlockChains) ExistsN(selectors ...uint64) bool
 - func (b BlockChains) ListChainSelectors(options ...ChainSelectorsOption) []uint64
 - func (b BlockChains) SolanaChains() map[uint64]solana.Chain
 - func (b BlockChains) SuiChains() map[uint64]sui.Chain
 - func (b BlockChains) TonChains() map[uint64]ton.Chain
 - func (b BlockChains) TronChains() map[uint64]tron.Chain
 
- type ChainSelectorsOption
 - type Provider
 
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
	Family() string
}
    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 NewBlockChainsFromSlice ¶ added in v0.8.0
func NewBlockChainsFromSlice(chains []BlockChain) BlockChains
NewBlockChainsFromSlice initializes a new BlockChains instance from a slice of BlockChain.
func (BlockChains) All ¶ added in v0.8.0
func (b BlockChains) All() iter.Seq2[uint64, BlockChain]
All returns an iterator over all chains with their selectors.
func (BlockChains) AptosChains ¶
func (b BlockChains) AptosChains() map[uint64]aptos.Chain
AptosChains returns a map of all Aptos chains with their selectors.
func (BlockChains) EVMChains ¶
func (b BlockChains) EVMChains() map[uint64]evm.Chain
EVMChains returns a map of all EVM chains with their selectors.
func (BlockChains) Exists ¶ added in v0.5.1
func (b BlockChains) Exists(selector uint64) bool
Exists checks if a chain with the given selector exists.
func (BlockChains) ExistsN ¶ added in v0.5.1
func (b BlockChains) ExistsN(selectors ...uint64) bool
ExistsN checks if all chains with the given selectors exist.
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
SolanaChains returns a map of all Solana chains with their selectors.
func (BlockChains) SuiChains ¶
func (b BlockChains) SuiChains() map[uint64]sui.Chain
SuiChains returns a map of all Sui chains with their selectors.
func (BlockChains) TonChains ¶
func (b BlockChains) TonChains() map[uint64]ton.Chain
TonChains returns a map of all Ton chains with their selectors.
func (BlockChains) TronChains ¶ added in v0.19.0
func (b BlockChains) TronChains() map[uint64]tron.Chain
TronChains returns a map of all Tron 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) This can be used more than once to include multiple families.
type Provider ¶ added in v0.7.0
type Provider interface {
	Initialize(ctx context.Context) (BlockChain, error)
	Name() string
	ChainSelector() uint64
	BlockChain() BlockChain
}