Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAlreadyExists = errors.New("already-exists")
View Source
var ErrNotFound = errors.New("not-found")
Functions ¶
This section is empty.
Types ¶
type Balance ¶ added in v0.0.3
type Balance struct {
Incoming koinu.Koinu `json:"incoming"` // takes N confirmations to become Availble
Available koinu.Koinu `json:"available"` // confirmed balance you can spend
Outgoing koinu.Koinu `json:"outgoing"` // takes N confirmations to become fully Spent
Current koinu.Koinu `json:"current"` // current balance: Incoming + Available
}
Balance
type OutPointKey ¶
func OutPoint ¶
func OutPoint(txID []byte, index uint32) OutPointKey
OutPoint makes a binary string to use as a database key.
type StoreTx ¶
type StoreTx interface {
// GetResumePoint gets the hash to resume from.
GetResumePoint() (hash []byte, err error)
// SetResumePoint sets the hash to resume from.
SetResumePoint(hash []byte, height int64) error
// RemoveUTXOs marks UTXOs as spent at `height`
RemoveUTXOs(removeUTXOs []OutPointKey, height int64) error
// CreateUTXOs inserts new UTXOs at `height`
CreateUTXOs(createUTXOs []UTXO, height int64) error
// FindUTXOs finds all unspent UTXOs for an address.
FindUTXOs(kind doge.ScriptType, address []byte) (res []UTXO, err error)
// GetBalance sums all unspent UTXOs for an address.
// 'confirmations' is the number of confirmations before a balance is available (typically 6)
GetBalance(kind doge.ScriptType, address []byte, confirmations int64) (res Balance, err error)
// UndoAbove removes created UTXOs and re-activates Removed UTXOs above `height`.
UndoAbove(height int64) error
// TrimSpentUTXOs permanently deletes all spent UTXOs below `height`
TrimSpentUTXOs(height int64) error
}
Click to show internal directories.
Click to hide internal directories.