account

package
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 5, 2019 License: LGPL-3.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EccSecp256K1      = "ECC_SECP256K1"
	EccSecp256K1Value = 1

	DefaultKeyDir = "keydir"
)

const SignatureCiphers

Variables

View Source
var (
	// ErrAccountNotFound account is not found.
	ErrAccountNotFound = errors.New("account is not found")

	// ErrAccountIsLocked account locked.
	ErrAccountIsLocked = errors.New("account is locked")

	// ErrInvalidSignerAddress sign addr not from
	ErrInvalidSignerAddress = errors.New("transaction sign not use from address")
)

Functions

This section is empty.

Types

type Manager

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

Manager accounts manager ,handle account generate and storage

func NewManager

func NewManager(neblet Neblet) (*Manager, error)

NewManager new a account manager

func (*Manager) Accounts

func (m *Manager) Accounts() []*core.Address

Accounts returns slice of address

func (*Manager) Contains added in v1.0.0

func (m *Manager) Contains(addr *core.Address) bool

Contains returns if contains address

func (*Manager) Export

func (m *Manager) Export(addr *core.Address, passphrase []byte) ([]byte, error)

Export export address to key file

func (*Manager) GenerateRandomSeed added in v1.0.2

func (m *Manager) GenerateRandomSeed(addr *core.Address, ancestorHash, parentSeed []byte) (vrfSeed, vrfProof []byte, err error)

GenerateRandomSeed generate rand

func (*Manager) Import

func (m *Manager) Import(keyjson, passphrase []byte) (*core.Address, error)

Import import a key file to keystore, compatible ethereum keystore file, write to file

func (*Manager) Load added in v1.0.0

func (m *Manager) Load(keyjson, passphrase []byte) (*core.Address, error)

Load load a key file to keystore, unable to write file

func (*Manager) LoadPrivate

func (m *Manager) LoadPrivate(privatekey, passphrase []byte) (*core.Address, error)

LoadPrivate load a private key to keystore, unable to write file

func (*Manager) Lock

func (m *Manager) Lock(addr *core.Address) error

Lock lock address

func (*Manager) NewAccount

func (m *Manager) NewAccount(passphrase []byte) (*core.Address, error)

NewAccount returns a new address and keep it in keystore

func (*Manager) Remove added in v1.0.0

func (m *Manager) Remove(addr *core.Address, passphrase []byte) error

Remove remove address and encrypted private key from keystore

func (*Manager) SignBlock added in v1.0.0

func (m *Manager) SignBlock(addr *core.Address, block *core.Block) error

SignBlock sign block with the specified algorithm

func (*Manager) SignHash added in v1.0.0

func (m *Manager) SignHash(addr *core.Address, hash byteutils.Hash, alg keystore.Algorithm) ([]byte, error)

SignHash sign hash

func (*Manager) SignTransaction

func (m *Manager) SignTransaction(addr *core.Address, tx *core.Transaction) error

SignTransaction sign transaction with the specified algorithm

func (*Manager) SignTransactionWithPassphrase added in v0.3.0

func (m *Manager) SignTransactionWithPassphrase(addr *core.Address, tx *core.Transaction, passphrase []byte) error

SignTransactionWithPassphrase sign transaction with the from passphrase

func (*Manager) Unlock

func (m *Manager) Unlock(addr *core.Address, passphrase []byte, duration time.Duration) error

Unlock unlock address with passphrase

func (*Manager) Update added in v0.3.0

func (m *Manager) Update(addr *core.Address, oldPassphrase, newPassphrase []byte) error

Update update addr locked passphrase

type Neblet

type Neblet interface {
	Config() *nebletpb.Config
}

Neblet interface breaks cycle import dependency and hides unused services.

Jump to

Keyboard shortcuts

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