bitshares.wallet module

class bitshares.wallet.Wallet(*args, **kwargs)

Bases: object

The wallet is meant to maintain access to private keys for your accounts. It either uses manually provided private keys or uses a SQLite database managed by storage.py.

Parameters:
  • rpc (BitSharesNodeRPC) – RPC connection to a BitShares node
  • keys (array,dict,string) – Predefine the wif keys to shortcut the wallet database

Three wallet operation modes are possible:

  • Wallet Database: Here, pybitshares loads the keys from the locally stored wallet SQLite database (see storage.py). To use this mode, simply call BitShares() without the keys parameter
  • Providing Keys: Here, you can provide the keys for your accounts manually. All you need to do is add the wif keys for the accounts you want to use as a simple array using the keys parameter to BitShares().
  • Force keys: This more is for advanced users and requires that you know what you are doing. Here, the keys parameter is a dictionary that overwrite the active, owner, posting or memo keys for any account. This mode is only used for foreign signatures!
MasterPassword = None
addPrivateKey(wif)

Add a private key to the wallet database

changePassphrase(new_pwd)

Change the passphrase for the wallet database

configStorage = None
create(pwd)

Alias for newWallet()

created()

Do we have a wallet database already?

decrypt_wif(encwif)

decrypt a wif key

encrypt_wif(wif)

Encrypt a wif key

getAccount(pub)

Get the account data for a public key (first account found for this public key)

getAccountFromPrivateKey(wif)

Obtain account name from private key

getAccountFromPublicKey(pub)

Obtain the first account name from public key

getAccounts()

Return all accounts installed in the wallet database

getAccountsFromPublicKey(pub)

Obtain all accounts associated with a public key

getActiveKeyForAccount(name)

Obtain owner Active Key for an account from the wallet database

getAllAccounts(pub)

Get the account data for a public key (all accounts found for this public key)

getKeyType(account, pub)

Get key type

getMemoKeyForAccount(name)

Obtain owner Memo Key for an account from the wallet database

getOwnerKeyForAccount(name)

Obtain owner Private Key for an account from the wallet database

getPrivateKeyForPublicKey(pub)

Obtain the private key for a given public key

Parameters:pub (str) – Public Key
getPublicKeys()

Return all installed public keys

keyMap = {}
keyStorage = None
keys = {}
lock()

Lock the wallet database

locked()

Is the wallet database locked?

masterpassword = None
newWallet(pwd)

Create a new wallet database

prefix
removeAccount(account)

Remove all keys associated with a given account

removePrivateKeyFromPublicKey(pub)

Remove a key from the wallet database

rpc
setKeys(loadkeys)

This method is strictly only for in memory keys that are passed to Wallet/BitShares with the keys argument

tryUnlockFromEnv()
unlock(pwd=None)

Unlock the wallet database

unlocked()

Is the wallet database unlocked?

wipe(sure=False)