getter

package
v0.2.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectOPIDatabase

func ConnectOPIDatabase(config *DatabaseConfig) (*gorm.DB, error)

Types

type DatabaseConfig

type DatabaseConfig struct {
	Host     string
	User     string
	Password string
	DBname   string
	Port     string
}

type OPIOrdGetter

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

func NewOPIOrdGetter

func NewOPIOrdGetter(config *DatabaseConfig) (*OPIOrdGetter, error)

func (*OPIOrdGetter) GetBlockHash

func (opi *OPIOrdGetter) GetBlockHash(blockHeight uint) (string, error)

func (*OPIOrdGetter) GetLatestBlockHeight

func (opi *OPIOrdGetter) GetLatestBlockHeight() (uint, error)

func (*OPIOrdGetter) GetOrdTransfers

func (opi *OPIOrdGetter) GetOrdTransfers(blockHeight uint) ([]OrdTransfer, error)

type OPIOrdGetterTest

type OPIOrdGetterTest struct {
	LatestBlockHeight uint
	BlockHash         map[uint]string
	OrdTransfers      []OrdTransfer
}

func NewOPIOrdGetterTest

func NewOPIOrdGetterTest(config *DatabaseConfig, latestBlockHeight uint, hashedHeight uint) (*OPIOrdGetterTest, error)

func (*OPIOrdGetterTest) GetBlockHash

func (opi *OPIOrdGetterTest) GetBlockHash(blockHeight uint) (string, error)

func (*OPIOrdGetterTest) GetLatestBlockHeight

func (opi *OPIOrdGetterTest) GetLatestBlockHeight() (uint, error)

func (*OPIOrdGetterTest) GetOrdTransfers

func (opi *OPIOrdGetterTest) GetOrdTransfers(blockHeight uint) ([]OrdTransfer, error)

type OrdGetter

type OrdGetter interface {
	GetLatestBlockHeight() (uint, error)
	GetBlockHash(blockHeight uint) (string, error)
	GetOrdTransfers(blockHeight uint) ([]OrdTransfer, error)
}

type OrdTransfer

type OrdTransfer struct {
	ID            uint
	InscriptionID string
	BlockHeight   uint
	OldSatpoint   string
	NewSatpoint   string
	NewPkscript   ord.Pkscript
	NewWallet     ord.Wallet
	SentAsFee     bool
	Content       []byte
	ContentType   string
	ParentID      string
}

TODO: High. Record Old satpoint- Current satpoint to get OrdTransfer from the Bitcoin block directly.

Jump to

Keyboard shortcuts

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