accounts

package
v0.9.25 Latest Latest
Warning

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

Go to latest
Published: May 27, 2015 License: LGPL-2.1-or-later Imports: 8 Imported by: 0

Documentation

Overview

This file is part of go-ethereum

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

go-ethereum 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 Lesser General Public License
along with go-ethereum.  If not, see <http://www.gnu.org/licenses/>.

*

  • @authors
  • Gustav Simonsson <gustav.simonsson@gmail.com>
  • @date 2015 *

This abstracts part of a user's interaction with an account she controls. It's not an abstraction of core Ethereum accounts data type / logic - for that see the core processing code of blocks / txs.

Currently this is pretty much a passthrough to the KeyStore2 interface, and accounts persistence is derived from stored keys' addresses

Index

Constants

View Source
const (
	// Default unlock duration (in seconds) when an account is unlocked from the console
	DefaultAccountUnlockDuration = 300
)

Variables

View Source
var (
	ErrLocked = errors.New("account is locked")
	ErrNoKeys = errors.New("no keys in store")
)

Functions

This section is empty.

Types

type Account

type Account struct {
	Address common.Address
}

type Manager

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

func NewManager

func NewManager(keyStore crypto.KeyStore2) *Manager

func (*Manager) Accounts added in v0.9.17

func (am *Manager) Accounts() ([]Account, error)

func (*Manager) DeleteAccount added in v0.9.17

func (am *Manager) DeleteAccount(address common.Address, auth string) error

func (*Manager) Export added in v0.9.17

func (am *Manager) Export(path string, addr common.Address, keyAuth string) error

USE WITH CAUTION = this will save an unencrypted private key on disk no cli or js interface

func (*Manager) HasAccount added in v0.9.17

func (am *Manager) HasAccount(addr common.Address) bool

func (*Manager) Import added in v0.9.17

func (am *Manager) Import(path string, keyAuth string) (Account, error)

func (*Manager) ImportPreSaleKey added in v0.9.17

func (am *Manager) ImportPreSaleKey(keyJSON []byte, password string) (acc Account, err error)

func (*Manager) NewAccount added in v0.9.17

func (am *Manager) NewAccount(auth string) (Account, error)

func (*Manager) Primary added in v0.9.17

func (am *Manager) Primary() (addr common.Address, err error)

func (*Manager) Sign added in v0.9.17

func (am *Manager) Sign(a Account, toSign []byte) (signature []byte, err error)

func (*Manager) TimedUnlock added in v0.9.17

func (am *Manager) TimedUnlock(addr common.Address, keyAuth string, timeout time.Duration) error

TimedUnlock unlocks the account with the given address. When timeout has passed, the account will be locked again.

func (*Manager) Unlock added in v0.9.17

func (am *Manager) Unlock(addr common.Address, keyAuth string) error

Unlock unlocks the account with the given address. The account stays unlocked until the program exits or until a TimedUnlock timeout (started after the call to Unlock) expires.

Directories

Path Synopsis
Package abi implements the Ethereum ABI (Application Binary Interface).
Package abi implements the Ethereum ABI (Application Binary Interface).

Jump to

Keyboard shortcuts

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