package
7.0.0
Repository: https://github.com/decred/dcrdata.git
Documentation: pkg.go.dev

# Functions

AddrTxnViewTypeFromStr attempts to decode a string into an AddrTxnViewType.
AgendaStatusFromStr creates an agenda status from a string.
CalculateHashRate calculates the hashrate from the difficulty value and the targetTimePerBlock in seconds.
CalculateWindowIndex calculates the window index from the quotient of a block height and the chainParams.StakeDiffWindowSize.
ChoiceIndexFromStr converts the vote choice string to a vote choice index.
CompactRows converts a []*AddressRow to a []*AddressRowCompact.
CountCreditDebitRows returns the numbers of credit (funding) and debit (!funding) address rows in a []*AddressRow.
CountMergedRows counts the number of merged rows that would result from calling MergeRows on the input slice.
CountMergedRowsCompact counts the number of merged rows that would result from calling MergeRowsCompact (a non-merged row) on the input slice.
CountUnspentCreditRows returns the numbers of unspent credit (funding) address rows in a []*AddressRow.
DevSubsidyAddress returns the development subsidy address for the specified network.
ExtractBlockTransactions extracts transaction information from a wire.MsgBlock and returns the processed information in slices of the dbtypes Tx, Vout, and VinTxPropertyARRAY.
IsTimeout checks if the message is prefixed with the expected DB timeout message prefix.
IsTimeoutErr checks if error's message is prefixed with the expected DB timeout message prefix.
MergeRows converts a slice of non-merged (regular addresses table row data) into a slice of merged address rows.
MergeRowsCompact converts a []*AddressRowCompact (non-merged rows) into a slice of merged address rows.
MergeRowsCompactRange is like MergeRowsCompact except it extracts and converts a range of []*AddressRowCompact (non-merged rows) into a slice of merged address rows.
MergeRowsRange is like MergeRows except it extracts and converts a range of []*AddressRow (non-merged rows) into a slice of merged address rows.
MsgBlockToDBBlock creates a dbtypes.Block from a wire.MsgBlock.
NewError wraps the provided Error with details in an Error, facilitating the use of errors.Is and errors.As via errors.Unwrap.
NewScriptClass converts a stdscript.ScriptType to the DB's ScriptClass type, which is less fine-grained with respect to the stake subtypes.
NewScriptClassFromString creates a ScriptClass from a string representation.
NewTimeDef constructs a TimeDef from the given time.Time.
NewTimeDefFromUNIX constructs a TimeDef from the given UNIX epoch time stamp in seconds.
ReduceAddressHistory generates a template AddressInfo from a slice of AddressRow.
SliceAddressCreditRows selects a subset of the crediting elements of the AddressRow slice given the count and offset.
SliceAddressDebitRows selects a subset of the debiting elements of the AddressRow slice given the count and offset.
SliceAddressRows selects a subset of the elements of the AddressRow slice given the count, offset, and view AddrTxnViewType.
SliceAddressRowsAll selects a subset of the elements of the AddressRow slice given the count and offset.
SliceAddressUnspentCreditRows selects a subset of the unspent crediting elements of the AddressRow slice given the count and offset.
TimeBasedGroupingToInterval converts the TimeBasedGrouping value to an actual time value in seconds based on the gregorian calendar except AllGrouping that returns 1 while the unknownGrouping returns -1 and an error.
TimeGroupingFromStr converts groupings string to its respective TimeBasedGrouping value.
UncompactMergedRows converts (to the extent possible) a []*AddressRowMerged to a []*AddressRow.
UncompactRows converts (to the extent possible) a []AddressRowCompact to a []*AddressRow.

# Constants

