data

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const StatusParseErr = StatusErr("Invalid status")

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain added in v0.1.7

type Chain struct {
	AddrURLFmt  string
	BlockURLFmt string
	TxURLFmt    string

	ID        graphql.ID
	ChainID   hexutil.Big
	DisplayID Long
	Name      string
	LogoURL   string
}

Define the Go struct for the Chain type.

func EntChainToGraphQLChain added in v0.1.3

func EntChainToGraphQLChain(chain *ent.Chain) Chain

func (*Chain) AddrUrl added in v0.1.8

func (c *Chain) AddrUrl(addr common.Address) string

func (*Chain) BlockURL added in v0.1.8

func (c *Chain) BlockURL(height uint64) string

func (*Chain) TxUrl added in v0.1.8

func (c *Chain) TxUrl(tx common.Hash) string

type Chainer added in v0.1.7

type Chainer interface {
	Chain(id string) (Chain, bool)
}

type ChainsProvider added in v0.1.7

type ChainsProvider struct {
	// contains filtered or unexported fields
}

func NewChainsProvider added in v0.1.7

func NewChainsProvider(network netconf.ID) *ChainsProvider

NewChainsProvider creates a new ChainsProvider instance with the chains for the given network (e.g. "devnet", "testnet" or "mainnet").

func (*ChainsProvider) Chain added in v0.1.7

func (p *ChainsProvider) Chain(id string) (Chain, bool)

func (*ChainsProvider) ChainList added in v0.1.7

func (p *ChainsProvider) ChainList() []Chain

type Long added in v0.1.7

type Long uint64

Implements the graphql.Marshaler interface for the Long type using base-10 numbers.

func (Long) ImplementsGraphQLType added in v0.1.7

func (Long) ImplementsGraphQLType(name string) bool

func (Long) MarshalJSON added in v0.1.7

func (l Long) MarshalJSON() ([]byte, error)

func (*Long) UnmarshalGraphQL added in v0.1.7

func (l *Long) UnmarshalGraphQL(input any) error

type PageInfo added in v0.1.7

type PageInfo struct {
	HasNextPage bool
	HasPrevPage bool
	TotalPages  Long
	CurrentPage Long
}

Define the Go struct for the PageInfo type.

type Provider

type Provider struct {
	*ChainsProvider

	*StatsProvider
	// contains filtered or unexported fields
}

func NewProvider added in v0.1.7

func NewProvider(ctx context.Context, cl *ent.Client, network netconf.ID) *Provider

func (Provider) XMsg added in v0.1.3

func (p Provider) XMsg(ctx context.Context, srcChainID, destChainID, offset uint64) (*XMsg, bool, error)

func (Provider) XMsgCount added in v0.1.2

func (p Provider) XMsgCount(ctx context.Context) (*hexutil.Big, bool, error)

func (Provider) XMsgs added in v0.1.4

func (p Provider) XMsgs(ctx context.Context, first, last *int32, before *graphql.ID, after *graphql.ID, filters *XMsgFilters) (XMsgConnection, error)

type RowQuerier added in v0.1.7

type RowQuerier interface {
	QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
}

type StatsProvider added in v0.1.7

type StatsProvider struct {
	// contains filtered or unexported fields
}

StatsProvider provides stats data.

func NewStatsProvider added in v0.1.7

func NewStatsProvider(ctx context.Context, cl *ent.Client, ch Chainer) *StatsProvider

func (*StatsProvider) Stats added in v0.1.7

func (s *StatsProvider) Stats(ctx context.Context) StatsResult

func (*StatsProvider) TotalMsgs added in v0.1.7

func (s *StatsProvider) TotalMsgs() uint64

type StatsResult added in v0.1.7

type StatsResult struct {
	TotalMsgs  Long
	TopStreams []StreamStats
}

Define the Go struct for the StatsResult type.

type Status added in v0.1.7

type Status string

Define the Go struct for the Status enum type.

const (
	StatusFailed  Status = "FAILED"
	StatusPending Status = "PENDING"
	StatusSuccess Status = "SUCCESS"
)

func MustParseStatus added in v0.1.7

func MustParseStatus(s string) Status

func ParseStatus added in v0.1.7

func ParseStatus(s string) (Status, error)

type StatusErr added in v0.1.7

