plugin

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HexToDecimal

func HexToDecimal(hex string) (decimal.Decimal, bool)

Types

type BlockNumPlugin

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

func NewBlockNumPlugin

func NewBlockNumPlugin(callback func(uint64, bool)) BlockNumPlugin

func (BlockNumPlugin) AcceptBlock

func (p BlockNumPlugin) AcceptBlock(b *structs.RemovableBlock)

type ERC20TransferPlugin

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

func NewERC20TransferPlugin

func NewERC20TransferPlugin(callback func(tokenAddress, from, to string, amount decimal.Decimal, isRemoved bool)) *ERC20TransferPlugin

func (*ERC20TransferPlugin) Accept

type IBlockPlugin

type IBlockPlugin interface {
	AcceptBlock(block *structs.RemovableBlock)
}

type IReceiptLogPlugin

type IReceiptLogPlugin interface {
	FromContract() string
	InterestedTopics() []string
	NeedReceiptLog(receiptLog *structs.RemovableReceiptLog) bool
	Accept(receiptLog *structs.RemovableReceiptLog)
}

type ITxPlugin

type ITxPlugin interface {
	AcceptTx(transaction structs.RemovableTx)
}

type ITxReceiptPlugin

type ITxReceiptPlugin interface {
	Accept(tx *structs.RemovableTxAndReceipt)
}

type ReceiptLogPlugin

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

func NewReceiptLogPlugin

func NewReceiptLogPlugin(
	contract string,
	topics []string,
	callback func(receiptLog *structs.RemovableReceiptLog),
) *ReceiptLogPlugin

func (*ReceiptLogPlugin) Accept

func (p *ReceiptLogPlugin) Accept(receiptLog *structs.RemovableReceiptLog)

func (*ReceiptLogPlugin) FromContract

func (p *ReceiptLogPlugin) FromContract() string

func (*ReceiptLogPlugin) InterestedTopics

func (p *ReceiptLogPlugin) InterestedTopics() []string

func (*ReceiptLogPlugin) NeedReceiptLog

func (p *ReceiptLogPlugin) NeedReceiptLog(receiptLog *structs.RemovableReceiptLog) bool

simplified version of specifying topic filters https://github.com/ethereum/wiki/wiki/JSON-RPC#a-note-on-specifying-topic-filters

type SimpleBlockPlugin

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

provide block info with tx basic infos

func NewSimpleBlockPlugin

func NewSimpleBlockPlugin(callback func(block *structs.RemovableBlock)) SimpleBlockPlugin

func (SimpleBlockPlugin) AcceptBlock

func (p SimpleBlockPlugin) AcceptBlock(b *structs.RemovableBlock)

type TransferEvent

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

type TxHashPlugin

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

func NewTxHashPlugin

func NewTxHashPlugin(callback func(txHash string, isRemoved bool)) TxHashPlugin

func (TxHashPlugin) AcceptTx

func (p TxHashPlugin) AcceptTx(transaction structs.RemovableTx)

type TxPlugin

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

func NewTxPlugin

func NewTxPlugin(callback func(tx structs.RemovableTx)) TxPlugin

func (TxPlugin) AcceptTx

func (p TxPlugin) AcceptTx(transaction structs.RemovableTx)

type TxReceiptPlugin

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

func NewTxReceiptPlugin

func NewTxReceiptPlugin(callback func(tx *structs.RemovableTxAndReceipt)) *TxReceiptPlugin

func (TxReceiptPlugin) Accept

type TxReceiptPluginWithFilter

type TxReceiptPluginWithFilter struct {
	ITxReceiptPlugin
	// contains filtered or unexported fields
}

func NewTxReceiptPluginWithFilter

func NewTxReceiptPluginWithFilter(
	callback func(tx *structs.RemovableTxAndReceipt),
	filterFunc func(transaction blockchain.Transaction) bool) *TxReceiptPluginWithFilter

func (TxReceiptPluginWithFilter) NeedReceipt

Jump to

Keyboard shortcuts

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