wallet

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

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) Balance

func (w *Wallet) Balance() (float64, error)

func (*Wallet) CheckWireBlock

func (w *Wallet) CheckWireBlock(blk block.Block) (uint64, uint64, error)

func (*Wallet) CheckWireBlockReceived

func (w *Wallet) CheckWireBlockReceived(blk block.Block) (uint64, error)

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

func (w *Wallet) CheckWireBlockSpent(blk block.Block) (uint64, error)

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 (w *Wallet) ConsensusKeys() user.Keys

func (*Wallet) GetSavedHeight

func (w *Wallet) GetSavedHeight() (uint64, error)

func (*Wallet) NewBidTx

func (w *Wallet) NewBidTx(fee int64, lockTime uint64, amount ristretto.Scalar) (*transactions.BidTx, error)

func (*Wallet) NewCoinbaseTx

func (w *Wallet) NewCoinbaseTx() *transactions.CoinbaseTx

func (*Wallet) NewStakeTx

func (w *Wallet) NewStakeTx(fee int64, lockTime uint64, amount ristretto.Scalar) (*transactions.StakeTx, error)

func (*Wallet) NewStandardTx

func (w *Wallet) NewStandardTx(fee int64) (*transactions.StandardTx, error)

func (*Wallet) PrivateSpend

func (w *Wallet) PrivateSpend() ([]byte, error)

func (*Wallet) PublicAddress

func (w *Wallet) PublicAddress() (string, error)

func (*Wallet) PublicKey

func (w *Wallet) PublicKey() key.PublicKey

func (*Wallet) Sign

func (w *Wallet) Sign(tx SignableTx) error

func (*Wallet) UpdateWalletHeight

func (w *Wallet) UpdateWalletHeight(newHeight uint64) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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