In today’s article, we’ll explore the benefits of Chiliz to explain why you might want to build on this network. In addition to this, we’ll introduce Moralis, the industry’s leading Web3 data provider. With our Chiliz-compatible APIs, you can now seamlessly fetch and integrate on-chain data into your dapps. If you’re eager to learn how this works, here’s an example showing you how to get a wallet’s full history with just one API call:
import fetch from 'node-fetch'; const options = { method: 'GET', headers: { accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY' }, }; fetch('https://deep-index.moralis.io/api/v2.2/wallets/0xf977814e90da44bfa03b6295a0616a897441acec/history?chain=0x15b38', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
In return for calling the script above, you’ll get the wallet’s full history, enriched with human-readable transaction summaries, category tags, and much more. Here’s a sample response:
{ //... "result": [ { "hash": "0x0ea1e72d074cc7835d7f76014102bdd230257657d1cc9e57ad1701ce37d37c58", "nonce": "73645", "transaction_index": "0", "from_address_entity": null, "from_address_entity_logo": null, "from_address": "0x87917d879ba83ce3ada6e02d49a10c1ec1988062", "from_address_label": null, "to_address_entity": null, "to_address_entity_logo": null, "to_address": "0xa6610b3361c4c0d206aa3364cd985016c2d89386", "to_address_label": null, "value": "0", "gas": "47867", "gas_price": "5000000000000", "receipt_cumulative_gas_used": "47615", "receipt_gas_used": "47615", "receipt_contract_address": null, "receipt_status": "1", "block_timestamp": "2024-09-09T07:01:17.000Z", "block_number": "16386933", "block_hash": "0xb7d25de19e5eb2ddefec0bfce6d637dd49a8ab18a564e77f7434e0c691e2ab27", "transaction_fee": "0.238075", "method_label": "transfer", "nft_transfers": [], "erc20_transfers": [ { "token_name": "AS Roma", "token_symbol": "ASR", "token_logo": null, "token_decimals": "0", "from_address_entity": null, "from_address_entity_logo": null, "from_address": "0x87917d879ba83ce3ada6e02d49a10c1ec1988062", "from_address_label": null, "to_address_entity": null, "to_address_entity_logo": null, "to_address": "0xf977814e90da44bfa03b6295a0616a897441acec", "to_address_label": null, "address": "0xa6610b3361c4c0d206aa3364cd985016c2d89386", "log_index": 0, "value": "77303", "possible_spam": false, "verified_contract": true, "security_score": null, "direction": "receive", "value_formatted": "77303" } ], "native_transfers": [], "summary": "Received 77,303 ASR from 0x87...8062", "possible_spam": false, "category": "token receive" }, //... } }
That’s it; fetching on-chain data from Chiliz doesn’t have to be more challenging than this when using Moralis. To learn more about how this works, join us in this guide as we lay it all out for you.
Also, if you’d like to use our Chiliz-compatible Web3 APIs yourself, then take this opportunity to sign up for free with Moralis!
Overview
Ethereum is currently the biggest blockchain for decentralized application (dapp) development. However, since the inception of Ethereum, we have seen multiple layer-1 and layer-2 blockchain networks emerge, each tailored for specific use cases. One such example is Chiliz – a leading chain for major entertainment and sports brands. But what exactly is Chiliz? How does it work? And why should you build on Chiliz Chain? If you’re looking for the answers to these questions, join us in this article. Let’s go!
What is Chiliz Chain? And Why Build on Chiliz?
The most recent iteration of Chiliz launched back in 2023, and it’s an EVM-compatible layer-1 (L1) blockchain network focusing on the sports and entertainment industry!
The vision behind Chiliz Chain is to establish a strong foundation for a leading Web3 sports and entertainment ecosystem, with fan experiences and B2C/B2B tools at its core. In doing so, Chiliz aims to become the industry-leading platform for major entertainment brands and enterprise-level sports.
Chiliz uses a proof-of-staked authority (PoSA) consensus mechanism and operates with eleven validators. This PoSA consensus allows Chiliz to deliver shorter block finality and low fees.
Moreover, Chiliz Chain has a native token called CHZ ($CHZ), which functions similarly to how ETH operates on Ethereum. As such, the CHZ token can be used to pay for gas, participate in staking practices, and much more.
Now, with an overview of Chiliz, let’s dive into a few reasons why you should build on this chain!
Why Build on Chiliz?
There are many reasons why you should build on Chiliz. Here are five prominent examples:
- Seamless Developer Experience: Chiliz Chain is EVM-compatible, meaning you can leverage tools you’re familiar with to build on the network. This also means you can seamlessly migrate existing projects from Ethereum to Chiliz with minor configurations.
- Fast Transaction Processing: The PoSA consensus mechanism combines the best of proof-of-authority (PoA) and proof-of-stake (PoS) to facilitate faster block times and transaction processing.
- Low Fees: Chiliz Chain features low transaction fees, making it a beneficial platform for both developers and end-users alike.
- Passionate Fanbase: Reach millions of fans across more than 70 leading entertainment and sports brands, ready to use your dapps.
- Thriving Developer Community: Collaborate with other developers in an engaging environment supported by development grants and ongoing gas fee repurposing.
The Chiliz Ecosystem
So, what does the current Chiliz ecosystem look like in terms of numbers?
- 2+ million ecosystem users.
- A market cap exceeding $1 billion.
- 82+ fan tokens.
- 150+ global sports partners, including Manchester City, FC Barcelona, and many others.
Exploring Socios
Socios is a well-known service that provides sports organizations with innovative ways to build relationships with supporters via fan tokens. Fan tokens are digital assets giving users access to experiences, the right to vote in polls, and become part of a large, global community of like-minded fans!
Socios is built on Chiliz Chain, and the platform leverages the network’s native token as its official currency. Furthermore, Socios delivers multiple features, including a marketplace to swap tokens and Token Hunt – a popular AR experience where users can collect free tokens hidden in their city.
Socios is actively partnering with over 170 established sports organizations, including soccer teams, Formula One teams, and giants from the MLS, NBA, and NFL.
In essence, Socios is a fan engagement platform that gives sports organizations a venue to build and maintain relationships with their fans and supporters!
Now that we have familiarized ourselves with the ecosystem, you’ll likely also want to create Chiliz Chain dapps yourself. If this is the case, join us in the next section as we introduce Moralis – the industry’s leading Web3 data provider!
Introducing Moralis – The Ultimate Chiliz API Provider
The easiest way to build dapps on Chiliz Chain is to leverage Moralis – the industry’s leading Web3 data provider. In our suite of premier APIs, you’ll find Chiliz-compatible interfaces like the Token API, Streams API, Wallet API, NFT API, Price API, and many others. As such, when leveraging Moralis, you get all crypto data in one single place!
Why Build on Chiliz with Moralis?
Moralis’ Web3 APIs are industry-leading for a number of reasons. Here are three key benefits highlighting why you should build on Chiliz with Moralis:
- Comprehensive: Moralis’ Web3 APIs provide the industry’s most comprehensive responses, giving you more data with fewer calls. Get any wallet’s transaction history, token prices, up-to-date NFT metadata, and much more with single lines of code.
- Reliability & Security: We ensure high reliability and enterprise-grade security, backed by our SOC 2 Type 2 certification.
- Cross-Chain: With full cross-chain compatibility, you can build dapps across all major chains, including Chiliz, Ethereum, Optimism, Polygon, Base, and many more.
Now, to further highlight the benefits of Moralis and explain why you should use our tools to build on Chiliz, let’s dive deeper into our Web3 APIs!
Exploring Moralis’ Web3 APIs
Our Chiliz-compatible Web3 API suite comprises several use case-specific APIs. In the following sections, we’ll look at three of them:
- Wallet API
- Token API
- Blockchain API
Let’s kick things off with the Wallet API!
Wallet API
Moralis’ Wallet API is the industry’s #1 solution for anyone looking to build wallets or integrate wallet functionality into dapps. The Wallet API supports 500+ million addresses across all major chains, including Chiliz, Ethereum, Optimism, Base, and many more.
With the Wallet API, you only need single lines of code to effortlessly fetch a wallet’s full transaction history, token balances, NFT balances, and much more. As such, when leveraging Moralis, you can integrate wallet data into your Chiliz projects without breaking a sweat.
To highlight the accessibility of the Wallet API, here’s a sample script showing you how easy it is to fetch the full transaction history of a wallet:
import fetch from 'node-fetch'; const options = { method: 'GET', headers: { accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY' }, }; fetch('https://deep-index.moralis.io/api/v2.2/wallets/0xf977814e90da44bfa03b6295a0616a897441acec/history?chain=0x15b38', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
In return for calling the endpoint above, you’ll get the full transaction history of the specified wallet. What’s more, the response is enriched with human-readable summaries, categories, and much more for each transaction. Here’s a sample response:
{ //... "result": [ { "hash": "0x0ea1e72d074cc7835d7f76014102bdd230257657d1cc9e57ad1701ce37d37c58", "nonce": "73645", "transaction_index": "0", "from_address_entity": null, "from_address_entity_logo": null, "from_address": "0x87917d879ba83ce3ada6e02d49a10c1ec1988062", "from_address_label": null, "to_address_entity": null, "to_address_entity_logo": null, "to_address": "0xa6610b3361c4c0d206aa3364cd985016c2d89386", "to_address_label": null, "value": "0", "gas": "47867", "gas_price": "5000000000000", "receipt_cumulative_gas_used": "47615", "receipt_gas_used": "47615", "receipt_contract_address": null, "receipt_status": "1", "block_timestamp": "2024-09-09T07:01:17.000Z", "block_number": "16386933", "block_hash": "0xb7d25de19e5eb2ddefec0bfce6d637dd49a8ab18a564e77f7434e0c691e2ab27", "transaction_fee": "0.238075", "method_label": "transfer", "nft_transfers": [], "erc20_transfers": [ { "token_name": "AS Roma", "token_symbol": "ASR", "token_logo": null, "token_decimals": "0", "from_address_entity": null, "from_address_entity_logo": null, "from_address": "0x87917d879ba83ce3ada6e02d49a10c1ec1988062", "from_address_label": null, "to_address_entity": null, "to_address_entity_logo": null, "to_address": "0xf977814e90da44bfa03b6295a0616a897441acec", "to_address_label": null, "address": "0xa6610b3361c4c0d206aa3364cd985016c2d89386", "log_index": 0, "value": "77303", "possible_spam": false, "verified_contract": true, "security_score": null, "direction": "receive", "value_formatted": "77303" } ], "native_transfers": [], "summary": "Received 77,303 ASR from 0x87...8062", "possible_spam": false, "category": "token receive" }, //... } }
Token API
Our Token API is the ultimate tool for ERC-20 data, supporting every single token across all major chains. This includes everything from stablecoins like USDC to meme coins like Shiba Inu.
With the Token API, you can seamlessly get token balances, metadata, owners, and much more. As such, the Token API is the perfect tool for anyone looking to build token analytics platforms, token explorers, and other similar projects.
To highlight the power of the Token API, check out the script below for fetching the token balances of a wallet:
import fetch from 'node-fetch'; const options = { method: 'GET', headers: { accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY' }, }; fetch('https://deep-index.moralis.io/api/v2.2/0xf977814e90da44bfa03b6295a0616a897441acec/erc20?chain=0x15b38', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
In return for running the code above, you’ll get the specified wallet’s token balances. Here’s an example of what the response might look like:
[ { token_address: '0x454038003a93cf44766af352f74bad6b745616d0', symbol: 'JUV', name: 'Juventus', logo: null, thumbnail: null, decimals: 0, balance: '2162051', possible_spam: false, verified_contract: true, total_supply: '19956000', total_supply_formatted: '19956000', percentage_relative_to_total_supply: 10.83408999799559, security_score: null }, //... ]
Blockchain API
Moralis’ Blockchain API is the perfect tool for fetching blockchain-related data. With this industry-leading interface, you can easily fetch and integrate block data, contract logs, transactions, and more into your Chiliz projects. As such, the Blockchain API is the ultimate tool for anyone looking to build block explorers and other similar platforms.
To highlight the accessibility of the Blockchain API, here’s a short script on how to get the contents of a block by its hash or number:
import fetch from 'node-fetch'; const options = { method: 'GET', headers: { accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY' }, }; fetch('https://deep-index.moralis.io/api/v2.2/block/2223?chain=0x15b38', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
In return for running the script above, you’ll get the block’s timestamp, hash, number, log blooms, gas limit, and much more. Here’s a sample response:
{ "timestamp": "2023-02-08T09:59:39.000Z", "number": "2223", "hash": "0xdb0a5c1d425613467332e6c72fe767655881ee34c0fa249ede12dcbd7108b573", "parent_hash": "0xdbb70c187799812faba5ffabc8dfe7acbcdb0d1509a5ee9beb347f933c137530", "nonce": "0x0000000000000000", "sha3_uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logs_bloom": "//...", "transactions_root": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "state_root": "0x0141d3e37fe45ab505fd139dc96ecccfb64aec1cb85ee9f86cf19ad0a7e64bdd", "receipts_root": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "miner": "0x39a7179B6c73622B63B8b58b973835e00E9d38b4", "difficulty": "2", "total_difficulty": "4447", "size": "609", "extra_data": "0xd983010108846765746889676f312e31362e3135856c696e75780000bd7c1b1b8668a896f4b724979968dc8b39e0b1e649b6f411896866979b26d88a104488b026a55dd4f2e4efc5afebf6ebdbbce96041c7b659f5e55303920e66bb7775fa2200", "gas_limit": "30000000", "gas_used": "0", "transaction_count": "0", "base_fee_per_gas": "0", "transactions": [] }
If you’d like to explore all our interfaces, please visit the Web3 API page!
3-Step Tutorial: How to Get On-Chain Data from Chiliz with Moralis
We’ll now further highlight why you should build on Chiliz using Moralis. To do so, we’ll show you how easy it is to fetch a wallet’s full history in three simple steps:
- Sign Up with Moralis & Get an API Key
- Write a Script
- Run the Code
However, before you can continue, you need to deal with a few prerequisites!
Prerequisites
Before you can start the tutorial, make sure you have the following ready:
Step 1: Sign Up with Moralis & Get an API Key
Click the ”Start for Free” button at the top right to sign up with Moralis:
Once logged in, you can find your API key under the ”Home” tab:
Copy and save the key for now; you’ll need it in the next step.
Step 2: Write a Script
Open a code editor like VSC, set up a new folder, and initialize a project using this terminal command:
npm init
Install the required dependencies by running the terminal commands below in your project’s root folder:
npm install node-fetch --save npm install moralis @moralisweb3/common-evm-utils
Open your ”package.json” file and add ”type”: ”module”
to the list:
Create a new ”index.js” file and add the following script:
import fetch from 'node-fetch'; const options = { method: 'GET', headers: { accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY' }, }; fetch('https://deep-index.moralis.io/api/v2.2/wallets/0xf977814e90da44bfa03b6295a0616a897441acec/history?chain=0x15b38', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
From here, replace YOUR_API_KEY
with the key you copied during the first step:
Next, configure the address
parameter to fit your query:
Step 3: Run the Code
To run the code, execute the following command in your project’s root folder:
node index.js
In return, you’ll get the full history of the specified wallet, enriched with transaction summaries, categories, and much more. Here’s an example of what it might look like:
{ //... "result": [ { "hash": "0x0ea1e72d074cc7835d7f76014102bdd230257657d1cc9e57ad1701ce37d37c58", "nonce": "73645", "transaction_index": "0", "from_address_entity": null, "from_address_entity_logo": null, "from_address": "0x87917d879ba83ce3ada6e02d49a10c1ec1988062", "from_address_label": null, "to_address_entity": null, "to_address_entity_logo": null, "to_address": "0xa6610b3361c4c0d206aa3364cd985016c2d89386", "to_address_label": null, "value": "0", "gas": "47867", "gas_price": "5000000000000", "receipt_cumulative_gas_used": "47615", "receipt_gas_used": "47615", "receipt_contract_address": null, "receipt_status": "1", "block_timestamp": "2024-09-09T07:01:17.000Z", "block_number": "16386933", "block_hash": "0xb7d25de19e5eb2ddefec0bfce6d637dd49a8ab18a564e77f7434e0c691e2ab27", "transaction_fee": "0.238075", "method_label": "transfer", "nft_transfers": [], "erc20_transfers": [ { "token_name": "AS Roma", "token_symbol": "ASR", "token_logo": null, "token_decimals": "0", "from_address_entity": null, "from_address_entity_logo": null, "from_address": "0x87917d879ba83ce3ada6e02d49a10c1ec1988062", "from_address_label": null, "to_address_entity": null, "to_address_entity_logo": null, "to_address": "0xf977814e90da44bfa03b6295a0616a897441acec", "to_address_label": null, "address": "0xa6610b3361c4c0d206aa3364cd985016c2d89386", "log_index": 0, "value": "77303", "possible_spam": false, "verified_contract": true, "security_score": null, "direction": "receive", "value_formatted": "77303" } ], "native_transfers": [], "summary": "Received 77,303 ASR from 0x87...8062", "possible_spam": false, "category": "token receive" }, //... } }
To learn more about this, please check out our wallet history documentation page!
Why Build On Chiliz? – Exploring Use Cases
Now that you know how to fetch on-chain data from Chiliz using Moralis, let’s explore some exciting use cases:
- Ticketing Systems: Build innovative ticketing systems and dapps that offer secure, blockchain-based tickets.
- Fan Engagement Platforms: Develop exciting fan engagement platforms where users can participate in polls, Q&A sessions, contests, etc., with their favorite athletes and celebrities.
- Fantasy Leagues: Improve the fantasy sports experience by integrating one-of-a-kind digital assets, real-time stats, and rewards for top players.
- Esports Platforms: Create esports platforms with innovative token-based rewards, real-time data integration, and seamless fan interactions.
- AR Games: Build AR games – like Socios’ Token Hunt – that combine digital assets with the physical realm, letting players collect both NFTs and fungible tokens.
These five use cases are only a few prominent examples; the only limiting factor here is your imagination!
Summary: Chiliz Chain Deep Dive – Why Build on Chiliz Chain?
Chiliz launched back in 2018, and it’s an L1 network that aims to become the biggest blockchain for sports and entertainment brands. Chiliz leverages a PoSA consensus mechanism to deliver fast block finality and low transaction fees.
But why should you build on Chiliz? Here are five key benefits of the network:
- Seamless Developer Experience: Chiliz is EVM-compatible. This means you can use common Ethereum tools to build dapps on the network.
- Fast Transactions: With the PoSA consensus mechanism, Chiliz is able to deliver fast transaction finality.
- Low Fees: Chiliz features low transaction fees, making it an attractive blockchain for developers and end users alike.
- Established Ecosystem: With Chiliz, you can reach millions of users from an already established fan base.
- Large Developer Community: Chiliz has a large developer community supported by grants and ongoing gas fee repurposing.
In addition to highlighting some benefits of building on Chiliz, we also introduced Moralis – the industry’s leading Web3 data provider. With our Chiliz-compatible Web3 APIs, you can now seamlessly fetch all the crypto data you need for your dapps without breaking a sweat.
But why use Moralis to build on Chiliz?
- Comprehensive: With Moralis, you get more data with fewer calls. Query token balances, blockchain data, a wallet’s full history, and more with one line of code.
- Cross-Chain: Build across all major chains, including Chiliz, Ethereum, Optimism, etc., with Moralis’ cross-chain compatible APIs.
- Secure: Experience enterprise-grade data security with the industry’s first SOC 2 Type 2 certified data provider.
If you liked this Chiliz article, consider reading more content here on the blog. For instance, dive into our NFT Rarity API or learn how to get token prices with an RPC node.
Also, if you want to leverage our Chiliz-compatible APIs yourself, don’t forget to sign up with Moralis!