chainwallet

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Wallet

type Wallet struct {
	// contains filtered or unexported fields
}

Wallet is a holder for keys and UTXOs.

func NewWallet

func NewWallet(log logging.Logger, networkID uint32, chainID ids.ID) *Wallet

NewWallet ...

func (*Wallet) AddAccount

func (w *Wallet) AddAccount(account spchainvm.Account)

AddAccount adds a new account to this wallet, if this wallet can spend it.

func (*Wallet) Balance

func (w *Wallet) Balance() uint64

Balance returns the amount of the assets in this wallet

func (*Wallet) CreateAddress

func (w *Wallet) CreateAddress() (ids.ShortID, error)

CreateAddress returns a brand new address! Ready to receive funds!

func (*Wallet) GenerateTxs

func (w *Wallet) GenerateTxs(numTxs int) error

GenerateTxs generates the transactions that will be sent during the test Generate them all on test initialization so tx generation is not bottleneck in testing

func (*Wallet) ImportKey

func (w *Wallet) ImportKey(sk *crypto.PrivateKeySECP256K1R)

ImportKey imports a private key into this wallet

func (*Wallet) MakeTx

func (w *Wallet) MakeTx() (*spchainvm.Tx, error)

MakeTx creates a new transaction and update the state to after the tx is accepted

func (*Wallet) NextTx

func (w *Wallet) NextTx() *spchainvm.Tx

NextTx returns the next tx to be sent as part of xput test

func (Wallet) String

func (w Wallet) String() string

Jump to

Keyboard shortcuts

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