예제 #1
0
def prunableBuyOrders(url, vaults, pairRate, offerAmount, amountOfTimeSec):
    for i in range(0, len(vaults)):
        account = vaults[i].account
        sender = vaults[i].sender
        passphrase = vaults[i].passPhrase
        wallet = vaults[i].wallet
        print("----- START BUY ORDER-----")
        randomUrl = random.choice(url)
        print("------------>   Random URL = " + randomUrl)
        printVault(vaults[i])
        headers = {'Content-Type': "application/x-www-form-urlencoded"}
        offerAmount1 = random.choice(offerAmount)
        print("offerAmount = " + offerAmount1)
        pairRate1 = random.choice(pairRate)
        print("pairRate = " + pairRate1)
        payload = "offerType=0&pairCurrency=1&pairRate=" + pairRate1 + "&messageIsPrunable=True&offerAmount=" + offerAmount1 + "&sender=" + sender + "" \
                                                                                                                              "&passphrase" \
                                                                                                                              "=" + passphrase + "&feeATM=200000000&amountOfTime=" + str(amountOfTimeSec) + "&walletAddress=" + wallet + ""
        try:
            response = requests.request("POST",
                                        "http://" + randomUrl +
                                        "/rest/dex/offer",
                                        data=payload,
                                        headers=headers)
            print("RESPONSE = " + str(response.json()))
            print("----- END -----")
            print("")
        except requests.exceptions.ConnectionError:
            requests.status_code = "Connection refused"
        except UnicodeError as e:
            print("Error = " + str(e))
        except json.decoder.JSONDecodeError as e:
            print("Error = " + str(e))
        i += 1
예제 #2
0
def buyDexPAX(url, vaults, pairRate, offerAmount):
    for i in range(0, len(vaults)):
        account = vaults[i].account
        sender = vaults[i].sender
        passphrase = vaults[i].passPhrase
        wallet = vaults[i].wallet
        print("----- START BUY ORDER-----")
        randomUrl = random.choice(url)
        print("------------>   Random URL = " + randomUrl)
        printVault(vaults[i])
        headers = {
            'Content-Type': "application/x-www-form-urlencoded"

        }

        payload1 = "offerType=0&pairCurrency=2&pairRate=" + pairRate + "&offerAmount=" + offerAmount + "&sender=" + sender + "" \
                                                                                                                              "&passphrase" \
                                                                                                                              "=" + passphrase + "&feeATM=200000000&amountOfTime=9000&walletAddress=" + wallet + ""

        try:
            print(" <-------- START BUY ORDER ----------> ")
            response1 = requests.request("POST", "http://" + randomUrl + "/rest/dex/offer", data=payload1,
                                        headers=headers)
            print("RESPONSE PAX = " + str(response1.json()))
            time.sleep(10)
            print("----- END -----")
            print("")
        except requests.exceptions.ConnectionError:
            requests.status_code = "Connection refused"
        except UnicodeError as e:
            print("Error = " + str(e))
        except json.decoder.JSONDecodeError as e:
            print("Error = " + str(e))
        i += 1
예제 #3
0
def setAccounInfoVault(url):
    for i in range(0, len(vaults)):
        print(" STEP = " + str(i))
        name = "БАГ ДЛЯ ЮРЫ"
        message = "БАГ ДЛЯ ЮРЫ"
        account = vaults[i].account
        sender = vaults[i].sender
        passphrase = vaults[i].passPhrase
        print("SET ACCOUNT INFO")
        randomUrl = random.choice(url)
        print("------------>   Random URL = " + randomUrl)
        printVault(vaults[i])
        headers = {'Content-Type': "application/x-www-form-urlencoded"}

        setAccountInfo = {
            "requestType": "setAccountInfo",
            "name": name,
            "sender": sender,
            "deadline": "1440",
            "message": message,
            "passphrase": passphrase,
            "feeATM": "1000000000"
        }

        print(randomUrl)
        try:
            response = requests.request("POST",
                                        "http://" + randomUrl + "/apl",
                                        params=setAccountInfo)
            print("RESPONSE = " + str(response.json()))
            print("----- END -----")
            print("")
        except requests.exceptions.ConnectionError:
            requests.status_code = "Connection refused"
        except UnicodeError as e:
            print("Error = " + str(e))
        except json.decoder.JSONDecodeError as e:
            print("Error = " + str(e))
        i += 1
예제 #4
0
def AccountPropertyVault(url):
    for i in range(0, len(vaults)):
        print(" STEP = " + str(i))
        value = "standard wallets -> ooopppsss ->   " \
                "';:.,<>/?][{}\|=+-_)($#@!%^&*()  ->  " \
                " END 1.1.1.1.1"
        property = "';:.,<>/?][{}\|=+-_)($#@!%^&*()"
        account = vaults[i].account
        sender = vaults[i].sender
        passphrase = vaults[i].passPhrase

        randomUrl = random.choice(url)
        print("------------>   Random URL = " + randomUrl)
        printVault(vaults[i])
        headers = {'Content-Type': "application/x-www-form-urlencoded"}

        setAccountProperty = {
            "requestType": "setAccountProperty",
            "value": value,
            "sender": sender,
            "deadline": "1440",
            "property": property,
            "passphrase": passphrase,
            "feeATM": "1000000000"
        }

        deleteAccountProperty = {
            "requestType": "deleteAccountProperty",
            "incoming": "true",
            "setterRS": account,
            "value": value,
            "sender": sender,
            "deadline": "1440",
            "property": property,
            "passphrase": passphrase,
            "feeATM": "1000000000"
        }

        print(randomUrl)
        try:
            print("SET ACCOUNT property")
            response = requests.request("POST",
                                        http + randomUrl + "/apl",
                                        params=setAccountProperty)
            print("RESPONSE = " + str(response.json()))
            print("")
        except requests.exceptions.ConnectionError:
            requests.status_code = "Connection refused"
        except UnicodeError as e:
            print("Error = " + str(e))
        except json.decoder.JSONDecodeError as e:
            print("Error = " + str(e))
        time.sleep(5)
        try:
            print("DELETE ACCOUNT PROPERTY")
            response = requests.request("POST",
                                        http + randomUrl + "/apl",
                                        params=deleteAccountProperty)
            print("RESPONSE = " + str(response.json()))
            print("----- END -----")
            print("")
        except requests.exceptions.ConnectionError:
            requests.status_code = "Connection refused"
        except UnicodeError as e:
            print("Error = " + str(e))
        except json.decoder.JSONDecodeError as e:
            print("Error = " + str(e))
        i += 1