emmtte / list Goto Github PK
View Code? Open in Web Editor NEWGoogle Sheets automatic creation with Google Apps Script (GAS) for managing a cryptocurrency tracking spreadsheet with multi exchanges
Google Sheets automatic creation with Google Apps Script (GAS) for managing a cryptocurrency tracking spreadsheet with multi exchanges
Hi,
I'm really keen to use this, but can't follow the instructions. Are some of the .js files missing?
The instruction in step 3 "click on the link and search for sheet and enable Google Sheets API" doesn't make sense to me and then in step 4 I'm not clear how to link the new sheet to the scripts that have been created.
Is there an example sheet you can share that I can then make my own copy of?
Thanks!
ReferenceError: "BinanceSignature" is not defined. (line 266, file "balance")Dismiss
function BinanceBalance () {
...
var signature = BinanceSignature (secret, postdata);
Google Sheets no longer has Tools / Script editor function
Is this supposed to be managed through the Apps Script feature? Can you please check / update the readme? Thanks!
I followed the installation instructions. However, when clicking Update Portfolio I get the following error:
Exception: Request failed for https://api.coinmarketcap.com returned code 503. Truncated server response: <me... (use muteHttpExceptions option to examine full response)
Exception: Request failed for https://api.kucoin.com returned code 401. Truncated server response: {"code":"400004","msg":"Invalid KC-API-PASSPHRASE"} (use muteHttpExceptions option to examine full response)
I've put the key and secret in the config.
I think it's asking for API passphrase or something.
Dear Mr. Emmanuel
Please help me for indodax.com
Thanks
Best Regards
Reza
Everytime i try to update protfolio, this error comes. Until now i´m not getting any values.
Exception: Error in request for https://fapi.binance.com. The following code was returned: 401. Abbreviated server response: {"code":-2015, "msg": "Invalid API-key, IP, or permissions for action, request ip: 35.187.139.65"}. Use muteHttpExceptions to read the full response.
I would really appreciate a fast help :)
Hi,
How to get the deposit Address of that specific Coin on the Market Sheet ?
Thanks
Mouad
var entries = [{ name : "Update Portfolio", functionName : "balance" }];
Where is this function balance() in js Files? Maybe there should be another function in Menu?
I tried the FIAT module, but when I add it and I refresh the cryptocurrency, the FIAT currency disappears.
I want to create the jsSHA.js file but the content from https://github.com/Caligatio/jsSHA/blob/master/src/sha.js brings me to a 404 page.
Thank you
Thanks for looking at this one, I gave it a go and got the following error:
Request failed for http://www.bitstamp.net/api/v2/balance/?key=CORRECT API KEY WAS HERE &signature=LONG STRING SIGNATURE WAS HERE&nonce=1516333128 returned code 400. Truncated server response: POST Only Endpoint (use muteHttpExceptions option to examine full response)
Happy to help test this and here's my (probably terrible) string manipulation code ready to go to pull the results into an array:
function Bitstamp() {
//insert api code here
var data = JSON.parse(response.getContentText());
var json1 = JSON.stringify(data);
parseStampPrices(json1);
}
function parseStampPrices(textString ){
var stringLength = textString.length;
if(stringLength > 80){
var balanceLocation = nthIndex(textString, "balance", 1);
var feeLocation = nthIndex(textString, "fee", 1);
var coinCode = textString.substring(balanceLocation-4, balanceLocation-1);
textString = textString.substring(balanceLocation, textString.length);
var first = nthIndex(textString, "\"", 2);
var second = nthIndex(textString, "\"", 3);
var value = textString.substring(first+1, second);
value =+ value;
if(value == 0){
textString = textString.substring(feeLocation, textString.length);
parseStampPrices(textString);
}
else{
coinCode = coinCode.toUpperCase();
if(coinCode == "USD"){
coinCode = "USDT";
}
textString = textString.substring(feeLocation, textString.length);
myArray.push({'currency': coinCode, 'balance': value, 'market': "Bitstamp"});
parseStampPrices(textString);
}
}
}
// This method is used as part of parsing the Bitstamp info
function nthIndex(str, pat, n){
var L= str.length, i= -1;
while(n-- && i++<L){
i= str.indexOf(pat, i);
if (i < 0) break;
}
return i;
}
You seem to have a very nice screeshot of your Portfolio with color rules and adapted font.
Is there any chance to have a template file ? Like a Google Sheet Template for example. I think coding this in Script Editor is not easy.
I'm looking for a simple way to look into my Binance portfolio, this project looks good, but I can't get it to work, nothing happens after I create all scripts and entered API, not sure if I doing this wrong.
I did all the step in the instruction, in the script editor, it asks me to name every script, and it auto adds .gs at the end of every files' name, like this:
not sure if this cause this sheet not working, now all the numbers still are zero, please help, thanks.
USD balance coming from Bitfinex/Kraken appear as unrecognized coin, a quick fix is by adding
if (symbol == "USD") {symbol="USDT"}
to main.js ~line#20 or to the API js, but we should have some rule for USD for price_usd = 1 etc
can you check this is error
thank you.
Hey,
The Coinmarketcap API requires a key and the endpoints have changed :-)
It's now reachable over https://pro-api.coinmarketcap.com/v1/** and it is possible to get a free API Key here https://pro.coinmarketcap.com
however I dont know how to fix the .js files
Thanks!
Hi, I am facing an error with binance API...
https://www.binance.com/api/v3/account?timestamp=1532171161829&signature=6265db308e4fd6f9df6a23797186f27d3865972ff5703bc2caec1d8992708717
returns error 400 with
{"code":-1022,"msg":"Signature for this request is not valid."}
Any ideas? Thanks for help.
Hi, thanks for your code. I am however having problems getting my balance data from Binance. When running the code I get a 403 error code (see full response below, I modified the signature for security reasons)
Any thoughts? Thanks!
Request failed for https://www.binance.com/api/v3/account?timestamp=1516737311860&signature=xxxxxxxxxxxxxxx returned code 403. Truncated server response:
<title>403 Forbidden</title>Hi, I am trying to get the data from Binance with google sheets, but I'm getting this error.
ReferenceError: js SHA is not defined
and the error comes from the binance_api file
can you pls correct this error
Could you add it if possible?
For example you have stop loss order the amount will be moved from the balances ...do not where and from where this data could be taken...
Added two coins that were missing from the the Bitfinex API, similar issue to the previous one with Bitfinex using their own naming conventions - posting here as you might want to update the master :)
`// API_Bitfinex.js V1.0
// I assume that key and secret API are in the "Config" spreadsheet. The key is in cell B26 and the secret in cell B27
function Bitfinex () {
function bytesToHex(data) {
return data.map(function(e) {
var v = (e < 0 ? e + 256 : e).toString(16);
return v.length == 1 ? "0" + v : v;
}).join("");
}
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Config");
const apiKey = sheet.getRange("B26").getValue();
const apiSecret = sheet.getRange("B27").getValue();
const apiPath = "v2/auth/r/wallets";
const nonce = Date.now().toString();
const body = { "type": "price" };
const rawBody = JSON.stringify(body);
var signature = "/api/" + apiPath + nonce + rawBody;
signature = Utilities.computeHmacSignature(Utilities.MacAlgorithm.HMAC_SHA_384, signature, apiSecret);
signature = bytesToHex(signature);
const url = "https://api.bitfinex.com/" + apiPath;
const options = {
method: 'POST',
contentType: "application/json",
headers: {
'bfx-nonce': nonce,
'bfx-apikey': apiKey,
'bfx-signature': signature
},
payload: rawBody
};
var response = UrlFetchApp.fetch(url, options);
var data = JSON.parse(response.getContentText());
var array = [];
for(var x in data){ balance=parseFloat(data[x][2]);
if (balance > 0) {
asset=data[x][1]
if (asset=="IOT") {asset="MIOTA"}
if (asset=="QSH") {asset="QASH"}
if (asset=="DAT") {asset="DATA"}
if (asset=="SPK") {asset="SPANK"}
if (asset=="MNA") {asset="MANA"}
array.push({'currency': asset, 'balance': balance, 'market': "Bitfinex"})}
}
return array;
}`
Hey, what about BitMEX? We really need BitMEX too!!, thx ;)
The end of code:
...
//Logger.log(data);
var array = []; //added
for(var x in data.data){
var balance = parseFloat(data.data[x].balance);
if (balance > 0) {
var asset = data.data[x].coinType
array.push({'currency': asset, 'balance': balance, 'market': "Kucoin"});
//Logger.log(array);
}
}
return array //moved out of 'for()'
}
I humbly request one for HitBTC as well :^)
I already setup the files like this:
After this, I press Cryptos Tool/Update Porfolio and receive the following message:
Exception: The number of rows in the range must be at least 1.
I have not purchased any coins from Kraken. Is that why I am getting the error? If yes, can't I use this tool if I haven't bought coins just to do simulations?
Thanks for sharing guys :)
One of my holdings at Bitfinex, Streamer Data Coin (DATA), shows up in the overview as Datum (DAT) - would I need to edit the main.js script to put in an exception to rectify this? Novice coder here so unsure how to proceed.
Best regards,
D
This message appears after clicking Cryptos Tools > Update Portfolio
Hello,
Can I also use this with the API of https://api.bitvavo.com/v2/ ?
And if so what is the way to do that?
Regards,
Hello,
When trying to run the function onOpen I get the error: TypeError: Cannot call method "addMenu" of null. (line 6, file "Code"). I have a spreadsheet opened with two tabs, one being Market and the other Config. Config has my API keys in B14 and 15.
Thanks.
This is a feature request to add Telegram functionality to send a update of your portfolio to your own Telegram bot or channel.
Like a list of coins that you want to be reminded on a regular basis.
Is there any way we can get a feature to track profit/loss on each coin?
Let's say I made 4 purchases in 1 coin. I would like to check whether my coin is in profit or loss
First of all, thank you for sharing this with us.
I'm getting an error on line 12 (Illegal character. (line 12,) when copy pasting the jsSHA.sh in the google scripts file. Is there something special that I have to enable in order to make it work?
Cheers
Your other code is looking good but the kucoin code is blank.
Thanks!
I'm connected to the Binance API and the sheet updates, as expected. However, not all currencies in my account are pulling all data from Binance. For example, I have FUEL and WAN in my portfolio, and the script pulls the coin symbol name (FUEL, WAN), but no other data for that coin, including my balance, the full coin name, or trading rates. Here's a screenshot of those two rows in my sheet.
Hi,
Not sure if you're updating this but Kucoin has upgraded their API and the old code doesn't work.
Seems to want a 44 character signature, not 64.
Error Message:
Exception: Request failed for https://api.bitfinex.com returned code 500. Truncated server response: ["error",10100,"apikey: invalid"] (use muteHttpExceptions option to examine full response)
Same keys is running on nodejs. No problem with keys.
Hi, I get "{Error=Signature does not match request parameters., Success=false}" in the logs when I try to run the cryptopia() method.
Could it be because there is a + and an = in my secret like this:
j4Ni6YNpzp9TmcKu3dhy32HkKw7SR6lRT+BXq6D4lZiU=
These are quite common in Cryptopia sectets.
Here's the whole log:
[18-01-09 14:54:31:913 PST] mZFLkyvTelC5g8XnyQrpOw== mZFLkyvTelC5g8XnyQrpOw==
[18-01-09 14:54:31:914 PST] https%3a%2f%2fwww.cryptopia.co.nz%2fapi%2fgetbalance
[18-01-09 14:54:31:914 PST] signature b08ce14d2e9c4956ad4a2bee3ba8f4bcPOSThttps%3a%2f%2fwww.cryptopia.co.nz%2fapi%2fgetbalance1515538471mZFLkyvTelC5g8XnyQrpOw==
[18-01-09 14:54:31:995 PST] signed: qMf1ONALXtokfN50jPMHqzBv084fH+RjL+AcDzh4VtI=
[18-01-09 14:54:31:996 PST] header_value: amx b08ce14d2e9c4956ad4a2bee3ba8f4bc:qMf1ONALXtokfN50jPMHqzBv084fH+RjL+AcDzh4VtI=:1515538471
[18-01-09 14:54:32:092 PST] {Error=Signature does not match request parameters., Success=false}
[18-01-09 14:54:32:093 PST] []
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.