Ejemplo n.º 1
0
def trades(currency, tid=None, since=None):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    c = ""
    if currency == constants.BTC:
        c = ""

    if currency == constants.LTC:
        c = "_litecoin"

    # IMPROVE
    # viz dokumentace
    # nelze kombinovat since & tid
    # neni to uplne jeste je mozne nastavovat time_inicial ...
    params = {}
    if tid:
        params["tid"] = tid

    if since:
        params["since"] = since

    # complete request
    cr = core.request(s, r).replace(constants.CURRENCY_PATTERN,
                                    c) + urllib.parse.urlencode(params)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s),
                    core.timeout(s))
Ejemplo n.º 2
0
def trades(currency, tid=None, since=None):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    c = ""
    if currency == constants.BTC:
        c = ""

    if currency == constants.LTC:
        c = "_litecoin"

    # IMPROVE
    # viz dokumentace
    # nelze kombinovat since & tid
    # neni to uplne jeste je mozne nastavovat time_inicial ...
    params = {}
    if tid:
        params["tid"] = tid

    if since:
        params["since"] = since

    # complete request
    cr = core.request(s, r).replace(constants.CURRENCY_PATTERN, c) + urllib.parse.urlencode(params)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
Ejemplo n.º 3
0
def ticker(id):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    # complete request
    cr = core.request(s, r).replace(constants.SYMBOL_PATTERN, id)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
Ejemplo n.º 4
0
def orderbook(currency):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    # complete request
    cr = core.request(s, r).replace(constants.CURRENCY_PATTERN, currency)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
Ejemplo n.º 5
0
def tickers():
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    # complete request
    cr = core.request(s, r)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
Ejemplo n.º 6
0
def funds():
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    # complete request
    cr = core.request(s, r)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
Ejemplo n.º 7
0
def ticker(id):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    # complete request
    cr = core.request(s, r).replace(constants.SYMBOL_PATTERN, id)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s),
                    core.timeout(s))
Ejemplo n.º 8
0
def all(cur1, cur2=constants.USD):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    symbol = cur1 + cur2

    # complete request
    cr = core.request(s, r).replace(constants.SYMBOL_PATTERN, symbol)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
Ejemplo n.º 9
0
def graph1m(cur1, cur2):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    symbol = cur1.upper().strip() + cur2.upper().strip()

    # complete request
    cr = core.request(s, r).replace(constants.SYMBOL_PATTERN, symbol)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
Ejemplo n.º 10
0
def ticker(cur1, cur2):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    symbol = cur1.capitalize() + cur2.capitalize()

    # complete request
    cr = core.request(s, r).replace(constants.SYMBOL_PATTERN, symbol)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
Ejemplo n.º 11
0
def trades(pair):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    params = {}
    params["pair"] = pair

    # complete request
    cr = core.request(s, r) + urllib.parse.urlencode(params)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
Ejemplo n.º 12
0
def tick(cur1, cur2):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    # complete request
    cr = core.request(s, r).replace(constants.CUR1_PATTERN,
                                    cur1.strip().upper())
    cr = cr.replace(constants.CUR2_PATTERN, cur2.strip().upper())

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s),
                    core.timeout(s))
Ejemplo n.º 13
0
def orderbook(cur1, cur2=constants.USD):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    symbol = cur1 + cur2

    # complete request
    cr = core.request(s, r).replace(constants.SYMBOL_PATTERN, symbol)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s),
                    core.timeout(s))
Ejemplo n.º 14
0
def trades(pair):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    params = {}
    params["pair"] = pair

    # complete request
    cr = core.request(s, r) + urllib.parse.urlencode(params)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s),
                    core.timeout(s))
Ejemplo n.º 15
0
def orderbook(symbol="btcusd"):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    params = {}
    if symbol:
        params["symbol"] = symbol

    # complete request
    cr = core.request(s, r) + urllib.parse.urlencode(params)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
Ejemplo n.º 16
0
def xticker(callback=None):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    params = {}
    if callback:
        params["callback"] = callback

    # complete request
    cr = core.request(s, r) + urllib.parse.urlencode(params)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
