channels

package
v0.0.0-...-70034fb Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultEventsChanLen = 256

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockCreation

type BlockCreation struct {
	Block uint64
}

type Event

type Event struct {
	Type EventType

	BlockCreation  *BlockCreation
	PairCreation   *PairCreation
	ReservesUpdate *ReservesUpdate
}

type EventChan

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

func NewEventChan

func NewEventChan() *EventChan

func (*EventChan) Receive

func (e *EventChan) Receive(ctx context.Context) (<-chan Event, error)

func (*EventChan) Send

func (e *EventChan) Send(ctx context.Context, events ...Event) error

Send implements EventQueue

type EventQueue

type EventQueue interface {
	Send(ctx context.Context, events ...Event) error
	Receive(ctx context.Context) (<-chan Event, error)
}

type EventType

type EventType int
const (
	PairCreationEvent EventType = iota + 1
	BlockCreationEvent
	ReservesUpdateEvent
)

type PairCreation

type PairCreation struct {
	Address            common.Address
	Token0, Token1     common.Address
	Reserve0, Reserve1 *big.Int
}

PairCreation - event of pair creation in factory contract

type ReservesUpdate

type ReservesUpdate struct {
	Address        common.Address
	Token0, Token1 common.Address
	Reserve0Delta  *big.Int
	Reserve1Delta  *big.Int
}

ReservesUpdate - event of that reserves in UniswapV2 pair were updated. All fields represent the change (difference) between old and new state. All could be nil, but not all at the same time.

Jump to

Keyboard shortcuts

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