subscriptions

package
v0.0.0-...-71e40f4 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeatMessage

type BeatMessage struct {
	Number    uint32        `json:"number"`
	ID        meter.Bytes32 `json:"id"`
	ParentID  meter.Bytes32 `json:"parentID"`
	Timestamp uint64        `json:"timestamp"`
	Bloom     string        `json:"bloom"`
	K         uint32        `json:"k"`
	Obsolete  bool          `json:"obsolete"`
}

type BlockMessage

type BlockMessage struct {
	Number       uint32          `json:"number"`
	ID           meter.Bytes32   `json:"id"`
	Size         uint32          `json:"size"`
	ParentID     meter.Bytes32   `json:"parentID"`
	Timestamp    uint64          `json:"timestamp"`
	GasLimit     uint64          `json:"gasLimit"`
	Beneficiary  meter.Address   `json:"beneficiary"`
	GasUsed      uint64          `json:"gasUsed"`
	TotalScore   uint64          `json:"totalScore"`
	TxsRoot      meter.Bytes32   `json:"txsRoot"`
	StateRoot    meter.Bytes32   `json:"stateRoot"`
	ReceiptsRoot meter.Bytes32   `json:"receiptsRoot"`
	Signer       meter.Address   `json:"signer"`
	Transactions []meter.Bytes32 `json:"transactions"`
	Obsolete     bool            `json:"obsolete"`
}

BlockMessage block piped by websocket

type EventFilter

type EventFilter struct {
	Address *meter.Address // restricts matches to events created by specific contracts
	Topic0  *meter.Bytes32
	Topic1  *meter.Bytes32
	Topic2  *meter.Bytes32
	Topic3  *meter.Bytes32
	Topic4  *meter.Bytes32
}

EventFilter contains options for contract event filtering.

func (*EventFilter) Match

func (ef *EventFilter) Match(event *tx.Event) bool

Match returs whether event matches filter

type EventMessage

type EventMessage struct {
	Address  meter.Address   `json:"address"`
	Topics   []meter.Bytes32 `json:"topics"`
	Data     string          `json:"data"`
	Meta     LogMeta         `json:"meta"`
	Obsolete bool            `json:"obsolete"`
}

EventMessage event piped by websocket

type LogMeta

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

type Subscriptions

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

func New

func New(chain *chain.Chain, allowedOrigins []string, backtraceLimit uint32) *Subscriptions

func (*Subscriptions) Close

func (s *Subscriptions) Close()

func (*Subscriptions) Mount

func (s *Subscriptions) Mount(root *mux.Router, pathPrefix string)

type TransferFilter

type TransferFilter struct {
	TxOrigin  *meter.Address // who send transaction
	Sender    *meter.Address // who transferred tokens
	Recipient *meter.Address // who received tokens
}

TransferFilter contains options for contract transfer filtering.

func (*TransferFilter) Match

func (tf *TransferFilter) Match(transfer *tx.Transfer, origin meter.Address) bool

Match returs whether transfer matches filter

type TransferMessage

type TransferMessage struct {
	Sender    meter.Address         `json:"sender"`
	Recipient meter.Address         `json:"recipient"`
	Amount    *math.HexOrDecimal256 `json:"amount"`
	Token     byte                  `json:"token"`
	Meta      LogMeta               `json:"meta"`
	Obsolete  bool                  `json:"obsolete"`
}

TransferMessage transfer piped by websocket

Jump to

Keyboard shortcuts

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