subscriptions

package
v0.0.0-...-75aef46 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: GPL-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        powerplay.Bytes32 `json:"id"`
	ParentID  powerplay.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           powerplay.Bytes32   `json:"id"`
	Size         uint32              `json:"size"`
	ParentID     powerplay.Bytes32   `json:"parentID"`
	Timestamp    uint64              `json:"timestamp"`
	GasLimit     uint64              `json:"gasLimit"`
	Beneficiary  powerplay.Address   `json:"beneficiary"`
	GasUsed      uint64              `json:"gasUsed"`
	TotalScore   uint64              `json:"totalScore"`
	TxsRoot      powerplay.Bytes32   `json:"txsRoot"`
	StateRoot    powerplay.Bytes32   `json:"stateRoot"`
	ReceiptsRoot powerplay.Bytes32   `json:"receiptsRoot"`
	Signer       powerplay.Address   `json:"signer"`
	Transactions []powerplay.Bytes32 `json:"transactions"`
	Obsolete     bool                `json:"obsolete"`
}

BlockMessage block piped by websocket

type EventFilter

type EventFilter struct {
	Address *powerplay.Address // restricts matches to events created by specific contracts
	Topic0  *powerplay.Bytes32
	Topic1  *powerplay.Bytes32
	Topic2  *powerplay.Bytes32
	Topic3  *powerplay.Bytes32
	Topic4  *powerplay.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  powerplay.Address   `json:"address"`
	Topics   []powerplay.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        powerplay.Bytes32 `json:"blockID"`
	BlockNumber    uint32            `json:"blockNumber"`
	BlockTimestamp uint64            `json:"blockTimestamp"`
	TxID           powerplay.Bytes32 `json:"txID"`
	TxOrigin       powerplay.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  *powerplay.Address // who send transaction
	Sender    *powerplay.Address // who transferred tokens
	Recipient *powerplay.Address // who received tokens
}

TransferFilter contains options for contract transfer filtering.

func (*TransferFilter) Match

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

Match returs whether transfer matches filter

type TransferMessage

type TransferMessage struct {
	Sender    powerplay.Address     `json:"sender"`
	Recipient powerplay.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