A Google Apps Script for accessing balances and prices from the DeFiChain (DFI) using it's official APIs
Explore the docs »
Report Bug
·
Request Feature
- About DeFiChain for Google Sheets
- Installation
- Usage
- General Blockchain Information
- Address Balance
- Price
- Minted blocks
- Roadmap
- Contributing
- License
- Contact
This adds the ability to insert and update balances and other data from the DeFiChain Blockchain into Google Sheets by requesting data from the official DeFiChain APIs.
You have to create a custom script in your Google Sheets document
- In your Sheet document go to "Tools" -> "Script Editor"
- Choose "Create New Project"
- Name it to whatever you want "DeFiChain" may be appropriate, so you can find it in the future. This name is completely up to you
- Copy the content of the file "DeFiChain.gs" from this repository into the Code.gs document
- Save
- Return back to your Google Sheet document
DeFiChain for Google Sheets provides additional functions you can call in cells.
Gives you some common information about the blockhain's status
=DEFICHAIN_INFO("information_key")
possible information_keys:
- block_height
- difficulty
- median_time
- max_supply
- current_total_supply
- current_circulating_supply
- current_foundation_supply
- current_community_supply
Gives you the current balance of a particular DeFiChain Address.
=DEFICHAIN_ADDRESS_BALANCE("DeFiChainAddressYouWantToKnow")
Gives you the current price for one DFI in that particular coin. That price is read from the DeFiChain Decentralized Exchange (DEX).
=DEFICHAIN_PRICE("COIN_SYMBOL")
possible COIN_SYMBOLs:
- USDT
- BTC
- ETH
- BCH
- LTC
- DOGE
Gives you the current count of minted blocks of that particular staking collateral.
=DEFICHAIN_MINTED_BLOCKS("DeFiChainStakingCollateralAddress")
You can interactively request an update of the data by adding the name of a cell which can be changed to every function as a second parameter. Best practice is to insert a checkbox into that particular cell by selecting a cell and then clicking "Insert" --> "Checkbox" from the main menu. Now you can use that cell as a update reference. Let's assume you inserted that checkbox to Cell A1:
=DEFICHAIN_INFO("block_height", $A$1)
Now, the cell will update when you check or un-check the box.
You may have to use a semi-colon (;) instead of comma (,) depending on your language setting in your Google Sheets document. If you get an error, please try using ; instead of ,
Feel free to ask for implementation or do it by yourself (and make a pull request to let others participate :) ).
There may be updates in the future depending on your requests and my personal needs.
See the open issues for a list of proposed features (and known issues).
First Version. Ability to ask for balances and general blockhain information.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Michael Fuchs - derfuchs - michael@derfuchs.net
Project Link: https://github.com/DerFuchs/DeFiChain-for-Google-Sheets