// Only for access to files in which the add-on or script is used, rather than all of a user's spreadsheets /** * @OnlyCurrentDoc */ /*====================================================================================================================================* CryptoTools Google Sheet Feed by Eloise1988 ==================================================================================================================================== Version: 1.0.4 Project Page: https://github.com/Eloise1988/DEFIASSETS/ Copyright: (c) 2021 by Eloise1988 License: MIT License ------------------------------------------------------------------------------------------------------------------------------------ A library for importing the list of all assets (tokens, pools, nft, claimable etc...) from smart chains: DEFI_NETWORTH ScriptRunTime Function that gets DEFI NETWORTH based on list of addresses PROTOCOLS For use by end users to retrieve the list of protocols available on zapper.fi CRYPTODEFI For use by end users to retrieve the list of assets by defi protocol CRYPTODEFI_BALANCE For use by end users to retrieve the balance by symbol/ticker given a defi protocol CRYPTODEFI_BALANCEUSD For use by end users to retrieve the USD amont lended by symbol/ticker given a defi protocol For bug reports see https://github.com/Eloise1988/DEFIASSETS/issues ------------------------------------------------------------------------------------------------------------------------------------ Changelog: 1.0.0 Creation DEFI_NETWORTH ScriptRunTime Function that gets DEFI NETWORTH based on list of addresses 1.0.1 PROTOCOLS returns the list of protocols available on the Zapper api 1.0.2 CRYPTODEFI returns the list assets by defi protocol 1.0.3 CRYPTODEFI_BALANCE returns the balance by symbol/ticker given a defi protocol into Google spreadsheets. 1.0.4 CRYPTODEFI_BALANCEUSD returns the USD amont lended by symbol/ticker given a defi protocol into Google spreadsheets. *====================================================================================================================================*/ //CRYPTOTOOLS PRIVATE KEY //For faster & greater access, please provide your private Key in the brackets const cryptotools_api_key=""; //CACHING TIME //Expiration time for caching values, by default caching data last 10min=600sec. This value is a const and can be changed to your needs. const expirationInSeconds_=600; /**DEFI_NETWORTH * ScriptRunTime Function that gets DEFI NETWORTH based on list of addresses **/ function DEFI_NETWORTH() { //Name of the tab where you want to have your data var name_sheet="DEFI_NETWORTH"; var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(name_sheet); // Table start row and columns var start_row=25; var start_column=2; //Clearing old data sheet.getRange(start_row,start_column,3000,8).clearContent() //Loading List of DEFI addresses in cells C3:E3 address_defi=sheet.getRange(3,3,1,3).getValues(); var dict_address = []; for (var i=0;i