listener

package
v0.0.0-...-fa704fd Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GoerliStartBlock = uint64(0)
)

Functions

func DiscoverAddresses

func DiscoverAddresses(chainID int64) (postageStamp common.Address, startBlock uint64, found bool)

DiscoverAddresses returns the canonical contracts for this chainID

func New

func New(
	logger logging.Logger,
	ev BlockHeightContractFilterer,
	postageStampAddress common.Address,
	blockTime uint64,
	shutdowner Shutdowner,
) postage.Listener

func ParseEventBatchCreated

func ParseEventBatchCreated(event_arg string) (batchCreatedEvent, error)

func ParseEventBatchDepthIncrease

func ParseEventBatchDepthIncrease(event_arg string) (batchDepthIncreaseEvent, error)

func ParseEventBatchTopup

func ParseEventBatchTopup(event_arg string) (batchTopUpEvent, error)

func ParseEventPriceUpdate

func ParseEventPriceUpdate(event_arg string) (priceUpdateEvent, error)

Types

type BlockHeightContractFilterer

type BlockHeightContractFilterer interface {
	ContractFilterer
	BlockNumber(context.Context) (uint64, error)
}

type ContractFilterer

type ContractFilterer interface {
	// FilterLogs executes a log filter operation, blocking during execution and
	// returning all the results in one batch.
	//
	// TODO(karalabe): Deprecate when the subscription one can return past data too.
	FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)

	// SubscribeFilterLogs creates a background log filtering operation, returning
	// a subscription immediately, which can be used to stream the found events.
	SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)

	GetContractEventsInRange(ctx context.Context, account common.Address, start uint64, to uint64) ([]xwctypes.RpcEventJson, error)
}

type Shutdowner

type Shutdowner interface {
	Shutdown(context.Context) error
}

Shutdowner interface is passed to the listener to shutdown the node if we hit error while listening for blockchain events.

Jump to

Keyboard shortcuts

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