Versions in this module Expand all Collapse all v4 v4.2.0 Nov 11, 2024 v4.1.3 Aug 28, 2024 v4.1.2 Jun 19, 2024 v4.1.1 Jun 4, 2024 v4.1.0 May 24, 2024 v4.0.0 May 16, 2024 Changes in this version + const DBVersion + const DefaultAccountNum + const ExternalBranch + const ImportedAddrAccount + const ImportedAddrAccountName + const InternalBranch + const MaxAccountNum + const MaxAddressesPerAccount + const TSImmatureOrLive + const TSMissed + const TSVoted + func CoinTypes(params *chaincfg.Params) (legacyCoinType, slip0044CoinType uint32) + func DefaultAgendaPreference(dbtx walletdb.ReadTx, version uint32, agendaID string) (choiceID string) + func ExtractBlockHeaderHeight(header []byte) int32 + func ExtractBlockHeaderParentHash(header []byte) []byte + func ExtractBlockHeaderTime(header []byte) int64 + func GetVSPTicketsByFeeStatus(dbtx walletdb.ReadTx, feeStatus int) (map[chainhash.Hash]*VSPTicket, error) + func HDKeysFromSeed(seed []byte, params *chaincfg.Params) (...) + func Initialize(ctx context.Context, db walletdb.DB, params *chaincfg.Params, ...) error + func InitializeWatchOnly(ctx context.Context, db walletdb.DB, params *chaincfg.Params, hdPubKey string, ...) error + func IsImportedVoting(acctType uint8) bool + func Migrate(ctx context.Context, db walletdb.DB, params *chaincfg.Params) error + func NeedsMigration(ctx context.Context, db walletdb.DB) (bool, error) + func Open(ctx context.Context, db walletdb.DB, params *chaincfg.Params, pubPass []byte) (addrMgr *Manager, txStore *Store, stakeStore *StakeStore, err error) + func SetBirthState(dbtx walletdb.ReadWriteTx, bs *BirthdayState) error + func SetDefaultAgendaPreference(dbtx walletdb.ReadWriteTx, version uint32, agendaID, choiceID string) error + func SetTSpendPolicy(dbtx walletdb.ReadWriteTx, hash *chainhash.Hash, policy stake.TreasuryVoteT) error + func SetTicketAgendaPreference(dbtx walletdb.ReadWriteTx, txHash *chainhash.Hash, version uint32, ...) error + func SetTreasuryKeyPolicy(dbtx walletdb.ReadWriteTx, pikey []byte, policy stake.TreasuryVoteT) error + func SetVSPHost(dbtx walletdb.ReadWriteTx, id uint32, record *VSPHost) error + func SetVSPPubKey(dbtx walletdb.ReadWriteTx, host []byte, record *VSPPubKey) error + func SetVSPTSpendPolicy(dbtx walletdb.ReadWriteTx, ticketHash, tspendHash *chainhash.Hash, ...) error + func SetVSPTicket(dbtx walletdb.ReadWriteTx, ticketHash *chainhash.Hash, record *VSPTicket) error + func SetVSPTreasuryKeyPolicy(dbtx walletdb.ReadWriteTx, ticket *chainhash.Hash, pikey []byte, ...) error + func TSpendPolicies(dbtx walletdb.ReadTx) (map[chainhash.Hash]stake.TreasuryVoteT, error) + func TSpendPolicy(dbtx walletdb.ReadTx, hash *chainhash.Hash) (stake.TreasuryVoteT, error) + func TicketAgendaPreference(dbtx walletdb.ReadTx, ticketHash *chainhash.Hash, version uint32, ...) (choiceID string) + func TreasuryKeyPolicies(dbtx walletdb.ReadTx) (map[string]stake.TreasuryVoteT, error) + func TreasuryKeyPolicy(dbtx walletdb.ReadTx, pikey []byte) (stake.TreasuryVoteT, error) + func Upgrade(ctx context.Context, db walletdb.DB, publicPassphrase []byte, ...) error + func UseLogger(logger slog.Logger) + func VSPTSpendPolicies(dbtx walletdb.ReadTx) (map[VSPTSpend]stake.TreasuryVoteT, error) + func VSPTSpendPolicy(dbtx walletdb.ReadTx, ticketHash, tspendHash *chainhash.Hash) (stake.TreasuryVoteT, error) + func VSPTreasuryKeyPolicies(dbtx walletdb.ReadTx) (map[VSPTreasuryKey]stake.TreasuryVoteT, error) + func VSPTreasuryKeyPolicy(dbtx walletdb.ReadTx, ticket *chainhash.Hash, pikey []byte) (stake.TreasuryVoteT, error) + func ValidateAccountName(name string) error + type AccountProperties = struct + AccountEncrypted bool + AccountName string + AccountNumber uint32 + AccountType uint8 + AccountUnlocked bool + ImportedKeyCount uint32 + LastReturnedExternalIndex uint32 + LastReturnedInternalIndex uint32 + LastUsedExternalIndex uint32 + LastUsedInternalIndex uint32 + type Balances = struct + Account uint32 + ImmatureCoinbaseRewards dcrutil.Amount + ImmatureStakeGeneration dcrutil.Amount + LockedByTickets dcrutil.Amount + Spendable dcrutil.Amount + Total dcrutil.Amount + Unconfirmed dcrutil.Amount + VotingAuthority dcrutil.Amount + type BirthdayState struct + Hash chainhash.Hash + Height uint32 + SetFromHeight bool + SetFromTime bool + Time time.Time + func BirthState(dbtx walletdb.ReadTx) *BirthdayState + type Block struct + Hash chainhash.Hash + Height int32 + type BlockCFilter struct + BlockHash chainhash.Hash + FilterV2 *gcs2.FilterV2 + Key [gcs2.KeySize]byte + type BlockHeaderData struct + BlockHash chainhash.Hash + SerializedHeader RawBlockHeader + type BlockMeta struct + Time time.Time + VoteBits uint16 + type Credit struct + Amount dcrutil.Amount + FromCoinBase bool + HasExpiry bool + PkScript []byte + Received time.Time + type CreditRecord struct + Amount dcrutil.Amount + Change bool + HasExpiry bool + Index uint32 + IsCoinbase bool + OpCode uint8 + Spent bool + type CryptoKeyType byte + const CKTPrivate + const CKTPublic + type DebitRecord struct + Amount dcrutil.Amount + Index uint32 + type EncryptorDecryptor interface + Bytes func() []byte + CopyBytes func([]byte) + Decrypt func(in []byte) ([]byte, error) + Encrypt func(in []byte) ([]byte, error) + Zero func() + type FeeStatus int + const VSPFeeProcessConfirmed + const VSPFeeProcessErrored + const VSPFeeProcessPaid + const VSPFeeProcessStarted + type InputSource struct + func (s *InputSource) SelectInputs(target dcrutil.Amount) (*txauthor.InputDetail, error) + type ManagedAddress interface + Account func() uint32 + AddrHash func() []byte + Address func() stdaddr.Address + Imported func() bool + Internal func() bool + Multisig func() bool + type ManagedPubKeyAddress interface + Index func() uint32 + PubKey func() []byte + type ManagedScriptAddress interface + RedeemScript func() (uint16, []byte) + type Manager struct + func (m *Manager) AccountBranchExtendedPubKey(dbtx walletdb.ReadTx, account, branch uint32) (*hdkeychain.ExtendedKey, error) + func (m *Manager) AccountExtendedPrivKey(dbtx walletdb.ReadTx, account uint32) (*hdkeychain.ExtendedKey, error) + func (m *Manager) AccountExtendedPubKey(dbtx walletdb.ReadTx, account uint32) (*hdkeychain.ExtendedKey, error) + func (m *Manager) AccountHasPassphrase(dbtx walletdb.ReadTx, account uint32) (hasPassphrase, unlocked bool) + func (m *Manager) AccountName(ns walletdb.ReadBucket, account uint32) (string, error) + func (m *Manager) AccountProperties(ns walletdb.ReadBucket, account uint32) (*AccountProperties, error) + func (m *Manager) AddrAccount(ns walletdb.ReadBucket, address stdaddr.Address) (uint32, error) + func (m *Manager) Address(ns walletdb.ReadBucket, address stdaddr.Address) (ManagedAddress, error) + func (m *Manager) ChainParams() *chaincfg.Params + func (m *Manager) ChangePassphrase(ns walletdb.ReadWriteBucket, oldPassphrase, newPassphrase []byte, private bool) error + func (m *Manager) Close() error + func (m *Manager) CoinType(dbtx walletdb.ReadTx) (uint32, error) + func (m *Manager) CoinTypePrivKey(dbtx walletdb.ReadTx) (*hdkeychain.ExtendedKey, error) + func (m *Manager) ConvertToWatchingOnly(ns walletdb.ReadWriteBucket) error + func (m *Manager) Decrypt(keyType CryptoKeyType, in []byte) ([]byte, error) + func (m *Manager) Encrypt(keyType CryptoKeyType, in []byte) ([]byte, error) + func (m *Manager) ExistsHash160(ns walletdb.ReadBucket, hash160 []byte) bool + func (m *Manager) ForEachAccount(ns walletdb.ReadBucket, fn func(account uint32) error) error + func (m *Manager) ForEachAccountAddress(ns walletdb.ReadBucket, account uint32, fn func(maddr ManagedAddress) error) error + func (m *Manager) ForEachActiveAccountAddress(ns walletdb.ReadBucket, account uint32, fn func(maddr ManagedAddress) error) error + func (m *Manager) ForEachActiveAddress(ns walletdb.ReadBucket, fn func(addr stdaddr.Address) error) error + func (m *Manager) HavePrivateKey(ns walletdb.ReadBucket, addr stdaddr.Address) (bool, error) + func (m *Manager) ImportPrivateKey(ns walletdb.ReadWriteBucket, wif *dcrutil.WIF) (ManagedPubKeyAddress, error) + func (m *Manager) ImportPublicKey(ns walletdb.ReadWriteBucket, pubkey []byte) (ManagedPubKeyAddress, error) + func (m *Manager) ImportScript(ns walletdb.ReadWriteBucket, script []byte) (ManagedScriptAddress, error) + func (m *Manager) ImportVotingAccount(dbtx walletdb.ReadWriteTx, acctKeyPriv *hdkeychain.ExtendedKey, ...) (uint32, error) + func (m *Manager) ImportXpubAccount(ns walletdb.ReadWriteBucket, name string, xpub *hdkeychain.ExtendedKey) error + func (m *Manager) IsLocked() bool + func (m *Manager) LastAccount(ns walletdb.ReadBucket) (uint32, error) + func (m *Manager) LastImportedAccount(dbtx walletdb.ReadTx) (uint32, error) + func (m *Manager) Lock() error + func (m *Manager) LockAccount(dbtx walletdb.ReadTx, account uint32) error + func (m *Manager) LookupAccount(ns walletdb.ReadBucket, name string) (uint32, error) + func (m *Manager) MarkReturnedChildIndex(dbtx walletdb.ReadWriteTx, account, branch, child uint32) error + func (m *Manager) MarkUsed(tx walletdb.ReadWriteTx, address stdaddr.Address) error + func (m *Manager) MarkUsedChildIndex(tx walletdb.ReadWriteTx, account, branch, child uint32) error + func (m *Manager) NewAccount(ns walletdb.ReadWriteBucket, name string) (uint32, error) + func (m *Manager) PrivateKey(ns walletdb.ReadBucket, addr stdaddr.Address) (key *secp256k1.PrivateKey, done func(), err error) + func (m *Manager) RecordDerivedAddress(dbtx walletdb.ReadWriteTx, account, branch, child uint32, pubkey []byte) error + func (m *Manager) RedeemScript(ns walletdb.ReadBucket, addr stdaddr.Address) ([]byte, error) + func (m *Manager) RenameAccount(ns walletdb.ReadWriteBucket, account uint32, name string) error + func (m *Manager) SetAccountPassphrase(dbtx walletdb.ReadWriteTx, account uint32, passphrase []byte) error + func (m *Manager) SyncAccountToAddrIndex(ns walletdb.ReadWriteBucket, account uint32, syncToIndex uint32, branch uint32) error + func (m *Manager) Unlock(ns walletdb.ReadBucket, passphrase []byte) error + func (m *Manager) UnlockAccount(dbtx walletdb.ReadTx, account uint32, passphrase []byte) error + func (m *Manager) UnlockedWithPassphrase(passphrase []byte) error + func (m *Manager) UpgradeToSLIP0044CoinType(dbtx walletdb.ReadWriteTx) error + func (m *Manager) WatchingOnly() bool + type MultisigCredit struct + Amount dcrutil.Amount + M uint8 + MSScript []byte + N uint8 + OutPoint *wire.OutPoint + ScriptHash [ripemd160.Size]byte + type MultisigOut struct + Amount dcrutil.Amount + BlockHash chainhash.Hash + BlockHeight uint32 + M uint8 + N uint8 + OutPoint *wire.OutPoint + ScriptHash [ripemd160.Size]byte + Spent bool + SpentBy chainhash.Hash + SpentByIndex uint32 + Tree int8 + TxHash chainhash.Hash + type ObtainUserInputFunc func() ([]byte, error) + type PoolTicket struct + HeightSpent uint32 + HeightTicket uint32 + SpentBy chainhash.Hash + Status TicketStatus + Ticket chainhash.Hash + type RawBlockHeader [180]byte + func (h *RawBlockHeader) Height() int32 + type StakePoolUser struct + InvalidTickets []*chainhash.Hash + Tickets []*PoolTicket + type StakeStore struct + Manager *Manager + Params *chaincfg.Params + func (s *StakeStore) DumpSStxHashes() []chainhash.Hash + func (s *StakeStore) DumpSStxHashesForAddress(ns walletdb.ReadBucket, addr stdaddr.Address) ([]chainhash.Hash, error) + func (s *StakeStore) InsertSStx(ns walletdb.ReadWriteBucket, sstx *dcrutil.Tx) error + func (s *StakeStore) OwnTicket(hash *chainhash.Hash) bool + func (s *StakeStore) RemoveStakePoolUserInvalTickets(ns walletdb.ReadWriteBucket, user stdaddr.Address, ticket *chainhash.Hash) error + func (s *StakeStore) SStxAddress(ns walletdb.ReadBucket, hash *chainhash.Hash) (stdaddr.Address, error) + func (s *StakeStore) StakePoolUserInfo(ns walletdb.ReadBucket, user stdaddr.Address) (*StakePoolUser, error) + func (s *StakeStore) TicketPurchase(dbtx walletdb.ReadTx, hash *chainhash.Hash) (*wire.MsgTx, error) + func (s *StakeStore) UpdateStakePoolUserInvalTickets(ns walletdb.ReadWriteBucket, user stdaddr.Address, ticket *chainhash.Hash) error + func (s *StakeStore) UpdateStakePoolUserTickets(ns walletdb.ReadWriteBucket, user stdaddr.Address, ticket *PoolTicket) error + type Store struct + func (s *Store) AccountBalance(dbtx walletdb.ReadTx, minConf int32, account uint32) (Balances, error) + func (s *Store) AccountBalances(dbtx walletdb.ReadTx, minConf int32) (map[uint32]*Balances, error) + func (s *Store) AddCredit(dbtx walletdb.ReadWriteTx, rec *TxRecord, block *BlockMeta, index uint32, ...) error + func (s *Store) AddMultisigOut(dbtx walletdb.ReadWriteTx, rec *TxRecord, block *BlockMeta, index uint32) error + func (s *Store) AddTicketCommitment(ns walletdb.ReadWriteBucket, rec *TxRecord, index, account uint32) error + func (s *Store) BlockInMainChain(dbtx walletdb.ReadTx, blockHash *chainhash.Hash) (inMainChain bool, invalidated bool) + func (s *Store) CFilterV2(dbtx walletdb.ReadTx, blockHash *chainhash.Hash) ([gcs2.KeySize]byte, *gcs2.FilterV2, error) + func (s *Store) ExistsTx(ns walletdb.ReadBucket, txHash *chainhash.Hash) bool + func (s *Store) ExistsTxMinedOrUnmined(ns walletdb.ReadBucket, txHash *chainhash.Hash) (mined, unmined bool) + func (s *Store) ExistsUTXO(dbtx walletdb.ReadTx, op *wire.OutPoint) bool + func (s *Store) ExtendMainChain(ns walletdb.ReadWriteBucket, header *wire.BlockHeader, ...) error + func (s *Store) ForEachUnspentOutpoint(dbtx walletdb.ReadTx, f func(*wire.OutPoint) error) error + func (s *Store) GetBlockHeader(dbtx walletdb.ReadTx, blockHash *chainhash.Hash) (*wire.BlockHeader, error) + func (s *Store) GetBlockHeaderTime(dbtx walletdb.ReadTx, blockHash *chainhash.Hash) (int64, error) + func (s *Store) GetBlockMetaForHash(ns walletdb.ReadBucket, blockHash *chainhash.Hash) (BlockMeta, error) + func (s *Store) GetMainChainBlockHashForHeight(ns walletdb.ReadBucket, height int32) (chainhash.Hash, error) + func (s *Store) GetMainChainBlockHashes(ns walletdb.ReadBucket, startHash *chainhash.Hash, inclusive bool, ...) ([]chainhash.Hash, error) + func (s *Store) GetMainChainCFilters(dbtx walletdb.ReadTx, startHash *chainhash.Hash, inclusive bool, ...) ([]*BlockCFilter, error) + func (s *Store) GetMultisigOutput(ns walletdb.ReadBucket, op *wire.OutPoint) (*MultisigOut, error) + func (s *Store) GetSerializedBlockHeader(ns walletdb.ReadBucket, blockHash *chainhash.Hash) ([]byte, error) + func (s *Store) ImportCFiltersV2(dbtx walletdb.ReadWriteTx, startHeight int32, filterData [][]byte) error + func (s *Store) InsertMemPoolTx(dbtx walletdb.ReadWriteTx, rec *TxRecord) error + func (s *Store) InsertMinedTx(dbtx walletdb.ReadWriteTx, rec *TxRecord, blockHash *chainhash.Hash) error + func (s *Store) InsertMissingCFilters(dbtx walletdb.ReadWriteTx, blockHashes []*chainhash.Hash, ...) error + func (s *Store) IsMissingMainChainCFilters(dbtx walletdb.ReadTx) bool + func (s *Store) IsUnspentOutpoint(dbtx walletdb.ReadTx, op *wire.OutPoint) bool + func (s *Store) IterateTickets(dbtx walletdb.ReadTx) *TicketIterator + func (s *Store) MainChainTip(dbtx walletdb.ReadTx) (chainhash.Hash, int32) + func (s *Store) MakeInputSource(dbtx walletdb.ReadTx, account uint32, minConf, syncHeight int32, ...) InputSource + func (s *Store) MissingCFiltersHeight(dbtx walletdb.ReadTx) (int32, error) + func (s *Store) OwnTicket(dbtx walletdb.ReadTx, ticketHash *chainhash.Hash) bool + func (s *Store) PreviousPkScripts(ns walletdb.ReadBucket, rec *TxRecord, block *Block) ([][]byte, error) + func (s *Store) ProcessedTxsBlockMarker(dbtx walletdb.ReadTx) *chainhash.Hash + func (s *Store) PruneUnmined(dbtx walletdb.ReadWriteTx, stakeDiff int64) ([]*chainhash.Hash, error) + func (s *Store) RandomUTXO(dbtx walletdb.ReadTx, minConf, syncHeight int32) (*Credit, error) + func (s *Store) RangeBlocks(ns walletdb.ReadBucket, begin, end int32, f func(*Block) (bool, error)) error + func (s *Store) RangeTransactions(ctx context.Context, ns walletdb.ReadBucket, begin, end int32, ...) error + func (s *Store) RedeemTicketCommitments(ns walletdb.ReadWriteBucket, rec *TxRecord, block *BlockMeta) error + func (s *Store) RemoveUnconfirmed(ns walletdb.ReadWriteBucket, tx *wire.MsgTx, txHash *chainhash.Hash) error + func (s *Store) Rollback(dbtx walletdb.ReadWriteTx, height int32) error + func (s *Store) SetPublished(dbtx walletdb.ReadWriteTx, txHash *chainhash.Hash, published bool) error + func (s *Store) SpendMultisigOut(ns walletdb.ReadWriteBucket, op *wire.OutPoint, spendHash chainhash.Hash, ...) error + func (s *Store) Spender(dbtx walletdb.ReadTx, out *wire.OutPoint) (*wire.MsgTx, uint32, error) + func (s *Store) TicketDetails(ns walletdb.ReadBucket, txDetails *TxDetails) (*TicketDetails, error) + func (s *Store) Tx(ns walletdb.ReadBucket, txHash *chainhash.Hash) (*wire.MsgTx, error) + func (s *Store) TxBlockHeight(dbtx walletdb.ReadTx, txHash *chainhash.Hash) (int32, error) + func (s *Store) TxDetails(ns walletdb.ReadBucket, txHash *chainhash.Hash) (*TxDetails, error) + func (s *Store) UniqueTxDetails(ns walletdb.ReadBucket, txHash *chainhash.Hash, block *Block) (*TxDetails, error) + func (s *Store) UnminedTxHashes(ns walletdb.ReadBucket) ([]*chainhash.Hash, error) + func (s *Store) UnminedTxs(dbtx walletdb.ReadTx) ([]*TxRecord, error) + func (s *Store) UnspentMultisigCreditsForAddress(dbtx walletdb.ReadTx, addr stdaddr.Address) ([]*MultisigCredit, error) + func (s *Store) UnspentOutput(ns walletdb.ReadBucket, op wire.OutPoint, includeMempool bool) (*Credit, error) + func (s *Store) UnspentOutputCount(dbtx walletdb.ReadTx) int + func (s *Store) UnspentOutputs(dbtx walletdb.ReadTx) ([]*Credit, error) + func (s *Store) UnspentTickets(dbtx walletdb.ReadTx, syncHeight int32, includeImmature bool) ([]chainhash.Hash, error) + func (s *Store) UpdateProcessedTxsBlockMarker(dbtx walletdb.ReadWriteTx, hash *chainhash.Hash) error + type Ticket struct + Block Block + SpenderHash chainhash.Hash + type TicketDetails struct + Spender *TxDetails + Ticket *TxDetails + type TicketIterator struct + func (it *TicketIterator) Close() + func (it *TicketIterator) Err() error + func (it *TicketIterator) Next() bool + type TicketStatus uint8 + type TxDetails struct + Block BlockMeta + Credits []CreditRecord + Debits []DebitRecord + func (t *TxDetails) Height() int32 + type TxRecord struct + Hash chainhash.Hash + MsgTx wire.MsgTx + Received time.Time + SerializedTx []byte + TxType stake.TxType + Unpublished bool + func NewTxRecord(serializedTx []byte, received time.Time) (*TxRecord, error) + func NewTxRecordFromMsgTx(msgTx *wire.MsgTx, received time.Time) (*TxRecord, error) + type VSPHost struct + Host []byte + func GetVSPHost(dbtx walletdb.ReadTx, id uint32) (*VSPHost, error) + type VSPPubKey struct + ID uint32 + PubKey []byte + func GetVSPPubKey(dbtx walletdb.ReadTx, host []byte) (*VSPPubKey, error) + type VSPTSpend struct + TSpend chainhash.Hash + Ticket chainhash.Hash + type VSPTicket struct + FeeHash chainhash.Hash + FeeTxStatus uint32 + Host string + PubKey []byte + VSPHostID uint32 + func GetVSPTicket(dbtx walletdb.ReadTx, tickethash chainhash.Hash) (*VSPTicket, error) + type VSPTreasuryKey struct + Ticket chainhash.Hash + TreasuryKey string Other modules containing this package decred.org/dcrwallet decred.org/dcrwallet/v2 decred.org/dcrwallet/v3