bitcoin

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: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RECEIVING = 0
	CHANGE    = 1
	REFUND    = 2
)
View Source
const (
	// A (unconfirmed) transaction which does not appear in the best chain
	PENDING = 0

	// Transaction appears in the best chain
	CONFIRMED = 1

	// We have reason to believe the transaction will never confirm. Either it was double
	// spent or has sat unconfirmed for an unreasonably long period of time.
	DEAD = 2
)
View Source
const (
	PRIOIRTY = 0
	NORMAL   = 1
	ECONOMIC = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BitcoinWallet

type BitcoinWallet interface {
	// Keys
	GetMasterPrivateKey() *b32.Key
	GetMasterPublicKey() *b32.Key
	GetCurrentAddress(purpose KeyPurpose) *btc.AddressPubKeyHash
	GetFreshAddress(purpose KeyPurpose) *btc.AddressPubKeyHash

	// Wallet
	GetBalance() (unconfirmed uint64, confirmed uint64)
	Spend(amount int64, addr btc.Address, feeLevel FeeLevel) error

	// Params
	Params() *chaincfg.Params
}

TODO: Build out this interface

type FeeLevel

type FeeLevel int

type KeyPurpose

type KeyPurpose int

type TransactionInfo

type TransactionInfo struct {
	Txid            []byte
	Tx              []byte
	Height          int
	State           TransactionState
	Timestamp       time.Time
	Value           int
	ExchangeRate    float64
	ExchangCurrency string
}

type TransactionState

type TransactionState int

type Utxo

type Utxo struct {
	Txid         []byte
	Index        int
	Value        int
	ScriptPubKey []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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