l1

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(l1 Subscriber, chain *blockchain.Blockchain, log utils.SimpleLogger) *Client

func (*Client) Run

func (c *Client) Run(ctx context.Context) error

func (*Client) WithEventListener added in v0.7.5

func (c *Client) WithEventListener(l EventListener) *Client

func (*Client) WithPollFinalisedInterval added in v0.6.0

func (c *Client) WithPollFinalisedInterval(delay time.Duration) *Client

WithPollFinalisedInterval sets the time to wait before checking for an update to the finalised L1 block.

func (*Client) WithResubscribeDelay added in v0.6.0

func (c *Client) WithResubscribeDelay(delay time.Duration) *Client

type EthSubscriber

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

func NewEthSubscriber

func NewEthSubscriber(ethClientAddress string, coreContractAddress common.Address) (*EthSubscriber, error)

func (*EthSubscriber) ChainID

func (s *EthSubscriber) ChainID(ctx context.Context) (*big.Int, error)

func (*EthSubscriber) Close

func (s *EthSubscriber) Close()

func (*EthSubscriber) FinalisedHeight

func (s *EthSubscriber) FinalisedHeight(ctx context.Context) (uint64, error)

func (*EthSubscriber) WatchLogStateUpdate

func (s *EthSubscriber) WatchLogStateUpdate(ctx context.Context, sink chan<- *contract.StarknetLogStateUpdate) (event.Subscription, error)

type EventListener added in v0.7.5

type EventListener interface {
	OnNewL1Head(head *core.L1Head)
}

type SelectiveListener added in v0.7.5

type SelectiveListener struct {
	OnNewL1HeadCb func(head *core.L1Head)
}

func (SelectiveListener) OnNewL1Head added in v0.7.5

func (l SelectiveListener) OnNewL1Head(head *core.L1Head)

type Subscriber

type Subscriber interface {
	FinalisedHeight(ctx context.Context) (uint64, error)
	WatchLogStateUpdate(ctx context.Context, sink chan<- *contract.StarknetLogStateUpdate) (event.Subscription, error)
	ChainID(ctx context.Context) (*big.Int, error)

	Close()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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