Documentation ¶
Overview ¶
Package account stores and tracks accounts within a Chain Core.
Index ¶
- Constants
- Variables
- type Account
- type Manager
- func (m *Manager) AnnotateTxs(ctx context.Context, txs []map[string]interface{}) error
- func (m *Manager) Create(ctx context.Context, xpubs []string, quorum int, alias string, ...) (*Account, error)
- func (m *Manager) CreateControlProgram(ctx context.Context, accountID string, change bool) ([]byte, error)
- func (m *Manager) DecodeControlAction(data []byte) (txbuilder.Action, error)
- func (m *Manager) DecodeSpendAction(data []byte) (txbuilder.Action, error)
- func (m *Manager) DecodeSpendUTXOAction(data []byte) (txbuilder.Action, error)
- func (m *Manager) ExpireReservations(ctx context.Context, period time.Duration)
- func (m *Manager) FindByAlias(ctx context.Context, alias string) (*signers.Signer, error)
- func (m *Manager) IndexAccounts(indexer Saver, pinStore *pin.Store)
- func (m *Manager) IndexUnconfirmedUTXOs(ctx context.Context, tx *bc.Tx) error
- func (m *Manager) NewControlAction(amt bc.AssetAmount, accountID string, refData chainjson.Map) txbuilder.Action
- func (m *Manager) NewSpendAction(amt bc.AssetAmount, accountID string, txHash *bc.Hash, txOut *uint32, ...) txbuilder.Action
- func (m *Manager) NewSpendUTXOAction(outpoint bc.Outpoint) txbuilder.Action
- func (m *Manager) ProcessBlocks(ctx context.Context)
- type Saver
Constants ¶
const ( // PinName is used to identify the pin associated with // the account block processor. PinName = "account" )
Variables ¶
var ErrDuplicateAlias = errors.New("duplicate account alias")
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager stores accounts and their associated control programs.
func (*Manager) AnnotateTxs ¶
AnnotateTxs adds account data to transactions
func (*Manager) Create ¶
func (m *Manager) Create(ctx context.Context, xpubs []string, quorum int, alias string, tags map[string]interface{}, clientToken *string) (*Account, error)
Create creates a new Account.
func (*Manager) CreateControlProgram ¶
func (m *Manager) CreateControlProgram(ctx context.Context, accountID string, change bool) ([]byte, error)
CreateControlProgram creates a control program that is tied to the Account and stores it in the database.
func (*Manager) DecodeControlAction ¶
func (*Manager) DecodeSpendAction ¶
func (*Manager) DecodeSpendUTXOAction ¶
func (*Manager) ExpireReservations ¶
ExpireReservations removes reservations that have expired periodically. It blocks until the context is canceled.
func (*Manager) FindByAlias ¶
FindByAlias retrieves an account's Signer record by its alias
func (*Manager) IndexUnconfirmedUTXOs ¶
IndexUnconfirmedUTXOs looks up a transaction's control programs for matching account control programs. If any control programs match, the unconfirmed UTXOs are inserted into account_utxos with an expiry_height. If not confirmed by the expiry_height, the UTXOs will be deleted (and assumed rejected).