Esempio n. 1
0
def log_in():

    global authenticated
    edicts = [{"op": "login"}]
    order = json_loads(prototype_order())
    order["header"]["wif"] = wif
    order["edicts"] = edicts
    authenticated = broker(order)
Esempio n. 2
0
def place_order():

    global edicts
    order = json_loads(prototype_order())
    order['header']['wif'] = wif
    order['edicts'] = edicts
    broker(order)
    edicts = []
Esempio n. 3
0
def cancel_all():

    global edicts
    edicts = [{'op': 'cancel', 'ids': ['1.7.X']}]
    order = json_loads(prototype_order())
    order['header']['wif'] = wif
    order['edicts'] = edicts
    broker(order)
    edicts = []
Esempio n. 4
0
def log_in():

    global edicts
    edicts = [{'op': 'login'}]
    order = json_loads(prototype_order())
    order['header']['wif'] = wif
    order['edicts'] = edicts
    authenticated = broker(order)
    edicts = []
    return authenticated
Esempio n. 5
0
def authenticate(mode):
    """
    Matches Private Key to Account Name via Public Key
    Calls manualSIGNING.py with broker(order) method
    """
    edicts = [{"op": "login"}]
    order = json_loads(prototype_order())
    order["header"]["wif"] = mode["wif"]
    order["edicts"] = edicts
    authenticated = broker(order)
    return authenticated
Esempio n. 6
0
def place_order(edicts, mode):
    """
    Places BUY and SELL orders given a list of edicts
    Calls manualSIGNING.py with broker(order) method
    """
    order = json_loads(prototype_order())
    order["header"]["wif"] = mode["wif"]
    order["edicts"] = edicts
    live_chart_edicts(edicts)
    if not mode["paper"]:
        broker(order)
    else:
        print(order)
Esempio n. 7
0
def cancel_all(mode):
    """
    Cancels all outstanding orders
    Calls manualSIGNING.py with broker(order) method
    """
    edicts = [{"op": "cancel", "ids": ["1.7.X"]}]
    order = json_loads(prototype_order())
    order["header"]["wif"] = mode["wif"]
    order["edicts"] = edicts
    if not mode["paper"]:
        broker(order)
    else:
        print(order)
Esempio n. 8
0
def place_order(edicts):

    order = json_loads(prototype_order())
    order["header"]["wif"] = wif
    order["edicts"] = edicts
    process(order)