Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoRecipient = errors.New("must have atleast one recipient") ErrNoBDK = errors.New("utreexod must be built with the 'bdkwallet' tag to enable the BDK wallet") )
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.
func DoesWalletDirExist ¶
Types ¶
type Balance ¶
type Balance struct { Immature btcutil.Amount // immature coinbase balance TrustedPending btcutil.Amount // unconfirmed balance that is part of our change keychain UntrustedPending btcutil.Amount // unconfirmed balance that is part of our public keychain Confirmed btcutil.Amount // confirmed balance }
Balance in satoshis.
func (*Balance) TrustedSpendable ¶
TrustedSpendable are funds that are safe to spend.
type Manager ¶
type Manager struct { // Wallet is the underlying wallet that calls out to the // bdk rust library. Wallet Wallet // wallet does not need a mutex as it's done in Rust // contains filtered or unexported fields }
Manager handles the configuration and handling data in between the utreexo node and the bdk wallet library.
func NewManager ¶
func NewManager(config ManagerConfig) (*Manager, error)
func (*Manager) NotifyNewTransactions ¶
type ManagerConfig ¶
type ManagerConfig struct { Chain *blockchain.BlockChain TxMemPool *mempool.TxPool ChainParams *chaincfg.Params DataDir string }
ManagerConfig is a configuration struct used to
type Recipient ¶
type Recipient struct { Amount btcutil.Amount // amount to send Address string // recipient address to send to (in human-readable form) }
Recipient specifies the intended amount and destination address for a transaction output.
type TxInfo ¶
type TxInfo struct { Txid chainhash.Hash Tx btcutil.Tx Spent btcutil.Amount // sum of owned inputs Received btcutil.Amount // sum of owned outputs Confirmations uint // number of confirmations for this tx }
TxInfo is information on a given transaction.
type UTXOInfo ¶
type UTXOInfo struct { Txid chainhash.Hash Vout uint Amount btcutil.Amount ScriptPubKey []byte IsChange bool DerivationIndex uint Confirmations uint // number of confirmations for this utxo }
UtxoInfo is information on a given transaction.
type Wallet ¶
type Wallet interface { UnusedAddress() (uint, btcutil.Address, error) FreshAddress() (uint, btcutil.Address, error) PeekAddress(index uint32) (uint, btcutil.Address, error) Balance() Balance RecentBlocks(count uint32) []BlockId ApplyBlock(block *btcutil.Block) error ApplyMempoolTransactions(txns []*mempool.TxDesc) error CreateTx(feerate float32, recipients []Recipient) ([]byte, error) MnemonicWords() []string Transactions() ([]TxInfo, error) UTXOs() []UTXOInfo }
Wallet tracks addresses and transactions sending/receiving to/from those addresses. The wallet is updated by incoming blocks and new mempool transactions.