libbitcoin

package
v0.0.0-...-7bc409f Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2016 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCoin

func NewCoin(txid []byte, index uint32, value btc.Amount, numConfs int64, scriptPubKey []byte) coinset.Coin

Types

type Coin

type Coin struct {
	TxHash       *wire.ShaHash
	TxIndex      uint32
	TxValue      btc.Amount
	TxNumConfs   int64
	ScriptPubKey []byte
}

func (*Coin) Hash

func (c *Coin) Hash() *wire.ShaHash

func (*Coin) Index

func (c *Coin) Index() uint32

func (*Coin) NumConfs

func (c *Coin) NumConfs() int64

func (*Coin) PkScript

func (c *Coin) PkScript() []byte

func (*Coin) Value

func (c *Coin) Value() btc.Amount

func (*Coin) ValueAge

func (c *Coin) ValueAge() int64

type LibbitcoinWallet

type LibbitcoinWallet struct {
	Client *libbitcoin.LibbitcoinClient
	// contains filtered or unexported fields
}

func NewLibbitcoinWallet

func NewLibbitcoinWallet(mnemonic string, params *chaincfg.Params, db repo.Datastore, servers []libbitcoin.Server,
	maxFee uint64, lowFee uint64, mediumFee uint64, highFee uint64, feeApi string) *LibbitcoinWallet

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) Spend

func (w *LibbitcoinWallet) Spend(amount int64, addr btc.Address, feeLevel bitcoin.FeeLevel) error

func (*LibbitcoinWallet) SubscribeAddress

func (w *LibbitcoinWallet) SubscribeAddress(addr btc.Address)

Jump to

Keyboard shortcuts

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