softwallet

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeystoreType

type KeystoreType int
const (
	KeystoreTypeEncrypted KeystoreType = iota
	KeystoreTypePlain
)

type SoftWallet

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

func NewSoftWallet

func NewSoftWallet(keysDirPath string, kstype KeystoreType) (*SoftWallet, error)

func (*SoftWallet) Delete

func (w *SoftWallet) Delete(address common.Address, password string) error

Delete deletes a key from disk permanently

func (*SoftWallet) Derive

func (w *SoftWallet) Derive(path types.DerivationPath, pin bool) (common.Address, error)

Derive is not supported for SoftWallet

func (*SoftWallet) GetPublicKey

func (w *SoftWallet) GetPublicKey(address common.Address) (*crypto.PublicKey, error)

GetPublicKey returns the public key of the address if the address has been unlocked

func (*SoftWallet) ID

func (w *SoftWallet) ID() string

ID returns the ID of the wallet

func (*SoftWallet) IsUnlocked

func (w *SoftWallet) IsUnlocked(address common.Address) bool

IsUnlocked indicates whether a key is unlocked

func (*SoftWallet) List

func (w *SoftWallet) List() ([]common.Address, error)

List returns the addresses of all the keys

func (*SoftWallet) Lock

func (w *SoftWallet) Lock(address common.Address) error

Lock locks an unlocked key

func (*SoftWallet) NewKey

func (w *SoftWallet) NewKey(password string) (common.Address, error)

NewKey creates a new key

func (*SoftWallet) Sign

func (w *SoftWallet) Sign(address common.Address, txrlp common.Bytes) (*crypto.Signature, error)

Sign signs the transaction bytes for an address if the address has been unlocked

func (*SoftWallet) Status

func (w *SoftWallet) Status() (string, error)

Status returns the status of the wallet

func (*SoftWallet) Unlock

func (w *SoftWallet) Unlock(address common.Address, password string, derivationPath types.DerivationPath) error

Unlock unlocks a key if the password is correct

func (*SoftWallet) UpdatePassword

func (w *SoftWallet) UpdatePassword(address common.Address, oldPassword, newPassword string) error

UpdatePassword updates the password for a key

type UnlockedKey

type UnlockedKey struct {
	*ks.Key
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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