events

package
v0.0.0-...-83a01c7 Latest Latest
Warning

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

Go to latest
Published: May 2, 2021 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertRange

func ConvertRange(chain *chain.Chain, r *Range) (*logdb.Range, error)

Types

type EventCriteria

type EventCriteria struct {
	Address *luckyshare.Address `json:"address"`
	TopicSet
}

type EventFilter

type EventFilter struct {
	CriteriaSet []*EventCriteria `json:"criteriaSet"`
	Range       *Range           `json:"range"`
	Options     *logdb.Options   `json:"options"`
	Order       logdb.Order      `json:"order"`
}

type Events

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

func New

func New(repo *chain.Repository, db *logdb.LogDB) *Events

func (*Events) Mount

func (e *Events) Mount(root *mux.Router, pathPrefix string)

type FilteredEvent

type FilteredEvent struct {
	Address luckyshare.Address    `json:"address"`
	Topics  []*luckyshare.Bytes32 `json:"topics"`
	Data    string                `json:"data"`
	Meta    LogMeta               `json:"meta"`
}

FilteredEvent only comes from one contract

func (*FilteredEvent) String

func (e *FilteredEvent) String() string

type LogMeta

type LogMeta struct {
	BlockID        luckyshare.Bytes32 `json:"blockID"`
	BlockNumber    uint32             `json:"blockNumber"`
	BlockTimestamp uint64             `json:"blockTimestamp"`
	TxID           luckyshare.Bytes32 `json:"txID"`
	TxOrigin       luckyshare.Address `json:"txOrigin"`
	ClauseIndex    uint32             `json:"clauseIndex"`
}

type Range

type Range struct {
	Unit RangeType
	From uint64
	To   uint64
}

type RangeType

type RangeType string
const (
	BlockRangeType RangeType = "block"
	TimeRangeType  RangeType = "time"
)

type TopicSet

type TopicSet struct {
	Topic0 *luckyshare.Bytes32 `json:"topic0"`
	Topic1 *luckyshare.Bytes32 `json:"topic1"`
	Topic2 *luckyshare.Bytes32 `json:"topic2"`
	Topic3 *luckyshare.Bytes32 `json:"topic3"`
	Topic4 *luckyshare.Bytes32 `json:"topic4"`
}

Jump to

Keyboard shortcuts

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