type StatusErr string

func (StatusErr) Error added in v0.1.7

func (s StatusErr) Error() string

type StreamStats added in v0.1.7

type StreamStats struct {
	SourceChain Chain
	DestChain   Chain
	MsgCount    Long
}

Define the Go struct for the StreamStats type.

type XBlock added in v0.1.7

type XBlock struct {
	Chainer
	ID        graphql.ID
	ChainID   hexutil.Big
	Height    hexutil.Big
	Hash      common.Hash
	Messages  []XMsg
	Timestamp graphql.Time
}

Define the Go struct for the XBlock type.

func EntBlockToGraphQLBlock added in v0.1.2

func EntBlockToGraphQLBlock(_ context.Context, block *ent.Block) (*XBlock, error)

EntBlockToGraphQLBlock converts an ent.Block to a XBlock.

func (XBlock) Chain added in v0.1.7

func (b XBlock) Chain() (Chain, error)

func (XBlock) URL added in v0.1.7

func (b XBlock) URL() (string, error)

type XMsg added in v0.1.7

type XMsg struct {
	Chainer

	ID            graphql.ID
	Block         XBlock
	To            common.Address
	Data          hexutil.Bytes
	DestChainID   hexutil.Big
	GasLimit      hexutil.Big
	DisplayID     string
	Offset        hexutil.Big
	Receipt       *XReceipt
	Sender        common.Address
	SourceChainID hexutil.Big
	Status        Status
	TxHash        common.Hash
}

Define the Go struct for the XMsg type.

func EntMsgToGraphQLXMsg added in v0.1.2

func EntMsgToGraphQLXMsg(msg *ent.Msg) (*XMsg, error)

EntMsgToGraphQLXMsg converts an ent.Msg to a XMsg.

func EntMsgToGraphQLXMsgWithEdges added in v0.1.4

func EntMsgToGraphQLXMsgWithEdges(ctx context.Context, msg *ent.Msg) (*XMsg, error)

EntMsgToGraphQLXMsg converts an ent.Msg to a XMsg.

func (XMsg) DestChain added in v0.1.7

func (m XMsg) DestChain() (Chain, error)

func (XMsg) SenderURL added in v0.1.7

func (m XMsg) SenderURL() string

func (XMsg) SourceChain added in v0.1.7

func (m XMsg) SourceChain() (Chain, error)

func (XMsg) ToURL added in v0.1.7

func (m XMsg) ToURL() string

func (XMsg) TxURL added in v0.1.7

func (m XMsg) TxURL() string

type XMsgConnection added in v0.1.7

type XMsgConnection struct {
	TotalCount Long
	Edges      []XMsgEdge
	PageInfo   PageInfo
}

Define the Go struct for the XMsgConnection type.

type XMsgEdge added in v0.1.7

type XMsgEdge struct {
	Cursor graphql.ID
	Node   XMsg
}

Define the Go struct for the XMsgEdge type.

type XMsgFilters added in v0.1.7

type XMsgFilters struct {
	SourceChainID *uint64
	DestChainID   *uint64
	Addr          *common.Address
	TxHash        *common.Hash
	Status        *Status
}

type XReceipt added in v0.1.7

type XReceipt struct {
	Chainer
	ID            graphql.ID
	GasUsed       hexutil.Big
	Success       bool
	Relayer       common.Address
	SourceChainID hexutil.Big
	DestChainID   hexutil.Big
	Offset        hexutil.Big
	TxHash        common.Hash
	Timestamp     graphql.Time
	RevertReason  *string
}

Define the Go struct for the XReceipt type.

func EntReceiptToGraphQLXReceipt added in v0.1.2

func EntReceiptToGraphQLXReceipt(ctx context.Context, receipt *ent.Receipt, block *ent.Block) (*XReceipt, error)

EntReceiptToGraphQLXReceipt converts an ent.Receipt to a XReceipt.

func (*XReceipt) DestChain added in v0.1.7

func (r *XReceipt) DestChain() (Chain, error)

func (*XReceipt) SourceChain added in v0.1.7

func (r *XReceipt) SourceChain() (Chain, error)

func (*XReceipt) TxURL added in v0.1.7

func (r *XReceipt) TxURL() string

Jump to

Keyboard shortcuts

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