dagwallet

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 UTXOSet

type UTXOSet struct {

	// List of UTXOs in this set
	// This can be used to iterate over. It should not be modified externally.
	UTXOs []*spdagvm.UTXO
	// contains filtered or unexported fields
}

UTXOSet ...

func (*UTXOSet) Get

func (us *UTXOSet) Get(id ids.ID) *spdagvm.UTXO

Get ...

func (*UTXOSet) Put

func (us *UTXOSet) Put(utxo *spdagvm.UTXO)

Put ...

func (*UTXOSet) Remove

func (us *UTXOSet) Remove(id ids.ID) *spdagvm.UTXO

Remove ...

func (*UTXOSet) String

func (us *UTXOSet) String() string

type Wallet

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

Wallet is a holder for keys and UTXOs for the Ava DAG.

func NewWallet

func NewWallet(networkID uint32, chainID ids.ID, txFee uint64) *Wallet

NewWallet returns a new Wallet

func (*Wallet) AddUTXO

func (w *Wallet) AddUTXO(utxo *spdagvm.UTXO)

AddUTXO adds a new UTXO to this wallet if this wallet may spend it The UTXO's output must be an OutputPayment

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

CreateAddress returns a new address. It also saves the address and the private key that controls it so the address can be used later

func (*Wallet) GetAddress

func (w *Wallet) GetAddress() ids.ShortID

GetAddress returns one of the addresses this wallet manages. If no address exists, one will be created.

func (*Wallet) ImportKey

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

ImportKey imports a private key into this wallet

func (*Wallet) Send

func (w *Wallet) Send(amount uint64, locktime uint64, destAddr ids.ShortID) *spdagvm.Tx

Send sends [amount] to address [destAddr] The output of this transaction may be spent after [locktime]

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