# Path: python3-src/piston/storage.py
# class DataDir(object):
# class Key(DataDir):
# class Configuration(DataDir):
# class WrongMasterPasswordException(Exception):
# class MasterPassword(object):
#     def __init__(self):
#     def check_legacy_v1(self):
#     def check_legacy_v2(self):
#     def mkdir_p(self):
#     def sqlite3_backup(self, dbfile, backupdir):
#     def clean_data(self):
#     def refreshBackup(self):
#     def __init__(self):
#     def exists_table(self):
#     def create_table(self):
#     def getPublicKeys(self):
#     def getPrivateKeyForPublicKey(self, pub):
#     def updateWif(self, pub, wif):
#     def add(self, wif, pub):
#     def delete(self, pub):
#     def __init__(self):
#     def exists_table(self):
#     def create_table(self):
#     def checkBackup(self):
#     def _haveKey(self, key):
#     def __getitem__(self, key):
#     def get(self, key, default=None):
#     def __contains__(self, key):
#     def __setitem__(self, key, value):
#     def delete(self, key):
#     def __iter__(self):
#     def __len__(self):
#     def __init__(self, password):
#     def decryptEncryptedMaster(self):
#     def saveEncrytpedMaster(self):
#     def newMaster(self):
#     def deriveChecksum(self, s):
#     def getEncryptedMaster(self):
#     def changePassword(self, newpassword):
#     def purge(self):


import random
from piston.instance import shared_steem_instance
from pistonbase import transactions
from .storage import configStorage as config
                           'sbd': 545133,
                           'steem': 1682519},
                          {'price': 3.086440512632327,
                           'sbd': 333902,
                           'steem': 1030568}]},
        """
        orders = self.steem.rpc.get_order_book(limit, api="market_history")
        r = {"asks": [], "bids": []}
        for side in ["bids", "asks"]:
            for o in orders[side]:
                r[side].append({
                    'price': float(o["price"]),
                    'sbd': o["sbd"] / 10 ** 3,
                    'steem': o["steem"] / 10 ** 3,
                })
        return r

    def returnBalances(self, account=None):
        """ Return SBD and STEEM balance of the account

            :param str account: (optional) the source account for the transfer if not ``default_account``
        """
        return self.steem.get_balances(account)

    def returnOpenOrders(self, account=None):
        """ Return open Orders of the account

            :param str account: (optional) the source account for the transfer if not ``default_account``
        """
        if not account:

# Path: python3-src/piston/storage.py
# class DataDir(object):
# class Key(DataDir):
# class Configuration(DataDir):
# class WrongMasterPasswordException(Exception):
# class MasterPassword(object):
#     def __init__(self):
#     def check_legacy_v1(self):
#     def check_legacy_v2(self):
#     def mkdir_p(self):
#     def sqlite3_backup(self, dbfile, backupdir):
#     def clean_data(self):
#     def refreshBackup(self):
#     def __init__(self):
#     def exists_table(self):
#     def create_table(self):
#     def getPublicKeys(self):
#     def getPrivateKeyForPublicKey(self, pub):
#     def updateWif(self, pub, wif):
#     def add(self, wif, pub):
#     def delete(self, pub):
#     def __init__(self):
#     def exists_table(self):
#     def create_table(self):
#     def checkBackup(self):
#     def _haveKey(self, key):
#     def __getitem__(self, key):
#     def get(self, key, default=None):
#     def __contains__(self, key):
#     def __setitem__(self, key, value):
#     def delete(self, key):
#     def __iter__(self):
#     def __len__(self):
#     def __init__(self, password):
#     def decryptEncryptedMaster(self):
#     def saveEncrytpedMaster(self):
#     def newMaster(self):
#     def deriveChecksum(self, s):
#     def getEncryptedMaster(self):
#     def changePassword(self, newpassword):
#     def purge(self):


# Path: python3-src/piston/dex.py
import random
from piston.instance import shared_steem_instance
from pistonbase import transactions
from .storage import configStorage as config

                           'sbd': 545133,
                           'steem': 1682519},
                          {'price': 3.086440512632327,
                           'sbd': 333902,
                           'steem': 1030568}]},
        """
        orders = self.steem.rpc.get_order_book(limit, api="market_history")
        r = {"asks": [], "bids": []}
        for side in ["bids", "asks"]:
            for o in orders[side]:
                r[side].append({
                    'price': float(o["price"]),
                    'sbd': o["sbd"] / 10 ** 3,
                    'steem': o["steem"] / 10 ** 3,
                })
        return r

    def returnBalances(self, account=None):
        """ Return SBD and STEEM balance of the account

            :param str account: (optional) the source account for the transfer if not ``default_account``
        """
        return self.steem.get_balances(account)

    def returnOpenOrders(self, account=None):
        """ Return open Orders of the account

            :param str account: (optional) the source account for the transfer if not ``default_account``
        """
        if not account:

            if "default_account" in config: