Skip to content

Fun script to use with Google Sheet to query funny and interesting things on Alephium crypto project

License

Notifications You must be signed in to change notification settings

MrGoldenpioche/Alephium-GoogleAppScripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alephium-GoogleAppScripts

Fun script to use with Google Sheet to query funny and interesting things on Alephium crypto project. This repository contains basic Google AppScripts that can be used in your GoogleSheet. All these scripts are related to Alephium project. Below you can find basic explaination about how to use these scripts

Constant variables

To use these functions, some variables are set.

  • BASE_URL : fixed to "https://mainnet-backend.alephium.org/addresses/"
  • ALPH_UNIT : fixed to 10^18
  • UNIT_BASE : fixed to 10 (base 10)
  • TOKEN_HARDCAP : fixed to 1000000000 (one billion)
  • TOKEN_SOFTCAP : fixed to 140000000 (140 million or 14% of hardcap)
  • wallet_address : add your Alephium's wallet address here

If you don't want details, jump to How to use this ?

Available functions

ALPH_makeHttpRequest()

This core function make HTTP Get request to mainet backend of Alephium against a specific address to retrieve all information about this wallet address

ALPH_getTotalAlph()

This function first call ALPH_makeHttpRequest() and return the total number of ALPH tokens for the specified wallet.

ALPH_getTotalTransaction()

This function first call ALPH_makeHttpRequest() and return the total number of transaction for the specified wallet.

ALPH_getCurrentTokenPrice()

This function will get current token price on CMC (CoinMarketCap.com). You have to specify you CMC API key first in the code.

Note : value of 0.168 is hardcoded and returned while Alephium token price is not available on CMC. Once the price will be available on CMC, this script automatically returns the CMC's price.

ALPH_getTotalCirculatingSupply()

Return the number of ALPH already circulating.

ALPH_getTotalSupplySoftCap()

Return the current softcap. Even if this value is hardcoded into TOKEN_SOFTCAP, it could change in the futur.

ALPH_getTotalCirculatingSupplySoftCapPercentage()

Return the percentage of circulating ALPH based on the current SOFT CAP.

ALPH_getTotalCirculatingSupplyHardCapPercentage()

Return the percentage of circulating ALPH based on the current HARD CAP.

How to use ?

Go to https://script.google.com/ and create a new project named Alephium. This will automatically create a file named code.gs. Open it and past the content of this file. Once done, you can simply save your project and run the code to be sure that all data are retrieved correctly If all is working as expected, you can call these functions into GoogleSheet :-)

Step 1 - Open AppScript from GoogleSheet

Step 2 - Create new project

Step 3 - Past code and test it

Don't forget to update the variable wallet_address and then run the desired function.

Step 4 - Save project and call functions into GoogleSheet

Look examples above.

References

About

Fun script to use with Google Sheet to query funny and interesting things on Alephium crypto project

Resources

License

Stars

Watchers

Forks

Packages

No packages published