Documentation
¶
Index ¶
- type FetchInputs
- type SignableTx
- type TxInChecker
- type TxOutChecker
- type Wallet
- func LoadFromFile(netPrefix byte, db *database.DB, fDecoys transactions.FetchDecoys, ...) (*Wallet, error)
- func LoadFromSeed(seed []byte, netPrefix byte, db *database.DB, fDecoys transactions.FetchDecoys, ...) (*Wallet, error)
- func New(Read func(buf []byte) (n int, err error), netPrefix byte, db *database.DB, ...) (*Wallet, error)
- func (w *Wallet) AddInputs(tx *transactions.StandardTx) error
- func (w *Wallet) Balance() (float64, error)
- func (w *Wallet) CheckWireBlock(blk block.Block) (uint64, uint64, error)
- func (w *Wallet) CheckWireBlockReceived(blk block.Block) (uint64, error)
- func (w *Wallet) CheckWireBlockSpent(blk block.Block) (uint64, error)
- func (w *Wallet) ConsensusKeys() user.Keys
- func (w *Wallet) GetSavedHeight() (uint64, error)
- func (w *Wallet) NewBidTx(fee int64, lockTime uint64, amount ristretto.Scalar) (*transactions.BidTx, error)
- func (w *Wallet) NewCoinbaseTx() *transactions.CoinbaseTx
- func (w *Wallet) NewStakeTx(fee int64, lockTime uint64, amount ristretto.Scalar) (*transactions.StakeTx, error)
- func (w *Wallet) NewStandardTx(fee int64) (*transactions.StandardTx, error)
- func (w *Wallet) PrivateSpend() ([]byte, error)
- func (w *Wallet) PublicAddress() (string, error)
- func (w *Wallet) PublicKey() key.PublicKey
- func (w *Wallet) Sign(tx SignableTx) error
- func (w *Wallet) UpdateWalletHeight(newHeight uint64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FetchInputs ¶
type FetchInputs func(netPrefix byte, db *database.DB, totalAmount int64, key *key.Key) ([]*transactions.Input, int64, error)
FetchInputs returns a slice of inputs such that Sum(Inputs)- Sum(Outputs) >= 0 If > 0, then a change address is created for the remaining amount
type SignableTx ¶
type SignableTx interface {
AddDecoys(numMixins int, f transactions.FetchDecoys) error
Prove() error
Standard() (*transactions.StandardTx, error)
}
type TxInChecker ¶
type TxInChecker struct {
// contains filtered or unexported fields
}
TxInChecker contains the necessary information to deduce whether a user has spent a tx. This is just the keyImage.
func NewTxInChecker ¶
func NewTxInChecker(blk block.Block) []TxInChecker
type TxOutChecker ¶
type TxOutChecker struct {
R ristretto.Point
Outputs []*transactions.Output
// contains filtered or unexported fields
}
TxOutChecker holds all of the necessary data in order to check if an oputput was sent to a specified user
func NewTxOutChecker ¶
func NewTxOutChecker(blk block.Block) []TxOutChecker
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
func LoadFromFile ¶
func LoadFromFile(netPrefix byte, db *database.DB, fDecoys transactions.FetchDecoys, fInputs FetchInputs, password string) (*Wallet, error)
func LoadFromSeed ¶
func LoadFromSeed(seed []byte, netPrefix byte, db *database.DB, fDecoys transactions.FetchDecoys, fInputs FetchInputs, password string) (*Wallet, error)
func New ¶
func New(Read func(buf []byte) (n int, err error), netPrefix byte, db *database.DB, fDecoys transactions.FetchDecoys, fInputs FetchInputs, password string) (*Wallet, error)
func (*Wallet) AddInputs ¶
func (w *Wallet) AddInputs(tx *transactions.StandardTx) error
AddInputs adds up the total outputs and fee then fetches inputs to consolidate this
func (*Wallet) CheckWireBlock ¶
func (*Wallet) CheckWireBlockReceived ¶
CheckWireBlockReceived checks if the wire block has transactions for this wallet Returns the number of tx's that the reciever recieved funds in
func (*Wallet) CheckWireBlockSpent ¶
CheckWireBlockSpent checks if the block has any outputs spent by this wallet Returns the number of txs that the sender spent funds in
func (*Wallet) ConsensusKeys ¶
func (*Wallet) GetSavedHeight ¶
func (*Wallet) NewCoinbaseTx ¶
func (w *Wallet) NewCoinbaseTx() *transactions.CoinbaseTx
func (*Wallet) NewStakeTx ¶
func (*Wallet) NewStandardTx ¶
func (w *Wallet) NewStandardTx(fee int64) (*transactions.StandardTx, error)
func (*Wallet) PrivateSpend ¶
func (*Wallet) PublicAddress ¶
func (*Wallet) Sign ¶
func (w *Wallet) Sign(tx SignableTx) error