Documentation ¶
Overview ¶
Package btc defines primitives to work with Bitcoin.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnknownBitcoinNetwork is returned when the network ID associated to the WIF is unknown. ErrUnknownBitcoinNetwork = errors.New("WIF encoded private key uses unknown Bitcoin network") // ErrBadWIF is returned when the WIF encoded private key could not be decoded. ErrBadWIF = errors.New("Failed to decode WIF encoded private key") )
Functions ¶
This section is empty.
Types ¶
type Broadcaster ¶
type Broadcaster interface { // Broadcast broadcasts a raw transaction. Broadcast(ctx context.Context, raw []byte) error }
Broadcaster is able to broadcast raw Bitcoin transactions.
type Network ¶
type Network string
Network represents a Bitcoin network.
func GetNetworkFromWIF ¶ added in v0.3.1
GetNetworkFromWIF returns the network ID associated to a bitcoin wallet.
type Output ¶
type Output struct { TXHash types.ReversedBytes32 PKScript []byte Index int }
Output represents a transaction output.
type UnspentFinder ¶
type UnspentFinder interface { // FindUnspent find unspent outputs for the given address and the // required amount. FindUnspent(ctx context.Context, address *types.ReversedBytes20, amount int64) (UnspentResult, error) }
UnspentFinder is used to find unspent outputs.
type UnspentResult ¶ added in v0.3.1
type UnspentResult struct { // Outputs contains enough outputs to cover the requested amount. Outputs []Output // Sum is the sum of the balance of the returned outputs. Sum int64 // Total is the sum all of the outputs including the returned outputs. Total int64 }
UnspentResult contains the result of a call to UnspentFinder.FindUnspent.
Directories ¶
Path | Synopsis |
---|---|
Package blockcypher defines primitives to work with the BlockCypher API.
|
Package blockcypher defines primitives to work with the BlockCypher API. |
Package btctesting defines helpers to test Bitcoin.
|
Package btctesting defines helpers to test Bitcoin. |
Package btctimestamper implements a fake Bitcoin timestamper which can be used for testing.
|
Package btctimestamper implements a fake Bitcoin timestamper which can be used for testing. |
Click to show internal directories.
Click to hide internal directories.