subscriptions

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: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Beat2Message

type Beat2Message struct {
	Number      uint32             `json:"number"`
	ID          luckyshare.Bytes32 `json:"id"`
	ParentID    luckyshare.Bytes32 `json:"parentID"`
	Timestamp   uint64             `json:"timestamp"`
	TxsFeatures uint32             `json:"txsFeatures"`
	GasLimit    uint64             `json:"gasLimit"`
	Bloom       string             `json:"bloom"`
	K           uint8              `json:"k"`
	Obsolete    bool               `json:"obsolete"`
}

type BeatMessage

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

type BlockMessage

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

BlockMessage block piped by websocket

type EventFilter

type EventFilter struct {
	Address *luckyshare.Address // restricts matches to events created by specific contracts
	Topic0  *luckyshare.Bytes32
	Topic1  *luckyshare.Bytes32
	Topic2  *luckyshare.Bytes32
	Topic3  *luckyshare.Bytes32
	Topic4  *luckyshare.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  luckyshare.Address   `json:"address"`
	Topics   []luckyshare.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        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 Subscriptions

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

func New

func New(repo *chain.Repository, 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  *luckyshare.Address // who send transaction
	Sender    *luckyshare.Address // who transferred tokens
	Recipient *luckyshare.Address // who received tokens
}

TransferFilter contains options for contract transfer filtering.

func (*TransferFilter) Match

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

Match returs whether transfer matches filter

type TransferMessage

type TransferMessage struct {
	Sender    luckyshare.Address    `json:"sender"`
	Recipient luckyshare.Address    `json:"recipient"`
	Amount    *math.HexOrDecimal256 `json:"amount"`
	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