Automate your Bittrex google sheets with javascript

Too long to post here:

pastebin.com/9ShA0zcN

I wrote some code for google sheets that will automatically populate the sheet with your balances on bittrex with the name of the coin, how many you hold, and the price.

Also included are functions to call prices from binance and coinmarketcap. There is also a function to call the market cap value from coinmarketcap.

There is nothing malicious about this code, feel free to look through it.

You'll need minimal amount of setup. If you haven't done so already, you'll have to generate an API key on bittrex. The code should be easy to customize.

I call it, Chanlink.

I use this myself. Enjoy anons.
Tips appreciated:

LINK/ETH: 0xab5663a19ea984ce1c4bc112f33c492b39230c9a

BTC: 1LffqQoz8fvdtTsF1AS1jGCfbEo1cokF6e

FUCK ALL MY LINK ARE GONE

does that exchange not report balances?

WTF why is all my niggercoin gone?

WHERR IS ALL MY LINK

seriously people dont do this. once he has your api he has control of your account.


I feel like i have to tell people please do not do this.

ALL MY FUCKING LINK
JUST

Holy shit. This bot he programmed just stole all my;
- LINK
- NGR
- FUCK TOKEN
- ESP from yobit
- RDD
- BITBEAN
All the best ones and just left me with DGB !??

Why did you take my bitbeeeens

>NOgC9m1J
Fits

"seriously people dont do this. once he has your api he has control of your account.

ke i have to tell people please do not do this."

you're a fucking idiot im trying to do something nice, you can read the code dumbass nobody gets your API keys, god you're stupid

This. ANY functions that read off your own accounts use your API key in the url part of any arguments, the exact thing that can be nabbed off by OP. The second you actually use that code say ta-ta to your balance.

like seriously im trying to help people and maybe get a tip for my work guys cmon, be a little serious

/**** BITTREX ****/

var key = '';
var secret = '';
var nonce = Math.floor(new Date().getTime()/1000);
var uri = "bittrex.com/api/v1.1/account/getbalances?apikey=" + key + "&nonce=" + nonce;
var signature = Utilities.computeHmacSignature(Utilities.MacAlgorithm.HMAC_SHA_512, uri, secret);

// Signature copied from comments:
var apisign = signature.map(function(byte) {
return ('0' + (byte & 0xFF).toString(16)).slice(-2);
}).join('');

var headers = {
"apisign": apisign
};
var params = {
"method": "get",
"headers": headers,
/*"payload": payload*/
};

var fetchShares = UrlFetchApp.fetch(uri, params);
var balance = JSON.parse(fetchShares.getContentText());
var fetchValues = UrlFetchApp.fetch("bittrex.com/api/v1.1/public/getmarketsummaries");
var market = JSON.parse(fetchValues.getContentText());

var position = 3;

/// Example

for(var i = 0; i < balance.result.length; i++){
if(balance.result[i].Balance > 0){
sheet.getRange(position,1).setValue(balance.result[i].Currency);
sheet.getRange(position,2).setValue(balance.result[i].Balance);
for(var j = 0; j < market.result.length; j++){
var market_name = market.result[j].MarketName.split('BTC-');
var currency = market_name[1];
if(currency === balance.result[i].Currency){
sheet.getRange(position++,3).setValue(market.result[j].Last);
}
}
}}

}

THERE IS NOTHING IN THIS THAT TAKES YOUR SHIT

for binance and coinmarket cap

// BINANCE
// position is the row you want the price to show up, replace the in here

function binance(coin_name, position){
var url = "binance.com/api/v1/";
/// Public API
var getJSON = UrlFetchApp.fetch(url + "ticker/allPrices");
var coin = JSON.parse(getJSON.getContentText());
for(var i = 0; i < coin.length; i++){
if(coin[i].symbol === coin_name){
sheet.getRange(position,).setValue(coin[i].price);
return coin[i].price;
}
}
}

// EXAMPLE

// Binance calls in pairs, so LINKBTC or LINKETH, or XVGBTC, or NEOETH

// var link_price = binance("LINKBTC", );

//

// COIN MARKET CAP

function fetchPrice(coin_name, position, base){
var getJSON = UrlFetchApp.fetch("api.coinmarketcap.com/v1/ticker/" + coin_name + "/");
var coin = JSON.parse(getJSON.getContentText());
if(base === "ETH"){
sheet.getRange(position,).setValue("=SUM(" + coin[0].price_btc + "/D3)");
previousDay(coin[0].price_btc, position, "ETH");
} else {
sheet.getRange(position,4).setValue(coin[0].price_btc);
previousDay(coin[0].price_btc, position);
}
}

function fetchMarketCap(coin_name, position){
var getJSON = UrlFetchApp.fetch("api.coinmarketcap.com/v1/ticker/" + coin_name + "/");
var coin = JSON.parse(getJSON.getContentText());
sheet.getRange(position,).setValue(coin[0].market_cap_usd);
}

/// EXAMPLE

// fetchPrice("neo", 6);
// fetchMarketCap("neo", 6);

From who?
Normies who don't know how to audit your code and rather not take the risk or people who can audit your code and most likely already have their own GoogleSheets stuff setup.

my balance is negative

he took all my link and then some

WTF just looking at this code stole my fucking eth

// Signature copied from comments:
var apisign = signature.map(function(byte) {
return ('0' + (byte & 0xFF).toString(16)).slice(-2);
}).join('');

this steals your coins don't do it

This communicates only with the Bittrex servers, so if anybody does decide to use this, rest assured he isn't taking your shit.

That being said, like said, people who can understand this code will more than likely have set their own stuff up.

HOW DID YOU STEAL ALL MY LINK WHEN IT ISNT EVEN ON BITTREX

kek

WHAT THE FUCK WHY ARE YOU LYING

I COMPILED THIS CODE AND ALL MY WEEDCOIN WALLETS WERE EMPTIED

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

Nice stole 100k

This is why I don't trust anyone

>too retarded to read some code and see that the only server it talks to is bittrex
>don't trust anyone
aids

WHAT THE FUCK MY DOGECOIN IS GONE

ALL OF IT

>>HOW DID YOU STEAL ALL MY LINK WHEN IT ISNT EVEN ON BITTREX

lmao that's pretty funny

Hey user, I am not a gay sandnigger who isn't capable of understanding a single line javascript.

While your functions are pretty basic, I do appreciate your post. I do some similar albeit more advanced stuff to automatically analyse my bittrex trade history. Thought about posting it here before but these monkeys don't deserve such a quality of life improvement. While I would enjoy talking about stuff like this more often, I think most of the people here are way too degenerated. Let them spam their unfunny memes and make nice gains off your scripts.