wallet

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2018 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//TxPrefix is wallet database transactions prefix
	TxPrefix = "TXS:"
	TxIndex  = "TID:"
)
View Source
const SINGLE = 1

SINGLE single sign

Variables

This section is empty.

Functions

This section is empty.

Types

type StatusInfo

type StatusInfo struct {
	Height uint64
	Hash   bc.Hash
}

StatusInfo is base valid block info to handle orphan block rollback

type Wallet

type Wallet struct {
	DB db.DB

	AccountMgr *account.Manager
	AssetReg   *asset.Registry
	// contains filtered or unexported fields
}

Wallet is related to storing account unspent outputs

func NewWallet added in v0.3.0

func NewWallet(walletDB db.DB, account *account.Manager, asset *asset.Registry, chain *protocol.Chain) (*Wallet, error)

NewWallet return a new wallet instance

func (*Wallet) ExportAccountPrivKey added in v0.3.0

func (w *Wallet) ExportAccountPrivKey(hsm *pseudohsm.HSM, xpub chainkd.XPub, auth string) (*string, error)

ExportAccountPrivKey exports the account private key as a WIF for encoding as a string in the Wallet Import Formt.

func (*Wallet) GetAccountUTXOs added in v0.3.0

func (w *Wallet) GetAccountUTXOs(id string) ([]account.UTXO, error)

GetAccountUTXOs return all account unspent outputs

func (*Wallet) GetTransactionsByAccountID added in v0.3.0

func (w *Wallet) GetTransactionsByAccountID(accountID string) ([]query.AnnotatedTx, error)

func (*Wallet) GetTransactionsByTxID added in v0.3.0

func (w *Wallet) GetTransactionsByTxID(txID string) ([]query.AnnotatedTx, error)

func (*Wallet) ImportAccountPrivKey added in v0.3.0

func (w *Wallet) ImportAccountPrivKey(hsm *pseudohsm.HSM, xprv chainkd.XPrv, alias, auth string, index uint64) (*pseudohsm.XPub, error)

ImportAccountPrivKey imports the account key in the Wallet Import Formt.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL