Skip to content
Snippets Groups Projects
Commit 0cd7a860 authored by crokkon's avatar crokkon
Browse files

steem/wallet.py: documentation updates

parent da9d8b5f
No related branches found
No related tags found
No related merge requests found
...@@ -393,6 +393,8 @@ class Wallet(object): ...@@ -393,6 +393,8 @@ class Wallet(object):
def removeTokenFromPublicName(self, name): def removeTokenFromPublicName(self, name):
""" Remove a token from the wallet database """ Remove a token from the wallet database
:param str name: token to be removed
""" """
if self.tokenStorage: if self.tokenStorage:
# Test if wallet exists # Test if wallet exists
...@@ -401,7 +403,10 @@ class Wallet(object): ...@@ -401,7 +403,10 @@ class Wallet(object):
self.tokenStorage.delete(name) self.tokenStorage.delete(name)
def addPrivateKey(self, wif): def addPrivateKey(self, wif):
"""Add a private key to the wallet database""" """Add a private key to the wallet database
:param str wif: Private key
"""
pub = self._get_pub_from_wif(wif) pub = self._get_pub_from_wif(wif)
if isinstance(wif, PrivateKey): if isinstance(wif, PrivateKey):
wif = str(wif) wif = str(wif)
...@@ -436,6 +441,8 @@ class Wallet(object): ...@@ -436,6 +441,8 @@ class Wallet(object):
def removePrivateKeyFromPublicKey(self, pub): def removePrivateKeyFromPublicKey(self, pub):
""" Remove a key from the wallet database """ Remove a key from the wallet database
:param str pub: Public key
""" """
if self.keyStorage: if self.keyStorage:
# Test if wallet exists # Test if wallet exists
...@@ -445,6 +452,8 @@ class Wallet(object): ...@@ -445,6 +452,8 @@ class Wallet(object):
def removeAccount(self, account): def removeAccount(self, account):
""" Remove all keys associated with a given account """ Remove all keys associated with a given account
:param str account: name of account to be removed
""" """
accounts = self.getAccounts() accounts = self.getAccounts()
for a in accounts: for a in accounts:
...@@ -453,6 +462,10 @@ class Wallet(object): ...@@ -453,6 +462,10 @@ class Wallet(object):
def getKeyForAccount(self, name, key_type): def getKeyForAccount(self, name, key_type):
""" Obtain `key_type` Private Key for an account from the wallet database """ Obtain `key_type` Private Key for an account from the wallet database
:param str name: Account name
:param str key_type: key type, has to be one of "owner", "active",
"posting" or "memo"
""" """
if key_type not in ["owner", "active", "posting", "memo"]: if key_type not in ["owner", "active", "posting", "memo"]:
raise AssertionError("Wrong key type") raise AssertionError("Wrong key type")
...@@ -487,6 +500,10 @@ class Wallet(object): ...@@ -487,6 +500,10 @@ class Wallet(object):
def getKeysForAccount(self, name, key_type): def getKeysForAccount(self, name, key_type):
""" Obtain a List of `key_type` Private Keys for an account from the wallet database """ Obtain a List of `key_type` Private Keys for an account from the wallet database
:param str name: Account name
:param str key_type: key type, has to be one of "owner", "active",
"posting" or "memo"
""" """
if key_type not in ["owner", "active", "posting", "memo"]: if key_type not in ["owner", "active", "posting", "memo"]:
raise AssertionError("Wrong key type") raise AssertionError("Wrong key type")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment