relay

package
v2.5.0-beta0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRelayerAdapter added in v2.2.0

func NewRelayerAdapter(r types.Relayer, e RelayerExt) loop.Relayer

NewRelayerAdapter returns a loop.Relayer adapted from a types.Relayer and RelayerExt.

Types

type ChainID added in v2.5.0

type ChainID string

func (ChainID) Int64 added in v2.5.0

func (c ChainID) Int64() (int64, error)

func (ChainID) String added in v2.5.0

func (c ChainID) String() string

type ID added in v2.5.0

type ID struct {
	Network Network
	ChainID ChainID
}

ID uniquely identifies a relayer by network and chain id

func NewID added in v2.5.0

func NewID(n Network, c ChainID) (ID, error)

func (*ID) Name added in v2.5.0

func (i *ID) Name() string

func (*ID) String added in v2.5.0

func (i *ID) String() string

func (*ID) UnmarshalString added in v2.5.0

func (i *ID) UnmarshalString(s string) error

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 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].

Jump to

Keyboard shortcuts

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