mempool

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Request

func Request(method, baseURL, subPath string, requestBody io.Reader) ([]byte, error)

Types

type BTCAPIClient

type BTCAPIClient interface {
	GetRawTransaction(txHash *chainhash.Hash) (*wire.MsgTx, error)
	BroadcastTx(tx *wire.MsgTx) (*chainhash.Hash, error)
	ListUnspent(address btcutil.Address) ([]*UnspentOutput, error)
}

type MempoolClient

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

func NewClient

func NewClient(netParams *chaincfg.Params) *MempoolClient

func (*MempoolClient) BroadcastTx

func (c *MempoolClient) BroadcastTx(tx *wire.MsgTx) (*chainhash.Hash, error)

func (*MempoolClient) GetRawTransaction

func (c *MempoolClient) GetRawTransaction(txHash *chainhash.Hash) (*wire.MsgTx, error)

func (*MempoolClient) GetUtxos

func (c *MempoolClient) GetUtxos(address string) ([]*Utxo, error)

func (*MempoolClient) ListUnspent

func (c *MempoolClient) ListUnspent(address btcutil.Address) ([]*UnspentOutput, error)

type UTXO

type UTXO struct {
	Txid   string `json:"txid"`
	Vout   int    `json:"vout"`
	Status struct {
		Confirmed   bool   `json:"confirmed"`
		BlockHeight int    `json:"block_height"`
		BlockHash   string `json:"block_hash"`
		BlockTime   int64  `json:"block_time"`
	} `json:"status"`
	Value int64 `json:"value"`
}

type UTXOs

type UTXOs []UTXO

UTXOs is a slice of UTXO

type UnspentOutput

type UnspentOutput struct {
	Outpoint *wire.OutPoint
	Output   *wire.TxOut
}

type Utxo

type Utxo struct {
	TxHash   common.Hash
	Index    uint32
	Value    int64
	PkScript []byte
}

Jump to

Keyboard shortcuts

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