watcher

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package watcher provides tools to track events emitted from ethereum contracts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventFilter

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

EventFilter filters the chain for specific events (logs). When it finds a desired log, it puts it into its outbound channel.

func NewEventFilter

func NewEventFilter(
	ctx context.Context,
	ec *ethclient.Client,
	contract ethcommon.Address,
	fromBlock *big.Int,
	topic ethcommon.Hash,
	logCh chan<- ethtypes.Log,
) *EventFilter

NewEventFilter returns a new *EventFilter.

func (*EventFilter) Start

func (f *EventFilter) Start() error

Start starts the EventFilter. It watches the chain for logs.

func (*EventFilter) Stop

func (f *EventFilter) Stop()

Stop stops the EventFilter.

Jump to

Keyboard shortcuts

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