Documentation ¶
Index ¶
- type Store
- func (s *Store) Close() error
- func (s *Store) LastWalletChange() (id modules.ConsensusChangeID, height uint64, err error)
- func (s *Store) ResetWallet() error
- func (s *Store) SetLogger(log *zap.Logger)
- func (s *Store) TransactionCount() (count uint64, err error)
- func (s *Store) Transactions(limit, offset int) (txns []wallet.Transaction, err error)
- func (s *Store) UnspentSiacoinElements() (utxos []wallet.SiacoinElement, err error)
- func (s *Store) UpdateWallet(ccID modules.ConsensusChangeID, height uint64, ...) error
- func (s *Store) VerifyWalletKey(seedHash types.Hash256) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
A Store is a persistent store that uses a SQL database as its backend.
func OpenDatabase ¶
OpenDatabase creates a new SQLite store and initializes the database. If the database does not exist, it is created.
func (*Store) LastWalletChange ¶
func (s *Store) LastWalletChange() (id modules.ConsensusChangeID, height uint64, err error)
LastWalletChange gets the last consensus change processed by the wallet.
func (*Store) ResetWallet ¶
ResetWallet resets the wallet to its initial state. This is used when a consensus subscription error occurs.
func (*Store) TransactionCount ¶
TransactionCount returns the total number of transactions in the wallet.
func (*Store) Transactions ¶
func (s *Store) Transactions(limit, offset int) (txns []wallet.Transaction, err error)
Transactions returns a paginated list of transactions ordered by block height descending. If no transactions are found, (nil, nil) is returned.
func (*Store) UnspentSiacoinElements ¶
func (s *Store) UnspentSiacoinElements() (utxos []wallet.SiacoinElement, err error)
UnspentSiacoinElements returns the spendable siacoin outputs in the wallet.
func (*Store) UpdateWallet ¶
func (s *Store) UpdateWallet(ccID modules.ConsensusChangeID, height uint64, fn func(wallet.UpdateTransaction) error) error
UpdateWallet begins an update transaction on the wallet store.