event

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: Apache-2.0 Imports: 7 Imported by: 9 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockContext added in v0.33.0

type BlockContext struct {
	Era          string `json:"era"`
	BlockNumber  uint64 `json:"blockNumber"`
	SlotNumber   uint64 `json:"slotNumber"`
	NetworkMagic uint32 `json:"networkMagic"`
}

func NewBlockContext added in v0.33.0

func NewBlockContext(block ledger.Block, networkMagic uint32) BlockContext

func NewBlockHeaderContext added in v0.33.0

func NewBlockHeaderContext(block ledger.BlockHeader) BlockContext

type BlockEvent added in v0.33.0

type BlockEvent struct {
	Block            ledger.Block     `json:"-"`
	IssuerVkey       string           `json:"issuerVkey"`
	BlockHash        string           `json:"blockHash"`
	BlockCbor        byteSliceJsonHex `json:"blockCbor,omitempty"`
	BlockBodySize    uint64           `json:"blockBodySize"`
	TransactionCount uint64           `json:"transactionCount"`
}

func NewBlockEvent added in v0.33.0

func NewBlockEvent(block ledger.Block, includeCbor bool) BlockEvent

type Event

type Event struct {
	Timestamp time.Time `json:"timestamp"`
	Context   any       `json:"context,omitempty"`
	Payload   any       `json:"payload"`
	Type      string    `json:"type"`
}

func New

func New(
	eventType string,
	timestamp time.Time,
	context, payload any,
) Event

type RollbackEvent added in v0.33.0

type RollbackEvent struct {
	BlockHash  string `json:"blockHash"`
	SlotNumber uint64 `json:"slotNumber"`
}

func NewRollbackEvent added in v0.33.0

func NewRollbackEvent(point ocommon.Point) RollbackEvent

type TransactionContext added in v0.33.0

type TransactionContext struct {
	TransactionHash string `json:"transactionHash"`
	BlockNumber     uint64 `json:"blockNumber"`
	SlotNumber      uint64 `json:"slotNumber"`
	TransactionIdx  uint32 `json:"transactionIdx"`
	NetworkMagic    uint32 `json:"networkMagic"`
}

func NewTransactionContext added in v0.33.0

func NewTransactionContext(
	block ledger.Block,
	tx ledger.Transaction,
	index uint32,
	networkMagic uint32,
) TransactionContext

type TransactionEvent added in v0.33.0

type TransactionEvent struct {
	Transaction     ledger.Transaction            `json:"-"`
	Witnesses       lcommon.TransactionWitnessSet `json:"witnesses,omitempty"`
	Withdrawals     map[string]uint64             `json:"withdrawals,omitempty"`
	Metadata        *cbor.LazyValue               `json:"metadata,omitempty"`
	BlockHash       string                        `json:"blockHash"`
	ReferenceInputs []ledger.TransactionInput     `json:"referenceInputs,omitempty"`
	Certificates    []ledger.Certificate          `json:"certificates,omitempty"`
	Outputs         []ledger.TransactionOutput    `json:"outputs"`
	ResolvedInputs  []ledger.TransactionOutput    `json:"resolvedInputs,omitempty"`
	Inputs          []ledger.TransactionInput     `json:"inputs"`
	TransactionCbor byteSliceJsonHex              `json:"transactionCbor,omitempty"`
	Fee             uint64                        `json:"fee"`
	TTL             uint64                        `json:"ttl,omitempty"`
}

func NewTransactionEvent added in v0.33.0

func NewTransactionEvent(
	block ledger.Block,
	tx ledger.Transaction,
	includeCbor bool,
	resolvedInputs []ledger.TransactionOutput,
) TransactionEvent

Jump to

Keyboard shortcuts

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