events

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 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

Overview

Package events writes the reporter's JSON-lines events to stdout in the TS reporter's schema.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func U64

func U64(v uint64) string

U64 renders a 64-bit value as a decimal string.

Types

type Absent

type Absent struct {
	Kind        string `json:"kind"`
	ContextSlot string `json:"contextSlot"`
	SlotLimit   string `json:"slotLimit"`
}

Absent is the observed value when Solana holds no finalized status for the transfer.

type AuditUnavailable

type AuditUnavailable struct {
	Alert string `json:"alert"`
	Error string `json:"error"`
}

AuditUnavailable alerts that the audit discovery query failed.

type LightClientChanged

type LightClientChanged struct {
	Alert    string `json:"alert"`
	Previous string `json:"previous"`
	Current  string `json:"current"`
	Slot     string `json:"slot"`
}

LightClientChanged alerts that the Solana light client program changed.

type LightClientMismatch

type LightClientMismatch struct {
	Alert   string `json:"alert"`
	Pinned  string `json:"pinned"`
	Current string `json:"current"`
}

LightClientMismatch alerts that the light client program differs from the pinned one.

type Message

type Message struct {
	TypeURL string `json:"typeUrl"`
	Value   any    `json:"value"`
}

Message is a planned sink message: its type URL and its TS-shaped value.

func MessageOf

func MessageOf(msg sdk.Msg) (Message, error)

MessageOf renders a sink message in the TS reporter's shape.

type Observation

type Observation struct {
	Outcome              int32  `json:"outcome"`
	Slot                 string `json:"slot"`
	TransactionSignature string `json:"transactionSignature"`
}

Observation is the JSON form of a sink observation.

func ObservationOf

func ObservationOf(o sinkv1.Observation) Observation

ObservationOf renders a chain observation with its slot as a decimal string and its signature as base64.

type PassError

type PassError struct {
	Error string `json:"error"`
}

PassError reports a failure of the whole pass.

type Resolved

type Resolved struct {
	Kind        string      `json:"kind"`
	ContextSlot string      `json:"contextSlot"`
	Observation Observation `json:"observation"`
}

Resolved is the observed value when Solana holds a finalized status for the transfer.

type Review

type Review struct {
	ID       string    `json:"id"`
	Mode     string    `json:"mode,omitempty"`
	Audit    bool      `json:"audit"`
	Observed any       `json:"observed"`
	Messages []Message `json:"messages"`
	Alerts   []string  `json:"alerts"`
}

Review is the per-transfer review event. Mode is empty for the audit early exit.

func (Review) MarshalJSON

func (r Review) MarshalJSON() ([]byte, error)

MarshalJSON renders nil Messages and Alerts as empty arrays, like the TS reporter.

type Summary

type Summary struct {
	Scanned            int    `json:"scanned"`
	Audited            int    `json:"audited"`
	Index              string `json:"index"`
	Failures           int    `json:"failures"`
	LightClientProgram string `json:"lightClientProgram"`
}

Summary is the last event of a pass.

type TransferError

type TransferError struct {
	ID    string `json:"id"`
	Error string `json:"error"`
}

TransferError reports a failure while reviewing or sending for one transfer.

type TxHash

type TxHash struct {
	ID              string `json:"id"`
	TransactionHash string `json:"transactionHash"`
}

TxHash reports the hash of a transaction carrying a message of the transfer.

type Writer

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

Writer serializes events as one JSON line each through a single goroutine.

func NewWriter

func NewWriter(out io.Writer) *Writer

NewWriter starts a Writer that writes lines to out.

func (*Writer) Close

func (w *Writer) Close() error

Close drains the queue, flushes the output and returns the first write error.

func (*Writer) Emit

func (w *Writer) Emit(v any)

Emit queues v as one JSON line. It is safe for concurrent use; events emitted after Close are dropped.

Jump to

Keyboard shortcuts

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