Documentation
¶
Index ¶
- type Client
- type EthSubscriber
- func (s *EthSubscriber) ChainID(ctx context.Context) (*big.Int, error)
- func (s *EthSubscriber) Close()
- func (s *EthSubscriber) FilterLogStateUpdate(ctx context.Context, start, end uint64) ([]*contract.StarknetLogStateUpdate, error)
- func (s *EthSubscriber) FinalisedHeight(ctx context.Context) (uint64, error)
- func (s *EthSubscriber) LatestHeight(ctx context.Context) (uint64, error)
- func (s *EthSubscriber) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
- func (s *EthSubscriber) WatchLogStateUpdate(ctx context.Context, sink chan<- *contract.StarknetLogStateUpdate) (event.Subscription, error)
- type EventListener
- type Option
- type SelectiveListener
- type Subscriber
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, logger log.StructuredLogger, opts ...Option, ) *Client
func (*Client) CatchUpL1Head ¶ added in v0.16.1
CatchUpL1Head fetches and writes the latest L1 head to the database. Contrary to Client.Run it doesn't track live updates and finishes on the spot. The client must not be re-used after.
func (*Client) L1 ¶ added in v0.13.0
func (c *Client) L1() Subscriber
type EthSubscriber ¶
type EthSubscriber struct {
// contains filtered or unexported fields
}
func NewEthSubscriber ¶
func NewEthSubscriber( ethClientAddress string, coreContractAddress eth.Address, ) (*EthSubscriber, error)
func (*EthSubscriber) Close ¶
func (s *EthSubscriber) Close()
func (*EthSubscriber) FilterLogStateUpdate ¶ added in v0.16.1
func (s *EthSubscriber) FilterLogStateUpdate( ctx context.Context, start, end uint64, ) ([]*contract.StarknetLogStateUpdate, error)
func (*EthSubscriber) FinalisedHeight ¶
func (s *EthSubscriber) FinalisedHeight(ctx context.Context) (uint64, error)
func (*EthSubscriber) LatestHeight ¶ added in v0.15.2
func (s *EthSubscriber) LatestHeight(ctx context.Context) (uint64, error)
func (*EthSubscriber) TransactionReceipt ¶ added in v0.13.0
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 Option ¶ added in v0.16.1
type Option func(*options)
Option is a functional option for configuring l1 client options.
func WithCatchUpChunkSize ¶ added in v0.16.1
WithCatchUpChunkSize sets the L1 block range per backward eth_getLogs request during the startup catch-up scan.
func WithEventListener ¶ added in v0.16.1
func WithEventListener(l EventListener) Option
func WithPollFinalisedInterval ¶ added in v0.16.1
WithPollFinalisedInterval sets the time to wait before checking for an update to the finalised L1 block.
func WithResubscribeDelay ¶ added in v0.16.1
type SelectiveListener ¶ added in v0.7.5
type SelectiveListener struct {
OnNewL1HeadCb func(head *core.L1Head)
OnL1CallCb func(method string, took time.Duration)
}
func (SelectiveListener) OnL1Call ¶ added in v0.12.3
func (l SelectiveListener) OnL1Call(method string, took time.Duration)
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)
LatestHeight(ctx context.Context) (uint64, error)
WatchLogStateUpdate(ctx context.Context, sink chan<- *contract.StarknetLogStateUpdate) (event.Subscription, error)
FilterLogStateUpdate(
ctx context.Context,
fromBlock,
toBlock uint64,
) ([]*contract.StarknetLogStateUpdate, error)
ChainID(ctx context.Context) (*big.Int, error)
TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
Close()
}
Click to show internal directories.
Click to hide internal directories.