[0]Balance-Wingman Send shares on win to Vaulet

Every time you win a bet the script sends your desired % to the Vaulet

Stan na 06-08-2020. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         [0]Balance-Wingman Send shares on win to Vaulet
// @description  Every time you win a bet the script sends your desired % to the Vaulet
// @description  Create your acc here to support my work https://stake.com/?c=263733c1bc
// @version      1.4
// @author       Dauersendung
// @namespace    https://greasyfork.org/de/users/444902-dauersendung
// @match        https://stake.com/*
// @run-at document-start
// ==/UserScript==

var accessToken = localStorage.getItem('session').replace(/"/g, '');
var oldBal = localStorage.getItem("oldBal");
if (!oldBal) oldBal = 0;
else oldBal = parseFloat(oldBal);

function depositBal(depositAmount) {
    var data = [
        {
            operationName: "CreateVaultDeposit",
            query: "mutation CreateVaultDeposit($amount: Float!, $currency: CurrencyEnum!) { createVaultDeposit(amount: $amount, currency: $currency) { id amount currency user { id balances { available { amount currency __typename } vault { amount currency __typename } __typename } __typename } __typename } } ",
            variables: {
                amount: depositAmount,
                currency: "xrp",
            }
        }
    ]
    return fetch("https://api.stake.com/graphql", {
        "credentials": "omit",
        "headers": {
            "content-type": "application/json",
            'x-access-token': accessToken,
            'x-lockdown-token': undefined
        },
        "referrer": "https://stake.com/?currency=xrp&modal=vault&operation=deposit",
        "body": JSON.stringify(data),
        "method": "POST",
        "mode": "cors"
    });
}

function checkBalance() {
    var curBalEle = document.querySelector(".styles__Cashier-puey40-2.dMSTdD .styles__Content-rlm06o-1.ixoRjG");
    if (!curBalEle) return false;

    var curBal = curBalEle.innerText;
    if (!curBal) return false;

    if (curBal > oldBal) {
        var depositAmount = ((curBal - oldBal) * 20) / 100;
        depositBal(depositAmount).then(() => {
            oldBal = curBalEle.innerText
            localStorage.setItem("oldBal", oldBal);
        });
    }
}

window.setInterval(checkBalance, 1100);