connect

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithEndpoint added in v0.10.0

func WithEndpoint(chainName string, rpc string) option

WithEndpoint returns an option to set the RPC endpoint for the given chain name or chain ID.

func WithInfuraENV added in v0.10.0

func WithInfuraENV(keyVar string) option

WithInfuraENV returns an option using the provided ENV VAR as infura API key for all xchains.

func WithPublicRPCs added in v0.10.0

func WithPublicRPCs() option

WithPublicRPCs returns an option using well known public free RPCs for all xchains. This is used be default if no other option is provided.

Types

type Connector

type Connector struct {
	Network    netconf.Network
	XProvider  xchain.Provider
	CProvider  cchain.Provider
	EthClients map[uint64]ethclient.Client
	CmtCl      rpcclient.Client
}

Connector provider a simple abstraction to connect to the Omni network.

func New

func New(ctx context.Context, netID netconf.ID, opts ...option) (Connector, error)

New returns a populated Connector for the given network. It connects to well-known free public RPCs. Use WithInfuraENV or WithEndpoint to override this.

func (Connector) Backend

func (c Connector) Backend(chainID uint64) (*ethbackend.Backend, error)

Backend returns an ethbackend for the given chainID.

Jump to

Keyboard shortcuts

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