orderwatch

package
v5.0.0-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRelevantTopics

func GetRelevantTopics() []common.Hash

GetRelevantTopics returns the OrderWatcher-relevant topics that should be used when filtering the logs retrieved for Ethereum blocks

Types

type Watcher

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

Watcher watches all order-relevant state and handles the state transitions

func New

func New(meshDB *meshdb.MeshDB, blockWatcher *blockwatch.Watcher, orderValidator *ordervalidator.OrderValidator, networkID int, expirationBuffer time.Duration) (*Watcher, error)

New instantiates a new order watcher

func (*Watcher) Add

func (w *Watcher) Add(orderInfo *ordervalidator.AcceptedOrderInfo) error

Add adds a 0x order to the DB and watches it for changes in fillability. It will no-op (and return nil) if the order has already been added.

func (*Watcher) Subscribe

func (w *Watcher) Subscribe(sink chan<- []*zeroex.OrderEvent) event.Subscription

Subscribe allows one to subscribe to the order events emitted by the OrderWatcher. To unsubscribe, simply call `Unsubscribe` on the returned subscription. The sink channel should have ample buffer space to avoid blocking other subscribers. Slow subscribers are not dropped.

func (*Watcher) Watch

func (w *Watcher) Watch(ctx context.Context) error

Watch sets up the event & expiration watchers as well as the cleanup worker. Event watching will require the blockwatch.Watcher to be started first. Watch will block until there is a critical error or the given context is canceled.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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