events

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: LGPL-3.0 Imports: 11 Imported by: 2

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 *thor.Address `json:"address"`
	TopicSet
}

type EventFilter

type EventFilter struct {
	CriteriaSet []*EventCriteria
	Range       *Range
	Options     *Options
	Order       logdb.Order // default asc
}

type Events

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

func New

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

func (*Events) Mount

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

type FilteredEvent

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

FilteredEvent only comes from one contract

type LogMeta

type LogMeta struct {
	BlockID        thor.Bytes32 `json:"blockID"`
	BlockNumber    uint32       `json:"blockNumber"`
	BlockTimestamp uint64       `json:"blockTimestamp"`
	TxID           thor.Bytes32 `json:"txID"`
	TxOrigin       thor.Address `json:"txOrigin"`
	ClauseIndex    uint32       `json:"clauseIndex"`
	TxIndex        *uint32      `json:"txIndex,omitempty"`
	LogIndex       *uint32      `json:"logIndex,omitempty"`
}

type Options added in v2.2.0

type Options struct {
	Offset         uint64
	Limit          uint64
	IncludeIndexes bool
}

type Range

type Range struct {
	Unit RangeType
	From *uint64 `json:"from,omitempty"`
	To   *uint64 `json:"to,omitempty"`
}

type RangeType

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

type TopicSet

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

Jump to

Keyboard shortcuts

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