TokenSupply App
The TokenSupply App is a simple and efficient solution for calculating the total, circulating, and non-circulating supply of a token across multiple blockchain networks. It provides a set of RESTful API endpoints for querying the token supply data and offers easy integration with other applications or services.
- Features
- Getting Started
- API Endpoints
- Usage Examples
- Integration
- Troubleshooting and FAQ
- Contributing
- License
- Supports multiple blockchain networks
- Calculates total, circulating, and non-circulating token supply
- Provides RESTful API endpoints
- Easy to integrate with other applications or services
- Highly configurable
- Clone the repository:
git clone https://github.com/ferrumnet/tokenSupply.git
- Change to the project directory:
cd TokenSupply
- Install the dependencies:
npm install
- Start the server:
npm start
The server will start, and you'll see a message indicating the port it is listening on (default is 8080).
To configure the TokenSupply app, update the config.ts
file with the appropriate network configurations, token contract addresses, and non-circulating supply addresses.
Example configuration:
export const getNetworkConfigurations = async () => {
return [
{
networkName: 'Ethereum',
rpcUrl: 'https://mainnet.infura.io/v3/YOUR_API_KEY',
tokenContractAddress: '0x1234567890abcdef',
},
// Add more networks here...
];
};
export const nonCirculatingSupplyAddressesConfig = [
{
name: "Deployer",
address: "0xc2fdcb728170192c72ada2c08957f2e9390076b7",
tokenContractAddress: "0xe5caef4af8780e59df925470b050fb23c43ca68c",
jsonRpcUrl: "https://nd-770-685-838.p2pify.com/e30d3ea257d1588823179ce4d5811a61",
chainId: "1"
},
// Add more addresses here...
];
The TokenSupply app provides the following API endpoints:
/totalSupplyAcrossNetworks
: Fetches the total supply of the token across all networks./totalSupply
: Fetches the total token supply./nonCirculatingSupplyAddresses
: Lists the non-circulating supply addresses./nonCirculatingSupplyBalancesByAddress
: Fetches the non-circulating supply balances for each address./nonCirculatingSupplyBalance
: Fetches the total non-circulating supply balance./circulatingSupplyBalance
: Fetches the total circulating supply balance.
For more information on these endpoints, visit the API Endpoints page in the GitBook documentation.
Here are some example requests using curl
:
# Fetch the total supply across all networks
curl http://localhost:8080/totalSupplyAcrossNetworks
# Fetch the total token supply
curl http://localhost:8080/totalSupply
# List non-circulating supply addresses
curl http://localhost:8080/nonCirculatingSupplyAddresses
# Fetch non-circulating supply balances by address
curl http://localhost:8080/nonCirculatingSupplyBalancesByAddress
# Fetch the total non-circulating supply balance
curl http://localhost:8080/nonCirculatingSupplyBalance
# Fetch the total circulating supply balance
curl http://localhost:8080/circulatingSupplyBalance
To integrate the TokenSupply app with your existing applications or services, simply call the desired API endpoints from your code, as demonstrated in the Usage Examples section of the GitBook documentation.
For common issues, troubleshooting tips, and frequently asked questions, please refer to the Troubleshooting and FAQ page in the GitBook documentation.
Contributions are always welcome! If you'd like to contribute, please follow the standard GitHub flow:
- Fork the repository.
- Create a branch for your changes.
- Make your changes and commit them to your branch.
- Create a pull request to merge your changes into the main repository
- Wait for the project maintainers to review and approve your changes.
Before submitting a pull request, please ensure your code follows the project's coding style, is well-documented, and passes all tests. Additionally, update the documentation and tests as needed to reflect your changes.
The TokenSupply app is released under the MIT License. By using or contributing to this project, you agree to the terms of this license.
If you encounter any issues or have questions about the TokenSupply app, feel free to open an issue on GitHub
With the TokenSupply app, you can quickly and easily access token supply data across multiple blockchain networks. Get started today and enjoy the benefits of this powerful tool in your projects.