package
1.1.0
Repository: https://github.com/diviproject/diviwallet.git
Documentation: pkg.go.dev

# README

wtxmgr

[Build Status] (https://travis-ci.org/DiviProject/diviwallet)

Package wtxmgr provides storage and spend tracking of wallet transactions and their relevant input and outputs.

Feature overview

  • Storage for relevant wallet transactions
  • Ability to mark outputs as controlled by wallet
  • Unspent transaction output index
  • Balance tracking
  • Automatic spend tracking for transaction inserts and removals
  • Double spend detection and correction after blockchain reorgs
  • Scalable design:
    • Utilizes similar prefixes to allow cursor iteration over relevant transaction inputs and outputs
    • Programmatically detectable errors, including encapsulation of errors from packages it relies on
    • Operates under its own walletdb namespace

Documentation

[GoDoc] (http://godoc.org/github.com/DiviProject/diviwallet/wtxmgr)

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/DiviProject/diviwallet/wtxmgr

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/DiviProject/diviwallet/wtxmgr

Installation

$ go get github.com/DiviProject/diviwallet/wtxmgr

Package wtxmgr is licensed under the copyfree ISC License.

# Functions

Create creates a new persistent transaction store in the walletdb namespace.
DependencySort topologically sorts a set of transactions by their dependency order.
DisableLog disables all library log output.
IsNoExists returns whether an error is a Error with the ErrNoExists error code.
NewMigrationManager creates a new migration manager for the transaction manager.
NewTxRecord creates a new transaction record that may be inserted into the store.
NewTxRecordFromMsgTx creates a new transaction record that may be inserted into the store.
Open opens the wallet transaction store from a walletdb namespace.
UseLogger uses a specified Logger to output package logging info.

# Constants

ErrAlreadyExists describes an error where creating the store cannot continue because a store already exists in the namespace.
ErrData describes an error where data stored in the transaction database is incorrect.
ErrDatabase indicates an error with the underlying database.
ErrInput describes an error where the variables passed into this function by the caller are obviously incorrect.
ErrNeedsUpgrade describes an error during store opening where the database contains an older version of the store.
ErrNoExists describes an error where the store cannot be opened due to it not already existing in the namespace.
ErrUnknownVersion describes an error where the store already exists but the database version is newer than latest version known to this software.

# Structs

Block contains the minimum amount of data to uniquely identify any block on either the best or side chain.
BlockMeta contains the unique identification for a block and any metadata pertaining to the block.
Credit is the type representing a transaction output which was spent or is still spendable by wallet.
CreditRecord contains metadata regarding a transaction credit for a known transaction.
DebitRecord contains metadata regarding a transaction debit for a known transaction.
Error provides a single type for errors that can happen during Store operation.
MigrationManager is an implementation of the migration.Manager interface that will be used to handle migrations for the address manager.
Store implements a transaction store for storing and managing wallet transactions.
TxDetails is intended to provide callers with access to rich details regarding a relevant transaction and which inputs and outputs are credit or debits.
TxRecord represents a transaction managed by the Store.

# Type aliases

ErrorCode identifies a category of error.