Documentation
¶
Overview ¶
Package keystore contains perun wallet and accounts implementation for accessing accounts stored in ethereum keystore.
Index ¶
- type Account
- type Transactor
- type Wallet
- func (w *Wallet) Contains(a common.Address) bool
- func (w *Wallet) DecrementUsage(a wallet.Address)
- func (w *Wallet) IncrementUsage(a wallet.Address)
- func (w *Wallet) LockAll()
- func (w *Wallet) NewAccount() *Account
- func (w *Wallet) NewRandomAccount(rnd *rand.Rand) wallet.Account
- func (w *Wallet) Unlock(addr wallet.Address) (wallet.Account, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
Account represents an ethereum account.
func NewAccountFromEth ¶
NewAccountFromEth creates a new perun account from a given ethereum account.
type Transactor ¶
Transactor can be used to make TransactOpts for accounts stored in a keystore.
func NewTransactor ¶
func NewTransactor(w Wallet, s types.Signer) *Transactor
NewTransactor returns a backend that can make TransactOpts for accounts contained in the given keystore.
func (*Transactor) NewTransactor ¶
func (t *Transactor) NewTransactor(account accounts.Account) (*bind.TransactOpts, error)
NewTransactor returns a TransactOpts for the given account. It errors if the account is not contained in the keystore used for initializing transactOpts backend.
type Wallet ¶
Wallet represents an ethereum wallet. It uses the go-ethereum keystore to store keys. Accessing the wallet is threadsafe, however you should not create two wallets from the same key directory.
func (*Wallet) DecrementUsage ¶
DecrementUsage currently does nothing. In the future, it will track the usage of keys and release unused keys.
func (*Wallet) IncrementUsage ¶
IncrementUsage currently does nothing. In the future, it will track the usage of keys.
func (*Wallet) LockAll ¶
func (w *Wallet) LockAll()
LockAll locks all the wallet's keys and releases all its resources. It is no longer usable after this call.
func (*Wallet) NewAccount ¶
NewAccount creates a new random account which is already unlocked.
func (*Wallet) NewRandomAccount ¶
NewRandomAccount creates a new pseudorandom account using the provided randomness. The returned account is already unlocked.