# README
wallet
Feature Overview
TODO: Flesh out this section
Documentation
Full go doc
style documentation for the project can be viewed online without
installing this package by using the GoDoc site here:
http://godoc.org/github.com/decred/dcrwallet/wallet
You can also view the documentation locally once the package is installed with
the godoc
tool by running godoc -http=":6060"
and pointing your browser to
http://localhost:6060/pkg/github.com/decred/dcrwallet/wallet
Installation
$ go get github.com/decred/dcrwallet/wallet
Package wallet is licensed under the copyfree ISC License.
# Functions
Create creates an new wallet, writing it to an empty database.
CreateWatchOnly creates a watchonly wallet on the provided db.
CurrentAgendas returns the current stake version for the active network and this version of the software, and all agendas defined by it.
DisableLog disables all library log output.
NewBlockIdentifierFromHash constructs a BlockIdentifier for a block hash.
NewBlockIdentifierFromHeight constructs a BlockIdentifier for a block height.
Open loads an already-created wallet from the passed database and namespaces configuration options and sets it up it according to the rest of options.
RecvCategory returns the category of received credit outputs from a transaction record.
TxTransactionType returns the correct TransactionType given a wire transaction.
UnstableAPI exposes additional unstable public APIs for a Wallet.
UseLogger uses a specified Logger to output package logging info.
VerifyMessage verifies that sig is a valid signature of msg and was created using the secp256k1 private key for addr.
WithGapPolicyError configures the NextAddress family of methods to error whenever the gap limit would be exceeded.
WithGapPolicyIgnore configures the NextAddress family of methods to ignore the gap limit entirely when generating addresses.
WithGapPolicyWrap configures the NextAddress family of methods to wrap around to a previously returned address instead of erroring or ignoring the gap limit and returning a new unused address.
# Constants
These constants define the possible credit categories.
These constants define the possible credit categories.
These constants define the possible credit categories.
DefaultGapLimit is the default unused address gap limit defined by BIP0044.
InsecurePubPassphrase is the default outer encryption passphrase used for public data (everything but private keys).
Defined OutputKind constants.
Defined OutputKind constants.
not returned by all APIs yet.
OutputSelectionAlgorithmAll describes the output selection algorithm of picking every possible availble output.
OutputSelectionAlgorithmDefault describes the default output selection algorithm.
TicketStatusExpired any ticket that has yet to be revoked, and was expired.
TicketStatusImmature any so to be live ticket.
TicketStatusLive any currently live ticket.
TicketStatusMissed any ticket that has yet to be revoked, and was missed.
TicketStatusRevoked any ticket that has been previously revoked.
TicketStatusUnknown any ticket that its status was unable to be determined.
TicketStatusUnmined any not yet mined ticket.
TicketStatusVoted any ticket that was seen to have voted.
TransactionTypeCoinbase is the transaction type for all coinbase transactions.
TransactionTypeRegular transaction type for all regular transactions.
TransactionTypeRevocation transaction type for all transactions that consume a ticket, but offer no stake base reward.
TransactionTypeTicketPurchase transaction type for all transactions that consume regular transactions as inputs and have commitments for future votes as outputs.
TransactionTypeVote transaction type for all transactions that consume a ticket and also offer a stake base reward output.
# Variables
ErrBlockchainReorganizing indicates that the blockchain is currently reorganizing.
ErrNegativeFee represents an error where a fee is erroneously negative.
ErrNonPositiveAmount represents an error where an amount is not positive (either negative, or zero).
ErrNoOutsToConsolidate indicates that there were no outputs available to compress.
ErrSStxNotEnoughFunds indicates that not enough funds were available in the wallet to purchase a ticket.
ErrSStxPriceExceedsSpendLimit indicates that the current ticket price exceeds the specified spend maximum spend limit.
ErrTicketPriceNotSet indicates that the wallet was recently connected and that the ticket price has not yet been set.
ErrUnsupportedTransactionType represents an error where a transaction cannot be signed as the API only supports spending P2PKH outputs.
SimulationPassphrase is the password for a wallet created for simnet with --createtemp.
# Structs
AccountBalance associates a total (zero confirmation) balance with an account.
AccountNotification contains properties regarding an account, such as its name and the number of derived and imported keys.
AccountNotificationsClient receives AccountNotifications over the channel C.
AccountResult is a single account result for the AccountsResult type.
AccountsResult is the resutl of the wallet's Accounts method.
AccountTotalReceivedResult is a single result for the Wallet.TotalReceivedForAccounts method.
AgendaChoice describes a user's choice for a consensus deployment agenda.
Block contains the properties and all relevant transactions of an attached block.
BlockIdentifier identifies a block by either a height in the main chain or a hash.
BlockIdentity identifies a block, or the lack of one (used to describe an unmined transaction).
BlockInfo records info pertaining to a block.
Config represents the configuration options needed to initialize a wallet.
ConfirmationNotification describes the number of confirmations of a single transaction, or -1 if the transaction is unknown or removed from the wallet.
ConfirmationNotificationsClient provides confirmation notifications of watched transactions until the caller's context signals done.
CreatedTx holds the state of a newly-created transaction and the change output (if one was added).
GetTicketsResult response struct for gettickets rpc request.
GetTransactionsResult is the result of the wallet's GetTransactions method.
MainTipChangedNotification describes processed changes to the main chain tip block.
MainTipChangedNotificationsClient receives MainTipChangedNotifications over the channel C.
NotificationServer is a server that interested clients may hook into to receive notifications of changes in a wallet.
OutputInfo describes additional info about an output which can be queried using an outpoint.
OutputRedeemer identifies the transaction input which redeems an output.
OutputSelectionPolicy describes the rules for selecting an output from the wallet.
P2SHMultiSigOutput describes a transaction output with a pay-to-script-hash output script and an imported redemption script.
RescannedBlock models the relevant data returned during a rescan from a single block.
RescanProgress records the height the rescan has completed through and any errors during processing of the rescan.
SignatureError records the underlying error when validating a transaction input signature.
StakeDifficultyInfo is a container for stake difficulty information updates.
StakeInfoData is a struct containing the data that would be returned from a StakeInfo request to the wallet.
TicketSummary contains the properties to describe a ticket's current status.
TransactionNotifications is a notification of changes to the wallet's transaction set and the current chain tip that wallet is considered to be synced with.
TransactionNotificationsClient receives TransactionNotifications from the NotificationServer over the channel C.
TransactionOutput describes an output that was or is at least partially controlled by the wallet.
TransactionSummary contains a transaction relevant to the wallet and marks which inputs and outputs were relevant.
TransactionSummaryInput describes a transaction input that is relevant to the wallet.
TransactionSummaryOutput describes wallet properties of a transaction output controlled by the wallet.
Wallet is a structure containing all the components for a complete wallet.
# Interfaces
NetworkBackend provides wallets with Decred network functionality.
# Type aliases
CreditCategory describes the type of wallet transaction output.
NextAddressCallOption defines a call option for the NextAddress family of wallet methods.
OutputKind describes a kind of transaction output.
OutputSelectionAlgorithm specifies the algorithm to use when selecting outputs to construct a transaction.
TicketStatus describes the current status a ticket can be observed to be.
TransactionType describes the which type of transaction is has been observed to be.