btc

package
v0.0.0-...-74a5c12 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Leave XOR-key empty
	MEMPOOL_DUMP_VERSION_NO_XOR_KEY = 1
	MEMPOOL_DUMP_VERSION            = 2
)

Variables

This section is empty.

Functions

func NewAddressFromPubKeyStr

func NewAddressFromPubKeyStr(netParam *chaincfg.Params, pubKeyHex string, addressType AddressType) (string, error)

func NewAddressWithPubKey

func NewAddressWithPubKey(netParam *chaincfg.Params, pubKey *btcec.PublicKey, compressed bool,
	addrType AddressType) (btcutil.Address, error)

NewAddressWithPubKey returns a new address based on the passed account, public key, and whether or not the public key should be compressed.

Types

type AddressType

type AddressType uint8

AddressType represents the various address types waddrmgr is currently able to generate, and maintain.

NOTE: These MUST be stable as they're used for scope address schema recognition within the database.

const (
	// PubKeyHash is a regular p2pkh address.
	PubKeyHash AddressType = iota

	// Script reprints a raw script address.
	Script

	// RawPubKey is just raw public key to be used within scripts, This
	// type indicates that a scoped manager with this address type
	// shouldn't be consulted during historical rescans.
	RawPubKey

	// NestedWitnessPubKey represents a p2wkh output nested within a p2sh
	// output. Using this address type, the wallet can receive funds from
	// other wallet's which don't yet recognize the new segwit standard
	// output types. Receiving funds to this address maintains the
	// scalability, and malleability fixes due to segwit in a backwards
	// compatible manner.
	NestedWitnessPubKey

	// WitnessPubKey represents a p2wkh (pay-to-witness-key-hash) address
	// type.
	WitnessPubKey

	// WitnessScript represents a p2wsh (pay-to-witness-script-hash) address
	// type.
	WitnessScript

	// TaprootPubKey represents a p2tr (pay-to-taproot) address type that
	// uses BIP-0086 (for the derivation path and for calculating the tap
	// root hash/tweak).
	TaprootPubKey

	// TaprootScript represents a p2tr (pay-to-taproot) address type that
	// commits to a script and not just a single key.
	TaprootScript
)

type FileHeader

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

FileHeader represents the mempool file header

func (FileHeader) GetTxCount

func (header FileHeader) GetTxCount() int64

GetTxCount returns the number of transactions in the corresponding file

func (FileHeader) GetVersion

func (header FileHeader) GetVersion() int64

GetVersion returns the mempool file version

func (FileHeader) String

func (header FileHeader) String() string

returns the version and the number of transactions in the file

type Mempool

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

Mempool represents a parsed mempool.dat file

func ReadMempoolFromPath

func ReadMempoolFromPath(path string) (mem Mempool, err error)

ReadMempoolFromPath reads a mempool file from a given path and returns a Mempool type

func (Mempool) GetFileHeader

func (mempool Mempool) GetFileHeader() FileHeader

GetFileHeader returns a the mempool file header

func (Mempool) GetMapDeltas

func (mempool Mempool) GetMapDeltas() []byte

GetMapDeltas returns a byte slice of not parsed mapDelta entries

func (Mempool) GetMempoolEntries

func (mempool Mempool) GetMempoolEntries() []MempoolEntry

GetMempoolEntries returns a slice with mempool entries

type MempoolEntry

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

MempoolEntry represents a mempool entry

func (MempoolEntry) GetFeeDelta

func (entry MempoolEntry) GetFeeDelta() int64

GetFeeDelta returns feeDelta of the entry

func (MempoolEntry) GetFirstSeen

func (entry MempoolEntry) GetFirstSeen() int64

GetFirstSeen returns the firstSeen time of the entry as timestamp

func (MempoolEntry) Info

func (entry MempoolEntry) Info() string

Info returns a string with information for a given MempoolEntry

func (MempoolEntry) IsSegWit

func (entry MempoolEntry) IsSegWit() bool

func (MempoolEntry) String

func (entry MempoolEntry) String() string

returns the transaction hash of the entry

func (MempoolEntry) Tx

func (entry MempoolEntry) Tx() *wire.MsgTx

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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