# 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
# Copyright (c) 2013 Alan McIntyre




class InvalidNonceException(Exception):
    def __init__(self, method, expectedNonce, actualNonce):
        Exception.__init__(self)
        self.method = method
        self.expectedNonce = expectedNonce
        self.actualNonce = actualNonce

    def __str__(self):
        return "Expected a nonce greater than %d" % self.expectedNonce


class TradeAccountInfo(object):
    '''An instance of this class will be returned by
    a successful call to TradeAPI.getInfo.'''

    def __init__(self, info):
        funds = info.get(u'funds')

# 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

# Copyright (c) 2013 Alan McIntyre




class InvalidNonceException(Exception):
    def __init__(self, method, expectedNonce, actualNonce):
        Exception.__init__(self)
        self.method = method
        self.expectedNonce = expectedNonce
        self.actualNonce = actualNonce

    def __str__(self):
        return "Expected a nonce greater than %d" % self.expectedNonce


class TradeAccountInfo(object):
    '''An instance of this class will be returned by
    a successful call to TradeAPI.getInfo.'''

    def __init__(self, info):
        funds = info.get(u'funds')

        for c in common.all_currencies: