relay

package
v2.1.0-mercury-20230509 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Network

type Network string
var (
	EVM             Network = "evm"
	Cosmos          Network = "cosmos"
	Solana          Network = "solana"
	StarkNet        Network = "starknet"
	SupportedRelays         = map[Network]struct{}{
		EVM:      {},
		Cosmos:   {},
		Solana:   {},
		StarkNet: {},
	}
)

type RelayerAdapter

type RelayerAdapter struct {
	types.Relayer
	RelayerExt
}

RelayerAdapter adapts a types.Relayer and RelayerExt to imlement loop.Relayer.

func (*RelayerAdapter) Close

func (r *RelayerAdapter) Close() error

func (*RelayerAdapter) HealthReport

func (r *RelayerAdapter) HealthReport() map[string]error

func (*RelayerAdapter) Name

func (r *RelayerAdapter) Name() string

func (*RelayerAdapter) NewConfigProvider

func (r *RelayerAdapter) NewConfigProvider(ctx context.Context, rargs types.RelayArgs) (types.ConfigProvider, error)

func (*RelayerAdapter) NewMedianProvider

func (r *RelayerAdapter) NewMedianProvider(ctx context.Context, rargs types.RelayArgs, pargs types.PluginArgs) (types.MedianProvider, error)

func (*RelayerAdapter) NewMercuryProvider

func (r *RelayerAdapter) NewMercuryProvider(ctx context.Context, rargs types.RelayArgs, pargs types.PluginArgs) (types.MercuryProvider, error)

func (*RelayerAdapter) Ready

func (r *RelayerAdapter) Ready() (err error)

func (*RelayerAdapter) Start

func (r *RelayerAdapter) Start(ctx context.Context) error

type RelayerExt added in v2.2.0

type RelayerExt interface {
	services.ServiceCtx

	ChainStatus(ctx context.Context, id string) (types.ChainStatus, error)
	ChainStatuses(ctx context.Context, offset, limit int) ([]types.ChainStatus, int, error)

	NodeStatuses(ctx context.Context, offset, limit int, chainIDs ...string) (nodes []types.NodeStatus, count int, err error)

	SendTx(ctx context.Context, chainID, from, to string, amount *big.Int, balanceCheck bool) error
}

RelayerExt is a subset of loop.Relayer for adapting types.Relayer, typically with a ChainSet. See RelayerAdapter.

type RelayerService

type RelayerService interface {
	services.ServiceCtx
	Relayer() (loop.Relayer, error)
}

func NewLocalRelayerService

func NewLocalRelayerService(r types.Relayer, e RelayerExt) RelayerService

NewLocalRelayerService returns a RelayerService adapted from a types.Relayer and RelayerExt.

type RelayerServiceAdapter

type RelayerServiceAdapter struct {
	*RelayerAdapter
}

func (*RelayerServiceAdapter) Relayer

func (a *RelayerServiceAdapter) Relayer() (loop.Relayer, error)

Directories

Path Synopsis
evm

Jump to

Keyboard shortcuts

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