Documentation ¶
Index ¶
- func NewCoin(txid []byte, index uint32, value btc.Amount, numConfs int64, ...) coinset.Coin
- type Coin
- type LibbitcoinWallet
- func (w *LibbitcoinWallet) GetBalance() (unconfirmed uint64, confirmed uint64)
- func (w *LibbitcoinWallet) GetCurrentAddress(purpose bitcoin.KeyPurpose) *btc.AddressPubKeyHash
- func (w *LibbitcoinWallet) GetCurrentKey(purpose bitcoin.KeyPurpose) *b32.Key
- func (w *LibbitcoinWallet) GetFreshAddress(purpose bitcoin.KeyPurpose) *btc.AddressPubKeyHash
- func (w *LibbitcoinWallet) GetFreshKey(purpose bitcoin.KeyPurpose) *b32.Key
- func (w *LibbitcoinWallet) GetMasterPrivateKey() *b32.Key
- func (w *LibbitcoinWallet) GetMasterPublicKey() *b32.Key
- func (w *LibbitcoinWallet) Params() *chaincfg.Params
- func (w *LibbitcoinWallet) ProcessTransaction(tx *btc.Tx, height uint32)
- func (w *LibbitcoinWallet) Spend(amount int64, addr btc.Address, feeLevel bitcoin.FeeLevel) error
- func (w *LibbitcoinWallet) SubscribeAddress(addr btc.Address)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Coin ¶
type LibbitcoinWallet ¶
type LibbitcoinWallet struct { Client *libbitcoin.LibbitcoinClient // contains filtered or unexported fields }
func NewLibbitcoinWallet ¶
func (*LibbitcoinWallet) GetBalance ¶
func (w *LibbitcoinWallet) GetBalance() (unconfirmed uint64, confirmed uint64)
FIXME: this isn't returning the correct unconfirmed balance. If we spend a confirmed FIXME: transaction, the change is then technically "unconfirmed" but we don't really FIXME: care about that since we originated it. If the spend doesn't confirm we still own FIXME: the coins. So unconfirmed change from confirmed spends should return as confirmed.
func (*LibbitcoinWallet) GetCurrentAddress ¶
func (w *LibbitcoinWallet) GetCurrentAddress(purpose bitcoin.KeyPurpose) *btc.AddressPubKeyHash
func (*LibbitcoinWallet) GetCurrentKey ¶
func (w *LibbitcoinWallet) GetCurrentKey(purpose bitcoin.KeyPurpose) *b32.Key
func (*LibbitcoinWallet) GetFreshAddress ¶
func (w *LibbitcoinWallet) GetFreshAddress(purpose bitcoin.KeyPurpose) *btc.AddressPubKeyHash
func (*LibbitcoinWallet) GetFreshKey ¶
func (w *LibbitcoinWallet) GetFreshKey(purpose bitcoin.KeyPurpose) *b32.Key
func (*LibbitcoinWallet) GetMasterPrivateKey ¶
func (w *LibbitcoinWallet) GetMasterPrivateKey() *b32.Key
func (*LibbitcoinWallet) GetMasterPublicKey ¶
func (w *LibbitcoinWallet) GetMasterPublicKey() *b32.Key
func (*LibbitcoinWallet) Params ¶
func (w *LibbitcoinWallet) Params() *chaincfg.Params
func (*LibbitcoinWallet) ProcessTransaction ¶
func (w *LibbitcoinWallet) ProcessTransaction(tx *btc.Tx, height uint32)
Process a transaction that comes off the wire. A transaction could be passed in here for three reasons: 1. It's a new transaction fresh off the wire. 2. It's our own outgoing transaction. 3. It's a transaction whose state has updated (ie. recently confirmed) In cases 1 and 2 we add the transaction to the database and update our utxo table. In the last case we just update the height and/or state of the transaction.
func (*LibbitcoinWallet) SubscribeAddress ¶
func (w *LibbitcoinWallet) SubscribeAddress(addr btc.Address)