chainreadinterface

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IAddress

type IAddress interface {
	IAddressHandle
	TxoCount() (int64, error)           // May return a "not supported" error
	NthTxo(n int64) (ITxoHandle, error) // May return a "not supported" error
}

type IAddressHandle

type IAddressHandle interface {
	Height() int64
	Hash() indexedhashes.Sha256
	HeightSpecified() bool
	HashSpecified() bool
}

type IBlock

type IBlock interface {
	IBlockHandle
	TransactionCount() (int64, error)
	NthTransaction(n int64) (ITransHandle, error)
	NonEssentialInts() (*map[string]int64, error)
}

type IBlockChain

type IBlockChain interface {
	IBlockTree
	LatestBlock() (IBlockHandle, error)
	NextBlock(block IBlockHandle) (IBlockHandle, error)
	LatestTransaction() (ITransHandle, error)
	NextTransaction(trans ITransHandle) (ITransHandle, error)
}

type IBlockHandle

type IBlockHandle interface {
	Height() int64
	Hash() (indexedhashes.Sha256, error)
	HeightSpecified() bool
	HashSpecified() bool
	IsBlockHandle()
	IsInvalid() bool
}

type IBlockTree

type IBlockTree interface {
	InvalidBlock() IBlockHandle
	InvalidTrans() ITransHandle
	GenesisBlock() IBlockHandle
	ParentBlock(block IBlockHandle) IBlockHandle
	GenesisTransaction() (ITransHandle, error)
	PreviousTransaction(trans ITransHandle) ITransHandle // Todo [  ] Cannot be implemented in some cases
	IsBlockTree() bool
	BlockInterface(IBlockHandle) (IBlock, error)
	TransInterface(ITransHandle) (ITransaction, error)
	TxiInterface(ITxiHandle) (ITxi, error)
	TxoInterface(ITxoHandle) (ITxo, error)
	AddressInterface(IAddressHandle) (IAddress, error)
}

type IHandleCreator

type IHandleCreator interface {
	BlockHandleByHeight(blockHeight int64) (IBlockHandle, error)
	TransactionHandleByHeight(transactionHeight int64) (ITransHandle, error)
	TxiHandleByHeight(txiHeight int64) (ITxiHandle, error)
	TxoHandleByHeight(txoHeight int64) (ITxoHandle, error)
}

IHandleCreator may supply handles, but this doesn't imply existence of the underlying object

type ITransHandle

type ITransHandle interface {
	Height() int64
	Hash() (indexedhashes.Sha256, error)
	IndicesPath() (int64, int64) // Block, trans
	HeightSpecified() bool
	HashSpecified() bool
	IndicesPathSpecified() bool
	IsTransHandle()
	IsInvalid() bool
}

type ITransaction

type ITransaction interface {
	ITransHandle
	TxiCount() (int64, error)
	NthTxi(n int64) (ITxiHandle, error)
	TxoCount() (int64, error)
	NthTxo(n int64) (ITxoHandle, error)
	NonEssentialInts() (*map[string]int64, error)
}

type ITxi

type ITxi interface {
	ITxiHandle
	SourceTxo() (ITxoHandle, error)
}

type ITxiHandle

type ITxiHandle interface {
	ParentTrans() ITransHandle
	ParentIndex() int64
	TxiHeight() int64
	IndicesPath() (int64, int64, int64) // Block, Trans, Vin
	ParentSpecified() bool
	TxiHeightSpecified() bool
	IndicesPathSpecified() bool
}

type ITxo

type ITxo interface {
	ITxoHandle
	Satoshis() (int64, error)
	Address() (IAddressHandle, error)
}

type ITxoHandle

type ITxoHandle interface {
	ParentTrans() ITransHandle
	ParentIndex() int64
	TxoHeight() int64
	IndicesPath() (int64, int64, int64) // Block, Trans, Vout
	ParentSpecified() bool
	TxoHeightSpecified() bool
	IndicesPathSpecified() bool
}

Jump to

Keyboard shortcuts

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