These are the recognized VoteChoice values.
ActivatedAgendaStatus is the agenda status chaincfg.Params.RuleChangeActivationInterval blocks (e.g.
AddressesTableSync is a sync that runs immediately after initialDBLoad.
These are the recognized AddrTxnViewType values.
These are the recognized AddrTxnViewType values.
These are the recognized AddrTxnViewType values.
These are the recognized AddrTxnViewType values.
These are the recognized AddrTxnViewType values.
These are the recognized AddrTxnViewType values.
These are the recognized AddrTxnViewType values.
These are the recognized AddrTxnViewType values.
These are the recognized TimeBasedGrouping values.
These are the recognized HistoryChart values.
These are text keys used to identify different chart types.
These are text keys used to identify different chart types.
These are text keys used to identify different chart types.
These are the recognized HistoryChart values.
These are text keys used to identify different chart types.
These are the recognized TimeBasedGrouping values.
These are text keys used to identify different chart types.
FailedAgendaStatus is the agenda status set when the votes tally does not attain the minimum threshold set.
These are text keys used to identify different chart types.
These are text keys used to identify different chart types.
InitialAgendaStatus is the agenda status when the agenda is not yet up for voting and the votes tally is not also available.
InitialDBLoad is a sync where data is first loaded from the chain db into the respective dbs currently supported.
LockedInAgendaStatus is the agenda status when the agenda is considered to have passed after attaining the minimum set threshold.
These are the recognized TimeBasedGrouping values.
These are the recognized VoteChoice values.
NumIntervals is the number of known values for TimeBasedGrouping.
NB:PoolStatusLive also defines immature tickets in addition to defining live tickets.
NB:PoolStatusLive also defines immature tickets in addition to defining live tickets.
NB:PoolStatusLive also defines immature tickets in addition to defining live tickets.
NB:PoolStatusLive also defines immature tickets in addition to defining live tickets.
These are text keys used to identify different chart types.
Classes of script payment known about in the blockchain.
Multi signature.
None of the recognized forms.
Empty data-only (provably prunable).
Pay pubkey.
Alternative signature pubkey.
Pay pubkey hash.
Alternative signature pubkey hash.
Pay to script hash.
Stake generation.
Stake revocation.
Change for stake submission tx.
Pseudo-class for stake submission commitments, odd outputs.
Stake submission.
Add value to treasury.
Generate utxos from treasury account.
StartedAgendaStatus is the agenda status when the agenda is up for voting.
These are text keys used to identify different chart types.
These are text keys used to identify different chart types.
These are text keys used to identify different chart types.
These are text keys used to identify different chart types.
These are the recognized TicketSpendType values.
These are text keys used to identify different chart types.
These are text keys used to identify different chart types.
These are the recognized TicketSpendType values.
These are the recognized TicketSpendType values.
These are text keys used to identify different chart types.
These are text keys used to identify different chart types.
These are the recognized HistoryChart values.
These are the recognized TimeBasedGrouping values.
UnknownStatus is used when a status string is not recognized.
These are the recognized VoteChoice values.
These are the recognized TimeBasedGrouping values.
These are the recognized TimeBasedGrouping values.
These are the recognized VoteChoice values.

# Variables

AddrTxnViewTypes is the canonical mapping from AddrTxnViewType to string.
No description provided by the author
ErrNoResult should be returned by the db driver instead of driver-specific errors like sql.ErrNoRows.
PGCancelError is the error string PostgreSQL returns when a query fails to complete due to user requested cancellation.
TimeBasedGroupings maps a given time grouping to its standard string value.
TimeIntervals is an array of distinct time intervals used for grouping data.
No description provided by the author

# Structs

AddressBalance represents the number and value of spent and unspent outputs for an address.
AddressInfo models data for display on the address page.
AddressMetrics defines address metrics needed to make decisions by which grouping buttons on the address history page charts should be disabled or enabled by default.
AddressRow represents a row in the addresses table.
AddressRowCompact is like AddressRow for efficient in-memory storage of non-merged address transaction data.
AddressRowMerged is like AddressRow for efficient in-memory storage of merged address transaction data.
AddressTransactions collects the transactions for an address as AddressTx slices.
AddressTx models data for transactions on the address page.
AddressTxnOutput is a compact version of api/types.AddressTxnOutput.
AgendaSummary describes a short summary of a given agenda that includes vote choices tally and deployment rule change intervals.
AgendaVoteChoices contains the vote counts on multiple intervals of time.
Block models a Decred block.
BlockChainData defines data holding the latest block chain state from the getblockchaininfo rpc endpoint.
No description provided by the author
BlocksGroupedInfo contains the data about a stake difficulty (ticket price) window, including intrinsic properties (e.g.
BlockStatus describes a block's status in the block chain.
ChartsData defines the fields that store the values needed to plot the charts on the frontend.
DeletionSummary provides the number of rows removed from the tables when a block is removed.
Error pairs an error with details.
MileStone defines the various stages passed by vote on a given agenda.
PoolTicketsData defines the real time data needed for ticket pool visualization charts.
ProgressBarLoad contains the raw data needed to populate the status sync updates.
ScriptPubKeyData is part of the result of decodescript(ScriptPubKeyHex).
ScriptSig models the signature script used to redeem the origin transaction as a JSON object (non-coinbase txns only).
SideChain represents blocks of a side chain, in ascending height order.
SyncResult is the result of a database sync operation, containing the height of the last block and an error value.
TimeDef is time.Time wrapper that formats time by default as a string without a timezone.
TreasuryBalance is the current balance, spent amount, and tx count for the treasury.
TreasurySpendVotes summarizes the vote tally for a tspend.
No description provided by the author
Tx models a Decred transaction.
UTXO represents a transaction output, but it is intended to help track unspent outputs.
UTXOData stores an address and value associated with a transaction output.
Vin models a transaction input.
VinTxProperty models a transaction input with previous outpoint information.
Vout defines a transaction output.

# Type aliases

AddrTxnViewType enumerates the different address transaction view types as displayed by the address page.
AgendaStatusType defines the various agenda statuses.
DeletionSummarySlice is used to define methods on DeletionSummary slices.
ErrorKind identifies a kind of error that can be used to define new errors via const SomeError = dbtypes.ErrorKind("something").
HistoryChart is used to differentiate the distinct graphs that appear on the address history page.
JSONB is used to implement the sql.Scanner and driver.Valuer interfaces required for the type to make a postgresql compatible JSONB type.
ScriptClass is an enumeration for the list of standard types of script.
No description provided by the author
No description provided by the author
TimeBasedGrouping defines the possible ways that a time can be grouped according to all, year, month, week or day grouping.
TimeDefLocal satisfies the sql.Valuer interface, but it provides Local Time.
UInt64Array represents a one-dimensional array of PostgreSQL integer types.
VinTxPropertyARRAY is a slice of VinTxProperty structs that implements sql.Scanner and driver.Valuer.
VoteChoice defines the type of vote choice, and the underlying integer value is stored in the database (do not change these without upgrading the DB!).