accountsevent

package
v0.180.29 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountsChangeCb added in v0.170.0

type AccountsChangeCb func(changedAddresses []common.Address, eventType EventType, currentAddresses []common.Address)

type Event

type Event struct {
	Type     EventType        `json:"type"`
	Accounts []common.Address `json:"accounts"`
}

Event is a type for accounts events.

type EventType

type EventType string

EventType type for event types.

const (
	// EventTypeAdded is emitted when a new account is added.
	EventTypeAdded EventType = "added"
	// EventTypeRemoved is emitted when an account is removed.
	EventTypeRemoved EventType = "removed"
)

type Watcher added in v0.170.0

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

Watcher executes a given callback whenever an account gets added/removed

func NewWatcher added in v0.170.0

func NewWatcher(accountsDB *accounts.Database, accountFeed *event.Feed, callback AccountsChangeCb) *Watcher

func (*Watcher) Start added in v0.170.0

func (w *Watcher) Start()

func (*Watcher) Stop added in v0.170.0

func (w *Watcher) Stop()

Jump to

Keyboard shortcuts

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