Ejemplo n.º 17
0
def trades(symbol, since=None):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    params = {}

    if since:
        params["since"] = since

    # complete request
    cr = core.request(s, r).replace(constants.SYMBOL_PATTERN, symbol) + urllib.parse.urlencode(params)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
Ejemplo n.º 18
0
def order_book(pair, limit=None):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    params = {}
    params["pair"] = pair

    if limit:
        params["limit"] = limit

    # complete request
    cr = core.request(s, r) + urllib.parse.urlencode(params)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
Ejemplo n.º 19
0
def order_book(pair, limit=None):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    params = {}
    params["pair"] = pair

    if limit:
        params["limit"] = limit

    # complete request
    cr = core.request(s, r) + urllib.parse.urlencode(params)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s),
                    core.timeout(s))
Ejemplo n.º 20
0
def trades(cur1, cur2,since=None):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    symbol = cur1.capitalize() + cur2.capitalize()

    params = {}

    if since:
        params["since"] = since

    # complete request
    cr = core.request(s, r).replace(constants.SYMBOL_PATTERN, symbol) + urllib.parse.urlencode(params)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
Ejemplo n.º 21
0
def graph1y(cur1, cur2):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    symbol = cur1.upper().strip() + cur2.upper().strip()

    # complete request
    cr = core.request(s, r).replace(constants.SYMBOL_PATTERN, symbol)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s),
                    core.timeout(s))


# IMPROVE
# CTRANSFER DODELAT NEBO NEJAK VYRESIT
Ejemplo n.º 22
0
def ticker(currency):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    c = ""
    if currency == constants.BTC:
        c = ""

    if currency == constants.LTC:
        c = "_litecoin"

    # complete request
    cr = core.request(s, r).replace(constants.CURRENCY_PATTERN, c)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
Ejemplo n.º 23
0
def ticker(currency):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    c = ""
    if currency == constants.BTC:
        c = ""

    if currency == constants.LTC:
        c = "_litecoin"

    # complete request
    cr = core.request(s, r).replace(constants.CURRENCY_PATTERN, c)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s),
                    core.timeout(s))
Ejemplo n.º 24
0
def detail(cur1, cur2):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    # IMPROVE
    # strip()
    # lower()
    cur2_translation = ""
    if cur2 == "cny":
        cur2_translation = "static"

    if cur2 == "usd":
        cur2_translation = cur2

    # complete request
    cr = core.request(s, r).replace(constants.CUR1_PATTERN, cur1)
    cr = cr.replace(constants.CUR2_PATTERN, cur2_translation)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
Ejemplo n.º 25
0
def trades(cur1, cur2=constants.USD, since=None, sort=None):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    symbol = cur1 + cur2

    # sort =
    # "desc" - returns the transactions in the order of newest to oldest
    # "asc"  - for the return transaction in reverse

    params = {}

    if since:
        params["since"] = since

    # complete request
    cr = core.request(s, r).replace(constants.SYMBOL_PATTERN, symbol) + urllib.parse.urlencode(params)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s), core.timeout(s))
Ejemplo n.º 26
0
def detail(cur1, cur2):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    # IMPROVE
    # strip()
    # lower()
    cur2_translation = ""
    if cur2 == "cny":
        cur2_translation = "static"

    if cur2 == "usd":
        cur2_translation = cur2

    # complete request
    cr = core.request(s, r).replace(constants.CUR1_PATTERN, cur1)
    cr = cr.replace(constants.CUR2_PATTERN, cur2_translation)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s),
                    core.timeout(s))
Ejemplo n.º 27
0
def trades(cur1, cur2=constants.USD, since=None, sort=None):
    s = __name__.split(".")[1]
    r = sys._getframe().f_code.co_name

    symbol = cur1 + cur2

    # sort =
    # "desc" - returns the transactions in the order of newest to oldest
    # "asc"  - for the return transaction in reverse

    params = {}

    if since:
        params["since"] = since

    # complete request
    cr = core.request(s, r).replace(constants.SYMBOL_PATTERN,
                                    symbol) + urllib.parse.urlencode(params)

    return core.get(core.hostname(s), cr, core.header(s), core.compression(s),
                    core.timeout(s))