walletevent

package
v0.184.50 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MPL-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const InternalEventTypePrefix = "INT-"

EventType prefix to be used for internal events. These events are not forwarded to the client, they are only used within status-go.

Variables

This section is empty.

Functions

func ExtractPayload added in v0.176.3

func ExtractPayload[T any](e Event, payload *T) error

func GetPayload added in v0.176.3

func GetPayload[T any](e Event) (*T, error)

Types

type Event

type Event struct {
	Type        EventType        `json:"type"`
	BlockNumber *big.Int         `json:"blockNumber"`
	Accounts    []common.Address `json:"accounts"`
	Message     string           `json:"message"`
	At          int64            `json:"at"`
	ChainID     uint64           `json:"chainId"`
	RequestID   *int             `json:"requestId,omitempty"`
	// For Internal events only, not serialized
	EventParams interface{}
}

Event is a type for transfer events.

type EventCb added in v0.170.0

type EventCb func(event Event)

type EventType

type EventType string

EventType type for event types.

func (EventType) IsInternal added in v0.170.0

func (t EventType) IsInternal() bool

type Publisher

type Publisher interface {
	Subscribe(interface{}) event.Subscription
}

type SignalsTransmitter

type SignalsTransmitter struct {
	Publisher
	// contains filtered or unexported fields
}

SignalsTransmitter transmits received events as wallet signals.

func (*SignalsTransmitter) Start

func (tmr *SignalsTransmitter) Start() error

Start runs loop in background.

func (*SignalsTransmitter) Stop

func (tmr *SignalsTransmitter) Stop()

Stop stops the loop and waits till it exits.

type Watcher added in v0.170.0

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

Watcher executes a given callback whenever a wallet event gets sent

func NewWatcher added in v0.170.0

func NewWatcher(feed *event.Feed, callback EventCb) *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