Documentation
¶
Index ¶
- Constants
- type KeyInfo
- type StatusInfo
- type Summary
- type TxSummary
- type Wallet
- func (w *Wallet) ExportAccountPrivKey(hsm *pseudohsm.HSM, xpub chainkd.XPub, auth string) (*string, error)
- func (w *Wallet) GetAccountUTXOs(id string) ([]account.UTXO, error)
- func (w *Wallet) GetRescanStatus() ([]KeyInfo, error)
- func (w *Wallet) GetTransactionsByAccountID(accountID string) ([]*query.AnnotatedTx, error)
- func (w *Wallet) GetTransactionsByTxID(txID string) ([]*query.AnnotatedTx, error)
- func (w *Wallet) GetTransactionsSummary(transactions []*query.AnnotatedTx) []TxSummary
- func (w *Wallet) ImportAccountPrivKey(hsm *pseudohsm.HSM, xprv chainkd.XPrv, keyAlias, auth string, index uint64, ...) (*pseudohsm.XPub, error)
Constants ¶
View Source
const ( //TxPrefix is wallet database transactions prefix TxPrefix = "TXS:" //TxIndexPrefix is wallet database tx index prefix TxIndexPrefix = "TID:" )
View Source
const SINGLE = 1
SINGLE single sign
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyInfo ¶ added in v0.4.0
type KeyInfo struct { Alias string `json:"alias"` XPub chainkd.XPub `json:"xpub"` Percent uint8 `json:"percent"` Complete bool `json:"complete"` }
KeyInfo is key import status
type StatusInfo ¶
StatusInfo is base valid block info to handle orphan block rollback
type Summary ¶ added in v0.4.0
type Summary struct { Type string `json:"type"` AssetID bc.AssetID `json:"asset_id,omitempty"` AssetAlias string `json:"asset_alias,omitempty"` Amount uint64 `json:"amount,omitempty"` AccountID string `json:"account_id,omitempty"` AccountAlias string `json:"account_alias,omitempty"` Arbitrary chainjson.HexBytes `json:"arbitrary,omitempty"` }
type Wallet ¶
type Wallet struct { DB db.DB AccountMgr *account.Manager AssetReg *asset.Registry ImportPrivKey bool // 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
GetAccountUTXOs return all account unspent outputs
func (*Wallet) GetRescanStatus ¶ added in v0.4.0
GetRescanStatus return key import rescan status
func (*Wallet) GetTransactionsByAccountID ¶ added in v0.3.0
func (w *Wallet) GetTransactionsByAccountID(accountID string) ([]*query.AnnotatedTx, error)
GetTransactionsByAccountID get account txs by account ID
func (*Wallet) GetTransactionsByTxID ¶ added in v0.3.0
func (w *Wallet) GetTransactionsByTxID(txID string) ([]*query.AnnotatedTx, error)
GetTransactionsByTxID get account txs by account tx ID
func (*Wallet) GetTransactionsSummary ¶ added in v0.4.0
func (w *Wallet) GetTransactionsSummary(transactions []*query.AnnotatedTx) []TxSummary
GetTransactionsSummary get transactions summary
Click to show internal directories.
Click to hide internal directories.