Versions in this module Expand all Collapse all v1 v1.0.0 May 26, 2022 Changes in this version + const HardenedKeyStart + const SUTXOPrefix + const UTXOPreFix + var CoinbaseAbKey = []byte("CoinbaseArbitrary") + var ErrAccountIndex = errors.New("Exceeded maximum accounts per xpub") + var ErrContractIndex = errors.New("Exceeded maximum addresses per account") + var ErrDeriveRule = errors.New("Invalid key derivation rule") + var ErrDuplicateAlias = errors.New("Duplicate account alias") + var ErrDuplicateIndex = errors.New("Duplicate account with same xPubs and index") + var ErrFindAccount = errors.New("Failed to find account") + var ErrFindCtrlProgram = errors.New("Failed to find account control program") + var ErrFindTransaction = errors.New("No transaction") + var ErrImmature = errors.New("reservation found immature funds") + var ErrInsufficient = errors.New("reservation found insufficient funds") + var ErrInvalidAddress = errors.New("Invalid address") + var ErrMarshalAccount = errors.New("Failed to marshal account") + var ErrMatchUTXO = errors.New("can't find utxo with given hash") + var ErrReservation = errors.New("couldn't find reservation") + var ErrReserved = errors.New("reservation found outputs already reserved") + func Annotated(a *Account) *query.AnnotatedAccount + func ContractKey(hash common.Hash) []byte + func ContractUTXOKey(id bc.Hash) []byte + func GetAccountIndexKey(xpubs []chainkd.XPub) []byte + func Key(name string) []byte + func MergeSpendAction(actions []txbuilder.Action) []txbuilder.Action + func SpendAccountChain(ctx context.Context, builder *txbuilder.TemplateBuilder, ...) ([]*txbuilder.Template, error) + func StandardUTXOKey(id bc.Hash) []byte + func UtxoToInputs(signer *signers.Signer, u *UTXO) (*types.TxInput, *txbuilder.SigningInstruction, error) + type Account struct + Alias string + ID string + func CreateAccount(xpubs []chainkd.XPub, quorum int, alias string, acctIndex uint64, ...) (*Account, error) + type CtrlProgram struct + AccountID string + Address string + Change bool + ControlProgram []byte + KeyIndex uint64 + func CreateCtrlProgram(account *Account, addrIdx uint64, change bool) (cp *CtrlProgram, err error) + type Image struct + Slice []*ImageSlice + type ImageSlice struct + Account *Account + ContractIndex uint64 + type Manager struct + func NewManager(walletDB dbm.DB, chain *protocol.Chain) *Manager + func (m *Manager) AddUnconfirmedUtxo(utxos []*UTXO) + func (m *Manager) Backup() (*Image, error) + func (m *Manager) Create(xpubs []chainkd.XPub, quorum int, alias string, deriveRule uint8) (*Account, error) + func (m *Manager) CreateAddress(accountID string, change bool) (cp *CtrlProgram, err error) + func (m *Manager) CreateBatchAddresses(accountID string, change bool, stopIndex uint64) error + func (m *Manager) DecodeSpendAction(data []byte) (txbuilder.Action, error) + func (m *Manager) DecodeSpendUTXOAction(data []byte) (txbuilder.Action, error) + func (m *Manager) DecodeVetoAction(data []byte) (txbuilder.Action, error) + func (m *Manager) DeleteAccount(accountID string) (err error) + func (m *Manager) FindByAlias(alias string) (*Account, error) + func (m *Manager) FindByID(id string) (*Account, error) + func (m *Manager) GetAccountByProgram(program *CtrlProgram) (*Account, error) + func (m *Manager) GetAccountByXPubsIndex(xPubs []chainkd.XPub, index uint64) (*Account, error) + func (m *Manager) GetAliasByID(id string) string + func (m *Manager) GetBip44ContractIndex(accountID string, change bool) uint64 + func (m *Manager) GetCoinbaseArbitrary() []byte + func (m *Manager) GetCoinbaseControlProgram() ([]byte, error) + func (m *Manager) GetCoinbaseCtrlProgram() (*CtrlProgram, error) + func (m *Manager) GetContractIndex(accountID string) uint64 + func (m *Manager) GetLocalCtrlProgramByAddress(address string) (*CtrlProgram, error) + func (m *Manager) GetMiningAddress() (string, error) + func (m *Manager) IsLocalControlProgram(prog []byte) bool + func (m *Manager) ListAccounts(id string) ([]*Account, error) + func (m *Manager) ListControlProgram() ([]*CtrlProgram, error) + func (m *Manager) ListUnconfirmedUtxo(accountID string, isSmartContract bool) []*UTXO + func (m *Manager) RemoveUnconfirmedUtxo(hashes []*bc.Hash) + func (m *Manager) Restore(image *Image) error + func (m *Manager) SaveAccount(account *Account) error + func (m *Manager) SaveControlPrograms(progs ...*CtrlProgram) error + func (m *Manager) SetCoinbaseArbitrary(arbitrary []byte) + func (m *Manager) SetMiningAddress(miningAddress string) (string, error) + func (m *Manager) UpdateAccountAlias(accountID string, newAlias string) (err error) + type UTXO struct + AccountID string + Address string + Amount uint64 + AssetID bc.AssetID + Change bool + ControlProgram []byte + ControlProgramIndex uint64 + OutputID bc.Hash + SourceID bc.Hash + SourcePos uint64 + StateData [][]byte + ValidHeight uint64 + Vote []byte