NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name binance coins in usd
// @namespace Violentmonkey Scripts
// @match https://www.binance.com/*/my/wallet/account/main
// @grant none
// @version 1.0
// @author mads2-
// @description 2/27/2021, 5:47:45 PM - Show usd value of coins at wallet
// @license GPL-3.0-only; http://www.gnu.org/licenses/gpl-3.0.txt
// ==/UserScript==
const Http = new XMLHttpRequest();
const url = 'https://api.blockchain.com/v3/exchange/tickers/BTC-USD';
Http.open("GET", url);
Http.send();
Http.onreadystatechange = (e) => {
var btcPriceBlockchain = JSON.parse(Http.responseText);
setTimeout(() => {
var coluna = document.getElementsByClassName('css-5y1yqn');
var coins = document.getElementsByClassName('css-1qyk0y6');
var priceBTC = btcPriceBlockchain.price_24h;
for (let coin of coins) {
var coinElements = coin.getElementsByClassName('css-12vhwpl');
let valueBtc = coinElements[4].innerText;
let valueUsd = valueBtc * priceBTC;
coinElements[3].innerText = valueUsd;
}
for (let coin of coins) {
var coinElements = coin.getElementsByClassName('css-12vhwpl');
if (isNaN(coinElements[3].innerText)) {
coinElements[3].innerText = 'USD';
}
}
}, 5000);
};