# Path: btceapi/common.py
# def parseJSONResponse(response):
#     def parse_decimal(var):
#     def __init__(self, timeout=30):
#     def close(self):
#     def getCookie(self):
#     def makeRequest(self, url, extra_headers=None, params="", with_cookie=False):
#     def makeJSONRequest(self, url, extra_headers=None, params=""):
# def validatePair(pair):
# def validateOrder(pair, trade_type, rate, amount):
# def truncateAmountDigits(value, digits):
# def truncateAmount(value, pair):
# def formatCurrencyDigits(value, digits):
# def formatCurrency(value, pair):
# HEADER_COOKIE_RE = re.compile(r'__cfduid=([a-f0-9]{46})')
# BODY_COOKIE_RE = re.compile(r'document\.cookie="a=([a-f0-9]{32});path=/;";')
# class BTCEConnection:
# 
# Path: btceapi/keyhandler.py
# class KeyData(object):
# class KeyHandler(object):
#     def __init__(self, secret, nonce):
#     def __init__(self, filename=None, resaveOnDeletion=True):
#     def __del__(self):
#     def close(self):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_value, traceback):
#     def keys(self):
#     def getKeys(self):
#     def save(self, filename):
#     def addKey(self, key, secret, next_nonce):
#     def getNextNonce(self, key):
#     def getSecret(self, key):
#     def setNextNonce(self, key, next_nonce):


import urllib
import hashlib
import hmac
import warnings
from datetime import datetime
from btceapi import common
from btceapi import keyhandler
        funds = info.get(u'funds')
        for c in common.all_currencies:
            setattr(self, "balance_%s" % c, funds.get(unicode(c), 0))


def setHistoryParams(params, from_number, count_number, from_id, end_id,
                     order, since, end):
    if from_number is not None:
        params["from"] = "%d" % from_number
    if count_number is not None:
        params["count"] = "%d" % count_number
    if from_id is not None:
        params["from_id"] = "%d" % from_id
    if end_id is not None:
        params["end_id"] = "%d" % end_id
    if order is not None:
        if order not in ("ASC", "DESC"):
            raise Exception("Unexpected order parameter: %r" % order)
        params["order"] = order
    if since is not None:
        params["since"] = "%d" % since
    if end is not None:
        params["end"] = "%d" % end


class TradeAPI(object):
    def __init__(self, key, handler):
        self.key = key
        self.handler = handler


# Path: btceapi/common.py
# def parseJSONResponse(response):
#     def parse_decimal(var):
#     def __init__(self, timeout=30):
#     def close(self):
#     def getCookie(self):
#     def makeRequest(self, url, extra_headers=None, params="", with_cookie=False):
#     def makeJSONRequest(self, url, extra_headers=None, params=""):
# def validatePair(pair):
# def validateOrder(pair, trade_type, rate, amount):
# def truncateAmountDigits(value, digits):
# def truncateAmount(value, pair):
# def formatCurrencyDigits(value, digits):
# def formatCurrency(value, pair):
# HEADER_COOKIE_RE = re.compile(r'__cfduid=([a-f0-9]{46})')
# BODY_COOKIE_RE = re.compile(r'document\.cookie="a=([a-f0-9]{32});path=/;";')
# class BTCEConnection:
# 
# Path: btceapi/keyhandler.py
# class KeyData(object):
# class KeyHandler(object):
#     def __init__(self, secret, nonce):
#     def __init__(self, filename=None, resaveOnDeletion=True):
#     def __del__(self):
#     def close(self):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_value, traceback):
#     def keys(self):
#     def getKeys(self):
#     def save(self, filename):
#     def addKey(self, key, secret, next_nonce):
#     def getNextNonce(self, key):
#     def getSecret(self, key):
#     def setNextNonce(self, key, next_nonce):


# Path: btceapi/trade.py
import urllib
import hashlib
import hmac
import warnings
from datetime import datetime
from btceapi import common
from btceapi import keyhandler

        funds = info.get(u'funds')
        for c in common.all_currencies:
            setattr(self, "balance_%s" % c, funds.get(unicode(c), 0))


def setHistoryParams(params, from_number, count_number, from_id, end_id,
                     order, since, end):
    if from_number is not None:
        params["from"] = "%d" % from_number
    if count_number is not None:
        params["count"] = "%d" % count_number
    if from_id is not None:
        params["from_id"] = "%d" % from_id
    if end_id is not None:
        params["end_id"] = "%d" % end_id
    if order is not None:
        if order not in ("ASC", "DESC"):
            raise Exception("Unexpected order parameter: %r" % order)
        params["order"] = order
    if since is not None:
        params["since"] = "%d" % since
    if end is not None:
        params["end"] = "%d" % end


class TradeAPI(object):
    def __init__(self, key, handler):
        self.key = key
        self.handler = handler


        if not isinstance(self.handler, keyhandler.KeyHandler):