wallet

package
v0.0.0-...-745f595 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2018 License: MIT Imports: 8 Imported by: 1

Documentation

Overview

Package wallet provides some helpful wallet functionality like seed generation and key derivation.

Index

Constants

View Source
const (
	SeedSize = 32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

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

Account represents an account in a Nano wallet.

func NewAccount

func NewAccount(key ed25519.PrivateKey) *Account

NewAccount creates a new account with the given private key.

func (*Account) Address

func (a *Account) Address() nano.Address

Address returns the public key of this account as an Address type.

func (*Account) Sign

func (a *Account) Sign(hash block.Hash) block.Signature

type Seed

type Seed [SeedSize]byte

func GenerateSeed

func GenerateSeed() (*Seed, error)

func (*Seed) Key

func (s *Seed) Key(index uint32) (ed25519.PrivateKey, error)

func (*Seed) String

func (s *Seed) String() string

type Wallet

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

func Generate

func Generate() (*Wallet, error)

func New

func New(seed *Seed, index uint32) (*Wallet, error)

func (*Wallet) Accounts

func (w *Wallet) Accounts() []*Account

Jump to

Keyboard shortcuts

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