repository

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: LGPL-3.0 Imports: 9 Imported by: 0

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(blockHash string) (string, error)
	GetBlockHash(blockNumber 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