shell.wallet

class eosfactory.shell.wallet.Wallet(name=None, password='', file=False)[source]

Bases: eosfactory.core.cleos.WalletCreate

Create a new wallet locally and operate it.

Parameters:
  • name (str) – The name of the new wallet, defaults to default.
  • password (str) – The password to the wallet, if the wallet exists.
delete_globals()[source]

Delete from the global namespace all the account objects restored with the function restore_accounts().

import_key(account_or_key)[source]

Imports private keys into wallet.

Return list of cleos.WalletImport objects

Parameters:account_or_key (str or interface.Key or interface.Account) – A private key to import. If account_or_key is an .interface.Account object, both owner and active keys are imported.
index()[source]

Lists opened wallets, * marks unlocked. Returns cleos.WalletList object

is_name_taken(account_object_name, account_name)[source]

Check whether the given name is available is a name of an account object.

If the name points to an existing account, propese an action that may resolve the conflict.

Parameters:
  • account_object_name (str) – The proposed name of a new account object.
  • account_name (str) – The EOSIO name of the account mapped with the new account object.
Returns:

bool

Whether the given name is available is a name of an account

object.

keys()[source]

Lists public keys from all unlocked wallets. Returns cleos.WalletKeys object.

keys_in_wallets(keys)[source]

Check whether all listed keys are in the wallet.

Parameters:keys ([str]) – List of public keys to be verified.
Returns:bool – Whether all listed keys are in the wallet.
lock()[source]

Lock the wallet. Returns cleos.WalletLock object.

lock_all()[source]

Lock the wallet. Returns cleos.WalletLock object.

map_account(account_object)[source]

Save a new account object.

Parameters:account_object (shell.account.Account) – The account to be saved.
open()[source]

Opens the wallet. Returns WalletOpen object

open_unlock()[source]

Open & Unlock.

remove_key(account_or_key)[source]

Remove key from wallet.

Parameters:account_or_key (str or interface.Key or interface.Account) – A public key to remove. If account_or_key is an .interface.Account object, both owner and active keys are removed.
restore_accounts()[source]

Restore into the global namespace all the account objects represented in the wallet.

stop()[source]

Stop keosd, the EOSIO wallet manager.

unlock()[source]

Unlock the wallet. Returns WalletUnlock object.

eosfactory.shell.wallet.create_wallet(name=None, password=None, file=False, wallet_globals=None)[source]

Create a singleton Wallet object.

It is not usual to use this function. Instead, it is called automatically on the first use of either shell.account.create_master_account() or shell.account.create_account() functions.