events

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AddressBatchSize int `help:"number of Addresses to fetch new events for in a single request" default:"100"`
	BlockBatchSize   int `help:"number of blocks to fetch new events for in a single request" default:"5000"`
	ChainReorgBuffer int `help:"minimum number of blocks to re-query for when looking for new transfer events" default:"15"`
	MaximumQuerySize int `help:"maximum number of blocks prior to the latest block that storjscan can query for" default:"10000"`
}

Config is a configuration struct for the transfer events service.

type Service added in v1.0.8

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

Service for blockchain transfer events.

func NewEventsService added in v1.0.8

func NewEventsService(log *zap.Logger, walletsDB wallets.DB, config Config) *Service

NewEventsService creates a new transfer events service.

func (*Service) GetForAddress added in v1.0.8

func (events *Service) GetForAddress(ctx context.Context, endpoints []common.EthEndpoint, address []common.Address, from map[int64]int64) (map[int64]blockchain.Header, []TransferEvent, error)

GetForAddress returns with the latest transfer events from the blockchain for a given address.

func (*Service) GetForSatellite added in v1.0.8

func (events *Service) GetForSatellite(ctx context.Context, endpoints []common.EthEndpoint, satelliteID string, from map[int64]int64) (map[int64]blockchain.Header, []TransferEvent, error)

GetForSatellite returns with the latest transfer events from the blockchain for a given satellite.

type TransferEvent

type TransferEvent struct {
	ChainID     int64
	From        common.Address
	To          common.Address
	BlockHash   common.Hash
	BlockNumber int64
	TxHash      common.Hash
	LogIndex    int
	TokenValue  currency.Amount
}

TransferEvent holds a transfer event raised by an ERC20 contract.

Jump to

Keyboard shortcuts

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