Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OutpointWatchItem ¶
type OutpointWatchItem struct {
// contains filtered or unexported fields
}
OutpointWatchItem can be used to check if an outpoint is spent by transaction inputs
func NewOutpointWatchItemFromInput ¶
func NewOutpointWatchItemFromInput(input *transaction.TxInput, prevoutScript []byte) (*OutpointWatchItem, error)
func (*OutpointWatchItem) Bytes ¶
func (i *OutpointWatchItem) Bytes() []byte
func (*OutpointWatchItem) Match ¶
func (i *OutpointWatchItem) Match(tx *transaction.Transaction) bool
type Report ¶
type Report struct { // Transaction is the transaction that includes the item that was found. Transaction *transaction.Transaction // BlockHash is the block hash of the block that includes the transaction. BlockHash *chainhash.Hash BlockHeight uint32 // the request resolved by the report Request *ScanRequest }
type ScanRequest ¶
type ScanRequestOption ¶
type ScanRequestOption func(req *ScanRequest)
func WithPersistentWatch ¶
func WithPersistentWatch() ScanRequestOption
func WithStartBlock ¶
func WithStartBlock(blockHeight uint32) ScanRequestOption
func WithWatchItem ¶
func WithWatchItem(item WatchItem) ScanRequestOption
type ScannerService ¶
type ScannerService interface { // Start runs a go-routine in order to handle incoming requests via Watch Start() (<-chan Report, error) // Stop the scanner Stop() // Watch add a new request to the queue Watch(...ScanRequestOption) // WatchDescriptorWallet imports wallet descriptor, generates scripts and which //for specific events for those scripts WatchDescriptorWallet( descriptor string, eventType []EventType, blockStart int, ) error }
func New ¶
func New( filterDB repository.FilterRepository, headerDB repository.BlockHeaderRepository, blockSvc blockservice.BlockService, genesisHash *chainhash.Hash, ) ScannerService
type ScriptWatchItem ¶
type ScriptWatchItem struct {
// contains filtered or unexported fields
}
ScriptWatchItem is used to check if a transaction sends funds to a script
func (*ScriptWatchItem) Bytes ¶
func (i *ScriptWatchItem) Bytes() []byte
func (*ScriptWatchItem) Match ¶
func (i *ScriptWatchItem) Match(tx *transaction.Transaction) bool
type WatchItem ¶
type WatchItem interface { // Bytes returns the element search in the block filter Bytes() []byte // Match is used to check if a transaction matches the watch item Match(tx *transaction.Transaction) bool }
WatchItem is an interface containing the common methods using by Scanner to watch specific item.
Click to show internal directories.
Click to hide internal directories.