personal

package
v1.5.18 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrivateAccountAPI

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

PrivateAccountAPI is the personal_ prefixed set of APIs in the Web3 JSON-RPC spec.

func NewAPI

NewAPI creates an instance of the public Personal Eth API.

func (*PrivateAccountAPI) ImportRawKey

func (api *PrivateAccountAPI) ImportRawKey(privkey string, password string) (common.Address, error)

ImportRawKey armors and encrypts a given raw hex encoded ECDSA key and stores it into the key directory. The name of the key will have the format "personal_<length-keys>", where <length-keys> is the total number of keys stored on the keyring. NOTE: The key will be both armored and encrypted using the same passphrase.

func (*PrivateAccountAPI) LockAccount

func (api *PrivateAccountAPI) LockAccount(address common.Address) bool

LockAccount will lock the account associated with the given address when it's unlocked. It removes the key corresponding to the given address from the API's local keys.

func (*PrivateAccountAPI) UnlockAccount

func (api *PrivateAccountAPI) UnlockAccount(addr common.Address, password string, duration *uint64) (bool, error)

UnlockAccount will unlock the account associated with the given address with the given password for duration seconds. If duration is nil it will use a default of 300 seconds. It returns an indication if the account was unlocked. It exports the private key corresponding to the given address from the keyring and stores it in the API's local keys.

Jump to

Keyboard shortcuts

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