explorer

package
v0.0.0-...-da64028 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BitcoinExplorer = "bitcoin"
	LiquidExplorer  = "liquid"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Explorer

type Explorer interface {
	GetTxHex(txid string) (string, error)
	Broadcast(txHex string) (string, error)
	GetTxs(addr string) ([]ExplorerTx, error)
	GetTxOutspends(tx string) ([]SpentStatus, error)
	GetUtxos(addr string) ([]ExplorerUtxo, error)
	GetBalance(addr string) (uint64, error)
	GetRedeemedVtxosBalance(
		addr string, unilateralExitDelay common.RelativeLocktime,
	) (uint64, map[int64]uint64, error)
	GetTxBlockTime(
		txid string,
	) (confirmed bool, blocktime int64, err error)
	// GetNetwork() common.Network
	BaseUrl() string
	GetFeeRate() (float64, error)
}

func NewExplorer

func NewExplorer(baseUrl string, net common.Network) Explorer

type ExplorerTx

type ExplorerTx struct {
	Txid string `json:"txid"`
	Vout []struct {
		Address string `json:"scriptpubkey_address"`
		Amount  uint64 `json:"value"`
	} `json:"vout"`
	Status struct {
		Confirmed bool  `json:"confirmed"`
		Blocktime int64 `json:"block_time"`
	} `json:"status"`
}

type ExplorerUtxo

type ExplorerUtxo struct {
	Txid   string `json:"txid"`
	Vout   uint32 `json:"vout"`
	Amount uint64 `json:"value"`
	Asset  string `json:"asset,omitempty"`
	Status struct {
		Confirmed bool  `json:"confirmed"`
		Blocktime int64 `json:"block_time"`
	} `json:"status"`
}

func (ExplorerUtxo) ToUtxo

func (e ExplorerUtxo) ToUtxo(delay common.RelativeLocktime, tapscripts []string) types.Utxo

type SpentStatus

type SpentStatus struct {
	Spent   bool   `json:"spent"`
	SpentBy string `json:"txid,omitempty"`
}

Jump to

Keyboard shortcuts

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