harvester

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	GetLastBlockNumber() (uint64, error)
	GetTokenBalance(contract *common.Address, wallet *common.Address, blockNumber uint64) (*big.Int, uint64, error)
	GetNFTBalance(nftContract *common.Address, wallet *common.Address, block uint64) ([]common.Hash, error)
	GetEtherBalance(wallet *common.Address, block uint64) (*big.Int, error)
	GetTokenLogs(fromBlock, toBlock uint64, addresses []common.Address) ([]any, error)
	GetNFTLogs(fromBlock, toBlock uint64, contracts []common.Address) ([]any, error)
	GetEtherLogs(fromBlock, toBlock uint64, wallets map[common.Address]bool) ([]ChangeEtherLog, error)
	RegisterNewBlockListener(f AdapterListener)
	Run()
	GetInfo() (umid umid.UMID, name string, rpcURL string)
}

type AdapterListener

type AdapterListener func(blockNumber uint64)

type ChangeEtherLog added in v0.5.6

type ChangeEtherLog struct {
	Block  uint64
	Wallet common.Address
	Delta  *big.Int
}

type DB added in v0.5.6

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

func NewDB added in v0.5.6

func NewDB(updates <-chan any, db *pgxpool.Pool, logger *zap.SugaredLogger, blockchainID umid.UMID, blockchainName string) *DB

func (*DB) Run added in v0.5.6

func (db *DB) Run()

type DoInit added in v0.5.6

type DoInit struct {
}

type Ethers added in v0.5.6

type Ethers struct {
	SubscribeQueue  *SubscribeQueue
	DB              *DB
	DefaultContract common.Address
	// contains filtered or unexported fields
}

func NewEthers added in v0.5.6

func NewEthers(db *pgxpool.Pool, adapter Adapter, logger *zap.SugaredLogger, output chan<- UpdateCell) *Ethers

func (*Ethers) AddWallet added in v0.5.6

func (e *Ethers) AddWallet(wallet common.Address) error

func (*Ethers) Run added in v0.5.6

func (e *Ethers) Run() error

type FlushEthersToDB added in v0.5.6

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

type FlushNFTToDB added in v0.5.6

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

type FlushToDB added in v0.5.6

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

type Harvester

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

func NewHarvester

func NewHarvester(updateCells chan UpdateCell, pool *pgxpool.Pool, adapter Adapter, logger *zap.SugaredLogger) *Harvester

func (*Harvester) AddNFTContract added in v0.5.6

func (h *Harvester) AddNFTContract(contract common.Address) error

func (*Harvester) AddTokenContract added in v0.5.6

func (h *Harvester) AddTokenContract(tokenContract common.Address) error

func (*Harvester) AddWallet added in v0.5.6

func (h *Harvester) AddWallet(wallet common.Address) error

func (*Harvester) Run

func (h *Harvester) Run() error

type NFTCell added in v0.5.6

type NFTCell struct {
	Contract common.Address
	Wallet   common.Address
	ItemID   common.Hash
	Block    uint64
}

type NFTs added in v0.5.6

type NFTs struct {
	SubscribeQueue *SubscribeQueue
	DB             *DB
	// contains filtered or unexported fields
}

func NewNFTs added in v0.5.6

func NewNFTs(db *pgxpool.Pool, adapter Adapter, logger *zap.SugaredLogger, output chan<- UpdateCell) *NFTs

func (*NFTs) AddContract added in v0.5.6

func (n *NFTs) AddContract(contract common.Address) error

func (*NFTs) AddWallet added in v0.5.6

func (n *NFTs) AddWallet(wallet common.Address) error

func (*NFTs) Run added in v0.5.6

func (n *NFTs) Run() error

type NewBlock

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

type QueueInit added in v0.5.6

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

type RemoveNFTFromDB added in v0.5.6

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

type SubscribeQueue added in v0.5.6

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

func NewSubscribeQueue added in v0.5.6

func NewSubscribeQueue(updates chan any) *SubscribeQueue

func (*SubscribeQueue) AddContract added in v0.5.6

func (q *SubscribeQueue) AddContract(contract common.Address) error

func (*SubscribeQueue) AddWallet added in v0.5.6

func (q *SubscribeQueue) AddWallet(wallet common.Address) error

func (*SubscribeQueue) MarkAsLoadedFromDB added in v0.5.6

func (q *SubscribeQueue) MarkAsLoadedFromDB(contract, wallet common.Address)

type TokenCell added in v0.5.6

type TokenCell struct {
	Contract common.Address
	Wallet   common.Address
	Value    *big.Int
	Block    uint64
}

type Tokens added in v0.5.6

type Tokens struct {
	SubscribeQueue *SubscribeQueue
	DB             *DB
	// contains filtered or unexported fields
}

func NewTokens added in v0.5.6

func NewTokens(db *pgxpool.Pool, adapter Adapter, logger *zap.SugaredLogger, output chan<- UpdateCell) *Tokens

func (*Tokens) AddContract added in v0.5.6

func (t *Tokens) AddContract(contract common.Address) error

func (*Tokens) AddWallet added in v0.5.6

func (t *Tokens) AddWallet(wallet common.Address) error

func (*Tokens) Run added in v0.5.6

func (t *Tokens) Run() error

type TransferERC20Log

type TransferERC20Log struct {
	Block    uint64
	From     common.Address
	To       common.Address
	Value    *big.Int
	Contract common.Address
}

type TransferNFTLog

type TransferNFTLog struct {
	Block    uint64
	From     common.Address
	To       common.Address
	TokenID  common.Hash
	Contract common.Address
}

type UpdateCell added in v0.5.6

type UpdateCell struct {
	Contract common.Address
	Wallet   common.Address
	Value    *big.Int
	IDs      []common.Hash
	Block    uint64
}

type UpdateNFTEvent added in v0.5.6

type UpdateNFTEvent struct {
	Contract common.Address
	Wallet   common.Address
	IDs      []common.Hash
}

type UpsertEtherToDB added in v0.5.6

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

type UpsertNFTToDB added in v0.5.6

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

type UpsertTokenToDB added in v0.5.6

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

Jump to

Keyboard shortcuts

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