Versions in this module Expand all Collapse all v0 v0.2.17 Dec 28, 2019 v0.2.15 Dec 28, 2019 Changes in this version + const InsecurePubPassphrase + const WalletDbName + var ErrExists = errors.New("wallet already exists") + var ErrLoaded = errors.New("wallet already loaded") + var ErrNotLoaded = errors.New("wallet is not loaded") + var ErrNotSynced = errors.New("wallet is not synchronized with the chain server") + func Create(db walletdb.DB, pubPass, privPass, seed []byte, params *netparams.Params, ...) error + type AccountBalance struct + Account uint32 + TotalBalance util.Amount + type AccountBalanceResult struct + AccountBalance util.Amount + AccountName string + AccountNumber uint32 + type AccountNotification struct + AccountName string + AccountNumber uint32 + ExternalKeyCount uint32 + ImportedKeyCount uint32 + InternalKeyCount uint32 + type AccountNotificationsClient struct + C chan *AccountNotification + func (c *AccountNotificationsClient) Done() + type AccountResult struct + TotalBalance util.Amount + type AccountTotalReceivedResult struct + AccountName string + AccountNumber uint32 + LastConfirmation int32 + TotalReceived util.Amount + type AccountsResult struct + Accounts []AccountResult + CurrentBlockHash *chainhash.Hash + CurrentBlockHeight int32 + type Balances struct + ImmatureReward util.Amount + Spendable util.Amount + Total util.Amount + type Block struct + Hash *chainhash.Hash + Height int32 + Timestamp int64 + Transactions []TransactionSummary + type BlockIdentifier struct + func NewBlockIdentifierFromHash(hash *chainhash.Hash) *BlockIdentifier + func NewBlockIdentifierFromHeight(height int32) *BlockIdentifier + type BlockIdentity struct + Hash chainhash.Hash + Height int32 + func (b *BlockIdentity) None() bool + type BranchRecoveryState struct + func NewBranchRecoveryState(recoveryWindow uint32) *BranchRecoveryState + func (brs *BranchRecoveryState) AddAddr(index uint32, addr util.Address) + func (brs *BranchRecoveryState) Addrs() map[uint32]util.Address + func (brs *BranchRecoveryState) ExtendHorizon() (uint32, uint32) + func (brs *BranchRecoveryState) GetAddr(index uint32) util.Address + func (brs *BranchRecoveryState) MarkInvalidChild(index uint32) + func (brs *BranchRecoveryState) NextUnfound() uint32 + func (brs *BranchRecoveryState) NumInvalidInHorizon() uint32 + func (brs *BranchRecoveryState) ReportFound(index uint32) + type CreditCategory byte + const CreditGenerate + const CreditImmature + const CreditReceive + func RecvCategory(details *wtxmgr.TxDetails, syncHeight int32, net *netparams.Params) CreditCategory + func (c CreditCategory) String() string + type GetTransactionsResult struct + MinedTransactions []Block + UnminedTransactions []TransactionSummary + type Loader struct + Callbacks []func(*Wallet) + ChainParams *netparams.Params + DB walletdb.DB + DDDirPath string + Loaded bool + Mutex sync.Mutex + RecoveryWindow uint32 + Wallet *Wallet + func NewLoader(chainParams *netparams.Params, dbDirPath string, recoveryWindow uint32) *Loader + func (ld *Loader) CreateNewWallet(pubPassphrase, privPassphrase, seed []byte, bday time.Time, noStart bool) (*Wallet, error) + func (ld *Loader) LoadedWallet() (*Wallet, bool) + func (ld *Loader) OpenExistingWallet(pubPassphrase []byte, canConsolePrompt bool) (*Wallet, error) + func (ld *Loader) RunAfterLoad(fn func(*Wallet)) + func (ld *Loader) UnloadWallet() error + func (ld *Loader) WalletExists() (bool, error) + type NotificationServer struct + func (s *NotificationServer) AccountNotifications() AccountNotificationsClient + func (s *NotificationServer) AccountSpentnessNotifications(account uint32) SpentnessNotificationsClient + func (s *NotificationServer) TransactionNotifications() TransactionNotificationsClient + type OutputKind byte + const OutputKindCoinbase + const OutputKindNormal + type OutputRedeemer struct + InputIndex uint32 + TxHash chainhash.Hash + type OutputSelectionPolicy struct + Account uint32 + RequiredConfirmations int32 + type P2SHMultiSigOutput struct + ContainingBlock BlockIdentity + M uint8 + N uint8 + OutPoint wire.OutPoint + OutputAmount util.Amount + P2SHAddress *util.AddressScriptHash + RedeemScript []byte + Redeemer *OutputRedeemer + type RecoveryManager struct + func NewRecoveryManager(recoveryWindow, batchSize uint32, chainParams *netparams.Params) *RecoveryManager + func (rm *RecoveryManager) AddToBlockBatch(hash *chainhash.Hash, height int32, timestamp time.Time) + func (rm *RecoveryManager) BlockBatch() []wtxmgr.BlockMeta + func (rm *RecoveryManager) ResetBlockBatch() + func (rm *RecoveryManager) Resurrect(ns walletdb.ReadBucket, ...) error + func (rm *RecoveryManager) State() *RecoveryState + type RecoveryState struct + func NewRecoveryState(recoveryWindow uint32) *RecoveryState + func (rs *RecoveryState) AddWatchedOutPoint(outPoint *wire.OutPoint, addr util.Address) + func (rs *RecoveryState) StateForScope(keyScope waddrmgr.KeyScope) *ScopeRecoveryState + func (rs *RecoveryState) WatchedOutPoints() map[wire.OutPoint]util.Address + type RescanFinishedMsg struct + Addresses []util.Address + Notification *chain.RescanFinished + type RescanJob struct + Addrs []util.Address + BlockStamp wm.BlockStamp + InitialSync bool + OutPoints map[wire.OutPoint]util.Address + type RescanProgressMsg struct + Addresses []util.Address + Notification *chain.RescanProgress + type ScopeRecoveryState struct + ExternalBranch *BranchRecoveryState + InternalBranch *BranchRecoveryState + func NewScopeRecoveryState(recoveryWindow uint32) *ScopeRecoveryState + type SignatureError struct + Error error + InputIndex uint32 + type SpentnessNotifications struct + func (n *SpentnessNotifications) Hash() *chainhash.Hash + func (n *SpentnessNotifications) Index() uint32 + func (n *SpentnessNotifications) Spender() (*chainhash.Hash, uint32, bool) + type SpentnessNotificationsClient struct + C <-chan *SpentnessNotifications + func (c *SpentnessNotificationsClient) Done() + type TransactionNotifications struct + AttachedBlocks []Block + DetachedBlocks []*chainhash.Hash + NewBalances []AccountBalance + UnminedTransactionHashes []*chainhash.Hash + UnminedTransactions []TransactionSummary + type TransactionNotificationsClient struct + C <-chan *TransactionNotifications + func (c *TransactionNotificationsClient) Done() + type TransactionOutput struct + ContainingBlock BlockIdentity + OutPoint wire.OutPoint + Output wire.TxOut + OutputKind OutputKind + ReceiveTime time.Time + type TransactionSummary struct + Fee util.Amount + Hash *chainhash.Hash + MyInputs []TransactionSummaryInput + MyOutputs []TransactionSummaryOutput + Timestamp int64 + Transaction []byte + type TransactionSummaryInput struct + Index uint32 + PreviousAccount uint32 + PreviousAmount util.Amount + type TransactionSummaryOutput struct + Account uint32 + Index uint32 + Internal bool + type UnstableAPI struct + func ExposeUnstableAPI(w *Wallet) UnstableAPI + func (u UnstableAPI) RangeTransactions(begin, end int32, f func([]wtxmgr.TxDetails) (bool, error)) error + func (u UnstableAPI) TxDetails(txHash *chainhash.Hash) (*wtxmgr.TxDetails, error) + type Wallet struct + Manager *waddrmgr.Manager + NtfnServer *NotificationServer + TxStore *wtxmgr.Store + func Open(db walletdb.DB, pubPass []byte, cbs *waddrmgr.OpenCallbacks, ...) (*Wallet, error) + func (w *Wallet) AccountAddresses(account uint32) (addrs []util.Address, err error) + func (w *Wallet) AccountBalances(scope waddrmgr.KeyScope, requiredConfs int32) ([]AccountBalanceResult, error) + func (w *Wallet) AccountName(scope waddrmgr.KeyScope, accountNumber uint32) (string, error) + func (w *Wallet) AccountNumber(scope waddrmgr.KeyScope, accountName string) (uint32, error) + func (w *Wallet) AccountOfAddress(a util.Address) (uint32, error) + func (w *Wallet) AccountProperties(scope waddrmgr.KeyScope, acct uint32) (*waddrmgr.AccountProperties, error) + func (w *Wallet) Accounts(scope waddrmgr.KeyScope) (*AccountsResult, error) + func (w *Wallet) AddressInfo(a util.Address) (waddrmgr.ManagedAddress, error) + func (w *Wallet) CalculateAccountBalances(account uint32, confirms int32) (Balances, error) + func (w *Wallet) CalculateBalance(confirms int32) (util.Amount, error) + func (w *Wallet) ChainClient() chain.Interface + func (w *Wallet) ChainParams() *netparams.Params + func (w *Wallet) ChainSynced() bool + func (w *Wallet) ChangePassphrases(publicOld, publicNew, privateOld, privateNew []byte) error + func (w *Wallet) ChangePrivatePassphrase(old, new []byte) error + func (w *Wallet) ChangePublicPassphrase(old, new []byte) error + func (w *Wallet) CreateSimpleTx(account uint32, outputs []*wire.TxOut, minconf int32, satPerKb util.Amount) (*txauthor.AuthoredTx, error) + func (w *Wallet) CurrentAddress(account uint32, scope waddrmgr.KeyScope) (util.Address, error) + func (w *Wallet) Database() walletdb.DB + func (w *Wallet) DumpPrivKeys() ([]string, error) + func (w *Wallet) DumpWIFPrivateKey(addr util.Address) (string, error) + func (w *Wallet) GetTransactions(startBlock, endBlock *BlockIdentifier, cancel <-chan struct{}) (*GetTransactionsResult, error) + func (w *Wallet) HaveAddress(a util.Address) (bool, error) + func (w *Wallet) ImportP2SHRedeemScript(script []byte) (*util.AddressScriptHash, error) + func (w *Wallet) ImportPrivateKey(scope waddrmgr.KeyScope, wif *util.WIF, bs *waddrmgr.BlockStamp, rescan bool) (string, error) + func (w *Wallet) ListAddressTransactions(pkHashes map[string]struct{}) ([]btcjson.ListTransactionsResult, error) + func (w *Wallet) ListAllTransactions() ([]btcjson.ListTransactionsResult, error) + func (w *Wallet) ListSinceBlock(start, end, syncHeight int32) ([]btcjson.ListTransactionsResult, error) + func (w *Wallet) ListTransactions(from, count int) ([]btcjson.ListTransactionsResult, error) + func (w *Wallet) ListUnspent(minconf, maxconf int32, addresses map[string]struct{}) ([]*btcjson.ListUnspentResult, error) + func (w *Wallet) Lock() + func (w *Wallet) LockOutpoint(op wire.OutPoint) + func (w *Wallet) Locked() bool + func (w *Wallet) LockedOutpoint(op wire.OutPoint) bool + func (w *Wallet) LockedOutpoints() []btcjson.TransactionInput + func (w *Wallet) MakeMultiSigScript(addrs []util.Address, nRequired int) ([]byte, error) + func (w *Wallet) NewAddress(account uint32, scope waddrmgr.KeyScope, nochain bool) (util.Address, error) + func (w *Wallet) NewChangeAddress(account uint32, scope waddrmgr.KeyScope) (util.Address, error) + func (w *Wallet) NextAccount(scope waddrmgr.KeyScope, name string) (uint32, error) + func (w *Wallet) PrivKeyForAddress(a util.Address) (*ec.PrivateKey, error) + func (w *Wallet) PubKeyForAddress(a util.Address) (*ec.PublicKey, error) + func (w *Wallet) PublishTransaction(tx *wire.MsgTx) error + func (w *Wallet) RenameAccount(scope waddrmgr.KeyScope, account uint32, newName string) error + func (w *Wallet) Rescan(addrs []util.Address, unspent []tm.Credit) error + func (w *Wallet) ResetLockedOutpoints() + func (w *Wallet) SendOutputs(outputs []*wire.TxOut, account uint32, minconf int32, satPerKb util.Amount) (*chainhash.Hash, error) + func (w *Wallet) SetChainSynced(synced bool) + func (w *Wallet) ShuttingDown() bool + func (w *Wallet) SignTransaction(tx *wire.MsgTx, hashType txscript.SigHashType, ...) ([]SignatureError, error) + func (w *Wallet) SortedActivePaymentAddresses() ([]string, error) + func (w *Wallet) Start() + func (w *Wallet) Stop() + func (w *Wallet) SubmitRescan(job *RescanJob) <-chan error + func (w *Wallet) SynchronizeRPC(chainClient chain.Interface) + func (w *Wallet) SynchronizingToNetwork() bool + func (w *Wallet) TotalReceivedForAccounts(scope waddrmgr.KeyScope, minConf int32) ([]AccountTotalReceivedResult, error) + func (w *Wallet) TotalReceivedForAddr(addr util.Address, minConf int32) (util.Amount, error) + func (w *Wallet) Unlock(passphrase []byte, lock <-chan time.Time) error + func (w *Wallet) UnlockOutpoint(op wire.OutPoint) + func (w *Wallet) UnspentOutputs(policy OutputSelectionPolicy) ([]*TransactionOutput, error) + func (w *Wallet) WaitForShutdown()