btc

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BIP39MnemonicEnvName   = "SEED_MNEMONIC"
	BIP39PassphraseEnvName = "SEED_PASSPHRASE"
)
View Source
const (
	FormatCli          = "bitcoin-cli"
	FormatCliWatchOnly = "bitcoin-cli-watchonly"
	FormatImportwallet = "bitcoin-importwallet"
	FormatDescriptors  = "bitcoin-descriptors"
	FormatElectrum     = "electrum"

	PasteString = "# Paste the following lines into a command line window."
)

Variables

View Source
var (
	ErrTxNotFound = errors.New("transaction not found")
)

Functions

func DescriptorSumCheck added in v0.11.0

func DescriptorSumCheck(s string, require bool) bool

func DescriptorSumCreate added in v0.11.0

func DescriptorSumCreate(s string) string

func ExportKeys added in v0.2.0

func ExportKeys(extendedKey *hdkeychain.ExtendedKey, strPaths []string,
	paths [][]uint32, params *chaincfg.Params, recoveryWindow,
	rescanFrom uint32, exporter KeyExporter, writer io.Writer) error

func ReadMnemonicFromTerminal added in v0.3.0

func ReadMnemonicFromTerminal(params *chaincfg.Params) (*hdkeychain.ExtendedKey,
	error)

func SeedBirthdayToBlock added in v0.2.0

func SeedBirthdayToBlock(params *chaincfg.Params,
	birthdayTimestamp time.Time) uint32

func SummarizeChannels added in v0.3.0

func SummarizeChannels(apiURL string, channels []*dataformat.SummaryEntry,
	log btclog.Logger) (*dataformat.SummaryEntryFile, error)

Types

type AddressStats added in v0.9.3

type AddressStats struct {
	Address      string `json:"address"`
	ChainStats   *Stats `json:"chain_stats"`
	MempoolStats *Stats `json:"mempool_stats"`
}

type Cli added in v0.2.0

type Cli struct{}

func (*Cli) Format added in v0.2.0

func (c *Cli) Format(hdKey *hdkeychain.ExtendedKey, params *chaincfg.Params,
	path string, branch, index uint32) (string, error)

func (*Cli) Header added in v0.2.0

func (c *Cli) Header() string

func (*Cli) Trailer added in v0.2.0

func (c *Cli) Trailer(birthdayBlock uint32) string

type CliWatchOnly added in v0.2.0

type CliWatchOnly struct{}

func (*CliWatchOnly) Format added in v0.2.0

func (c *CliWatchOnly) Format(hdKey *hdkeychain.ExtendedKey,
	params *chaincfg.Params, path string, branch, index uint32) (string,
	error)

func (*CliWatchOnly) Header added in v0.2.0

func (c *CliWatchOnly) Header() string

func (*CliWatchOnly) Trailer added in v0.2.0

func (c *CliWatchOnly) Trailer(birthdayBlock uint32) string

type Descriptors added in v0.11.0

type Descriptors struct{}

func (*Descriptors) Format added in v0.11.0

func (d *Descriptors) Format(hdKey *hdkeychain.ExtendedKey,
	params *chaincfg.Params, path string, branch, index uint32) (string,
	error)

func (*Descriptors) Header added in v0.11.0

func (d *Descriptors) Header() string

func (*Descriptors) Trailer added in v0.11.0

func (d *Descriptors) Trailer(birthdayBlock uint32) string

type Electrum added in v0.9.3

type Electrum struct{}

func (*Electrum) Format added in v0.9.3

func (p *Electrum) Format(hdKey *hdkeychain.ExtendedKey,
	params *chaincfg.Params, path string, branch, index uint32) (string,
	error)

func (*Electrum) Header added in v0.9.3

func (p *Electrum) Header() string

func (*Electrum) Trailer added in v0.9.3

func (p *Electrum) Trailer(_ uint32) string

type ExplorerAPI

type ExplorerAPI struct {
	BaseURL string
}

func (*ExplorerAPI) Address added in v0.8.4

func (a *ExplorerAPI) Address(outpoint string) (string, error)

func (*ExplorerAPI) Outpoint added in v0.5.0

func (a *ExplorerAPI) Outpoint(addr string) (*TX, int, error)

func (*ExplorerAPI) PublishTx

func (a *ExplorerAPI) PublishTx(rawTxHex string) (string, error)

func (*ExplorerAPI) Spends added in v0.10.7

func (a *ExplorerAPI) Spends(addr string) ([]*TX, error)

func (*ExplorerAPI) Transaction

func (a *ExplorerAPI) Transaction(txid string) (*TX, error)

func (*ExplorerAPI) Unspent added in v0.9.3

func (a *ExplorerAPI) Unspent(addr string) ([]*Vout, error)

type ImportWallet added in v0.2.0

type ImportWallet struct{}

func (*ImportWallet) Format added in v0.2.0

func (i *ImportWallet) Format(hdKey *hdkeychain.ExtendedKey,
	params *chaincfg.Params, path string, branch, index uint32) (string,
	error)

func (*ImportWallet) Header added in v0.2.0

func (i *ImportWallet) Header() string

func (*ImportWallet) Trailer added in v0.2.0

func (i *ImportWallet) Trailer(_ uint32) string

type KeyExporter added in v0.2.0

type KeyExporter interface {
	Header() string
	Format(*hdkeychain.ExtendedKey, *chaincfg.Params, string, uint32,
		uint32) (string, error)
	Trailer(uint32) string
}

func ParseFormat added in v0.2.0

func ParseFormat(format string) (KeyExporter, error)

ParseFormat parses the given format name and returns its associated print function.

type Outspend

type Outspend struct {
	Spent  bool    `json:"spent"`
	Txid   string  `json:"txid"`
	Vin    int     `json:"vin"`
	Status *Status `json:"status"`
}

type Stats added in v0.9.3

type Stats struct {
	FundedTXOCount uint32 `json:"funded_txo_count"`
	FundedTXOSum   uint64 `json:"funded_txo_sum"`
	SpentTXOCount  uint32 `json:"spent_txo_count"`
	SpentTXOSum    uint64 `json:"spent_txo_sum"`
	TXCount        uint32 `json:"tx_count"`
}

type Status

type Status struct {
	Confirmed   bool   `json:"confirmed"`
	BlockHeight int    `json:"block_height"`
	BlockHash   string `json:"block_hash"`
}

type TX

type TX struct {
	TXID string  `json:"txid"`
	Vin  []*Vin  `json:"vin"`
	Vout []*Vout `json:"vout"`
}

type Vin

type Vin struct {
	Tixid    string `json:"txid"`
	Vout     int    `json:"vout"`
	Prevout  *Vout  `json:"prevout"`
	Sequence uint32 `json:"sequence"`
}

type Vout

type Vout struct {
	ScriptPubkey     string `json:"scriptpubkey"`
	ScriptPubkeyAsm  string `json:"scriptpubkey_asm"`
	ScriptPubkeyType string `json:"scriptpubkey_type"`
	ScriptPubkeyAddr string `json:"scriptpubkey_address"`
	Value            uint64 `json:"value"`
	Outspend         *Outspend
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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