repository

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: LGPL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	BLOCK_HASH_PREFIX      = "BH"
	BLOCK_NUMBER_PREFIX    = "BN"
	BLOCK_TIMESTAMP_PREFIX = "BT"
	NFT_OWNERSHIP_PREFIX   = "NO"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockData

type BlockData struct {
	Number []byte
	Hash   []byte
}

type LevelDbRepository

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

func NewLevelDbRepostiory

func NewLevelDbRepostiory(path string, chainId string) *LevelDbRepository

func (*LevelDbRepository) Close

func (repo *LevelDbRepository) Close()

func (*LevelDbRepository) GetBlockHash

func (repo *LevelDbRepository) GetBlockHash(blockNumber string) (string, error)

GetBlockHash implements Repository.

func (*LevelDbRepository) GetBlockNumber

func (repo *LevelDbRepository) GetBlockNumber(blockHash string) (string, error)

GetBlockNumber implements Repository.

func (*LevelDbRepository) GetNftOwnership

func (repo *LevelDbRepository) GetNftOwnership(nftAddessHex string, tokenIdHex string, blockNumberHex string) (string, error)

GetNftOwnership implements Repository.

func (*LevelDbRepository) GetOldestBlock added in v0.0.6

func (repo *LevelDbRepository) GetOldestBlock(timestamp uint64) (BlockData, error)

GetOldestBlock implements Repository.

func (*LevelDbRepository) PutBlockData

func (repo *LevelDbRepository) PutBlockData(hash []byte, number []byte, timestamp uint64, ownershipData []*types.OwnershipTransferEvent) error

PutBlockData implements Repository.

type Repository

type Repository interface {
	PutBlockData(hash []byte, number []byte, timestamp uint64, ownershipData []*types.OwnershipTransferEvent) error

	GetOldestBlock(timestamp uint64) (BlockData, error)
	GetBlockNumber(blockNumber string) (string, error)
	GetBlockHash(blockHash string) (string, error)
	GetNftOwnership(nftAddessHex string, tokenIdHex string, blockNumberHex string) (string, error)
}

Jump to

Keyboard shortcuts

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