address

package
v0.0.0-...-5fbb372 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: LGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Copyright (C) 2018 go-gamc authors

This file is part of the go-gamc library.

the go-gamc library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

the go-gamc library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with the go-gamc library. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAddressNotFound address is not found.
	ErrAddressNotFound = errors.New("address is not found")
	// ErrAddressIsLocked address locked.
	ErrAddressIsLocked   = errors.New("address is locked")
	ErrInvalidPrivateKey = errors.New("private key is invalid")
	ErrInvalidMnemonic   = errors.New("mnemonic is invalid")
)

Functions

func ZeroBytes

func ZeroBytes(bytes []byte)

Types

type AddressManager

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

func NewAddressManager

func NewAddressManager(config *config.Config) (*AddressManager, error)

func (*AddressManager) Accounts

func (am *AddressManager) Accounts() []*core.Address

Accounts returns slice of address

func (*AddressManager) Contains

func (am *AddressManager) Contains(addr *core.Address) bool

Contains returns if contains address

func (*AddressManager) Export

func (am *AddressManager) Export(addr *core.Address, passphrase []byte) ([]byte, error)

Export export address to key file

func (*AddressManager) GetMnemonic

func (am *AddressManager) GetMnemonic(addr *core.Address, passphrase []byte) (string, error)

GetMnemonic

func (*AddressManager) GetPrivateKeyBytMnemonic

func (am *AddressManager) GetPrivateKeyBytMnemonic(memo string) ([]byte, error)

func (*AddressManager) Import

func (am *AddressManager) Import(keyjson, passphrase []byte) (*core.Address, error)

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

func (*AddressManager) ImportByPrivateKey

func (am *AddressManager) ImportByPrivateKey(prikey, passphrase []byte) (*core.Address, error)

func (*AddressManager) Load

func (am *AddressManager) Load(keyjson, passphrase []byte) (*core.Address, error)

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

func (*AddressManager) LoadPrivate

func (am *AddressManager) LoadPrivate(privatekey, passphrase []byte) (*core.Address, error)

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

func (*AddressManager) Lock

func (am *AddressManager) Lock(addr *core.Address) error

Lock lock address

func (*AddressManager) NewAddress

func (am *AddressManager) NewAddress(passphrase []byte) (*core.Address, error)

NewAccount returns a new address and keep it in keystore

func (*AddressManager) RemoveAddress

func (am *AddressManager) RemoveAddress(addr *core.Address, passphrase []byte) error

Remove remove address and encrypted private key from keystore

func (*AddressManager) SignBlock

func (am *AddressManager) SignBlock(addr *core.Address, block *core.Block) error

SignBlock sign block with the specified algorithm

func (*AddressManager) SignHash

func (am *AddressManager) SignHash(addr *core.Address, hash byteutils.Hash) ([]byte, error)

SignHash sign hash

func (*AddressManager) Unlock

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

Unlock unlock address with passphrase

func (*AddressManager) UpdatePassphrase

func (am *AddressManager) UpdatePassphrase(addr *core.Address, oldPassphrase, newPassphrase []byte) error

Update update addr locked passphrase

Jump to

Keyboard shortcuts

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