wallet

package
v0.0.0-...-9742f5a Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	PublicKey  ed25519.PublicKey
	PrivateKey ed25519.PrivateKey // May be nil
}

func GenerateAccount

func GenerateAccount() (*Account, error)

func (*Account) P2WPKHAddress

func (ac *Account) P2WPKHAddress(v ledger.AddressVersion) *ledger.P2WPKHAddress

type Wallet

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

func NewWallet

func NewWallet(l *logrus.Logger, kp *keypair.KeyPair, dbPath string, ledgerAddr string, insecure bool) (*Wallet, *sql.DB, error)

func (*Wallet) AddBlock

func (w *Wallet) AddBlock(ctx context.Context, block ledger.Block) error

func (*Wallet) AddUTXO

func (w *Wallet) AddUTXO(ctx context.Context, utxo *models.Utxo) error

func (*Wallet) Address

func (w *Wallet) Address() string

func (*Wallet) BlockHeight

func (w *Wallet) BlockHeight(ctx context.Context) (int64, error)

func (*Wallet) DeleteUTXO

func (w *Wallet) DeleteUTXO(ctx context.Context, utxo ledger.Outpoint) error

func (*Wallet) FetchBlocks

func (w *Wallet) FetchBlocks(ctx context.Context) error

func (*Wallet) GetBalance

func (w *Wallet) GetBalance(ctx context.Context) (uint64, error)

func (*Wallet) GetUTXOs

func (w *Wallet) GetUTXOs(ctx context.Context) ([]*models.Utxo, error)

func (*Wallet) MatchesOurWallet

func (w *Wallet) MatchesOurWallet(output ledger.TransactionOutput) (bool, error)

func (*Wallet) PublicKey

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

func (*Wallet) SendCoins

func (w *Wallet) SendCoins(ctx context.Context, target ledger.Address, amount uint32) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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