layerzero

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainnetAPI = "https://scan.layerzero-api.com/v1"
	TestnetAPI = "https://scan-testnet.layerzero-api.com/v1"
)

Variables

This section is empty.

Functions

func EIDByChain

func EIDByChain(chainID uint64) (uint32, bool)

Types

type Client

type Client interface {
	GetMessagesByTx(ctx context.Context, txHash string) ([]Message, error)
}

func NewClient

func NewClient(host string) Client

NewClient returns a LayerZero client for the given host.

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
	Code    int    `json:"code"`
}

type Message

type Message struct {
	Pathway Pathway `json:"pathway"`
	Status  Status  `json:"status"`
}

Message is the Message type returned by the LayerZero API. Most of the fields are omitted. Full docs here: https://scan.layerzero-api.com/v1/swagger

func (Message) IsConfirming

func (m Message) IsConfirming() bool

func (Message) IsDelivered

func (m Message) IsDelivered() bool

func (Message) IsFailed

func (m Message) IsFailed() bool

func (Message) IsInFlight

func (m Message) IsInFlight() bool

func (Message) IsPayloadStored

func (m Message) IsPayloadStored() bool

type MessageResponse

type MessageResponse struct {
	Data []Message `json:"data"`
}

type MsgStatus

type MsgStatus string
const (
	MsgStatusUnknown       MsgStatus = "UNKNOWN"        // Unknown status
	MsgStatusConfirming    MsgStatus = "CONFIRMING"     // System confirming the source tx
	MsgStatusInFlight      MsgStatus = "INFLIGHT"       // Inflight to destination
	MsgStatusDelivered     MsgStatus = "DELIVERED"      // Successfully delivered on the destination
	MsgStatusFailed        MsgStatus = "FAILED"         // Tx errored and did not complete
	MsgStatusPayloadStored MsgStatus = "PAYLOAD_STORED" // Ran out of gas, needs to be retried
)

func (MsgStatus) String

func (s MsgStatus) String() string

func (MsgStatus) Verify

func (s MsgStatus) Verify() error

type Pathway

type Pathway struct {
	SrcEid int `json:"srcEid"`
	DstEid int `json:"dstEid"`
}

type Status

type Status struct {
	Name    string `json:"name"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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