
How to Get the Holders of an ERC20 Token
IntroductionIn the world of cryptocurrency, knowing the holders of a particular token can provide valuable insights and opportunities for collaboration. Chainbase, a leading platform, offers a powerful API called getTokenHolders that allows you to retrieve a list of addresses for all the holders of a specific ERC20 token. This tutorial will guide you through the process of using Chainbase API to get the holders of a cryptocurrency deployed on various chains. By leveraging this information, yo...

How to Determine the Type of an EVM Contract
In common on-chain data parsing, there is often a large demand for determining the type of contract. This article will judge on relevant standards and engineering practices to determine whether the contract belongs to ERC20 / ERC721 / ERC1155. For more use cases, you can refer to the developer documentation of Chainbase, or ask the original author through Discord. We are happy to discuss issues related to Web3 infra, Data SDK, Chainbase APIs, etc.Rules to determine different contractsWith the...

How to Register a Chainbase Account?
To get started, go to the Chainbase official website.websiteClick on the dashboard to register a new account.loginEnter your email and password.Untitled.pngNext, create a new project in the console to obtain an API key. Now it's time to start your Web3 journey!
All-in-one web3 data infrastructure for indexing, transforming, and utilization of on-chain data at scale.



How to Get the Holders of an ERC20 Token
IntroductionIn the world of cryptocurrency, knowing the holders of a particular token can provide valuable insights and opportunities for collaboration. Chainbase, a leading platform, offers a powerful API called getTokenHolders that allows you to retrieve a list of addresses for all the holders of a specific ERC20 token. This tutorial will guide you through the process of using Chainbase API to get the holders of a cryptocurrency deployed on various chains. By leveraging this information, yo...

How to Determine the Type of an EVM Contract
In common on-chain data parsing, there is often a large demand for determining the type of contract. This article will judge on relevant standards and engineering practices to determine whether the contract belongs to ERC20 / ERC721 / ERC1155. For more use cases, you can refer to the developer documentation of Chainbase, or ask the original author through Discord. We are happy to discuss issues related to Web3 infra, Data SDK, Chainbase APIs, etc.Rules to determine different contractsWith the...

How to Register a Chainbase Account?
To get started, go to the Chainbase official website.websiteClick on the dashboard to register a new account.loginEnter your email and password.Untitled.pngNext, create a new project in the console to obtain an API key. Now it's time to start your Web3 journey!
Share Dialog
Share Dialog
All-in-one web3 data infrastructure for indexing, transforming, and utilization of on-chain data at scale.

Subscribe to Chainbase

Subscribe to Chainbase
<100 subscribers
<100 subscribers
The Author: masterdai
Indexing is an essential tool in the blockchain ecosystem, streamlining the organization and retrieval of data. It bolsters efficiency, enhances user experience, simplifies data analysis, and ensures scalability. By facilitating rapid data access, it supports real-time applications and optimizes interactions, a feature that is particularly crucial for platforms like DeFi. Indexing also aids in various tasks, from detecting fraudulent activity to understanding user behavior. As the volume of blockchain data grows, indexing ensures that application performance remains high.
As the only data cloud indexing provider in the Sui blockchain ecosystem, Chainbase plays a critical role in enabling efficient data retrieval. In the upcoming guide, I will illustrate how developers can effectively access on-chain data using several SQL examples. This will offer a hands-on understanding of how to utilize Chainbase's indexing capabilities to improve data interaction and analysis within the Sui blockchain.
Sui is a groundbreaking smart contract platform that revolutionizes the traditional blockchain model by centering storage around objects, which are programmable entities managed by smart contracts. Unlike the conventional account-based storage model where each account contains a key-value store, Sui's approach focuses on objects as the fundamental unit of data storage.
These objects are digital entities that store data directly on the blockchain. Developers can define, create, and manage these objects, which represent user-level assets. Each object possesses distinct attributes, including ownership, and these attributes can be updated based on the governing logic of the smart contract that created the object.
This object-centric data model of Sui allows digital assets and their attributes to exist on-chain and independently of smart contracts. This innovative approach offers a new level of flexibility and functionality in the blockchain space, enabling more complex and dynamic interactions with digital assets.
A free account at Chainbase with an API key.
An IDE. Our examples are shown in JavaScript, you can use VS Code as your IDE for example.
To begin with, you'll need to register on Chainbase and obtain an API key. This key will be used to authenticate your requests to the Chainbase API.
Log in to your Chainbase dashboard.
Execute the following SQL query to retrieve the required data:
Want to identify the most transaction-heavy address in your blockchain? The following SQL query can help:
SELECT
sender,
count() as total
FROM
sui.transactions
GROUP BY
sender
ORDER BY
total DESC
To identify the most commonly used module and event type, use the query below:
SELECT
module,
event_type,
COUNT(*) AS total
FROM
sui.events
GROUP BY
event_type,
module
ORDER BY
total DESC;
Looking for specific transaction content? Filter your search using this SQL query:
select
*
from
sui.transactions
where
transaction_content like "%fuddies%%orderbook%"
order by
id DESC
limit
100
For retrieving specific event data from the Sui blockchain, execute the following query:
SELECT
id,
module,
sender,
transaction_digest,
event_type
FROM
sui.events
WHERE
event_type LIKE "%0xac176715abe5bcdaae627c5048958bbe320a8474f524674f3278e31af3c8b86b%"
ORDER BY
id DESC
LIMIT
100
Once you have the SQL query to retrieve the desired data, the next step involves generating an API request to fetch the real-time Sui blockchain data. Follow the steps below:

Step 1: Install Node.js and the Axios library if you haven't already.
Step 2: Use the following code snippet to make the API call:
const axios = require('axios');
axios.post('https://api.chainbase.online/v1/dw/query', {"query":"SELECT\n id,\n module,\n sender,\n transaction_digest,\n event_type\nFROM\n sui.events\nWHERE\n event_type LIKE \"%0xac176715abe5bcdaae627c5048958bbe320a8474f524674f3278e31af3c8b86b%\"\norder by\n id desc\nlimit\n 100"}, {
headers: {
'x-api-key': '[api-key]'
}
})
.then(response => {
const data = response.data.data;
console.log(data);
})
.catch(error => {
console.error(error);
});
This code snippet utilizes the Axios library to send a POST request to the Chainbase API endpoint (https://api.chainbase.online/v1/dw/query). The SQL query is included in the request payload, and the 'x-api-key' header is used for authentication.
After making the API call, you will receive a response containing the real-time Sui onchain data. Follow the steps below to extract and print the data:
Access the retrieved data from the response using response.data.data.
Display the data by printing it on the console log.
Run node 'filename'.js
{
event_type: '0xbc3df36be17f27ac98e3c839b2589db8475fa07b20657b08e8891e3aaf5ee5f9::mint_event::MintEvent<0xac176715abe5bcdaae627c5048958bbe320a8474f524674f3278e31af3c8b86b::fuddies::Fuddies>',
id: '306968',
module: 'fuddies',
sender: '0x65afcd7679a1570f11b3865d8c0d13e070b4cf7587af11c3eacd98e97b6252a3',
transaction_digest: '6GMShTdQyeLzieJBLyVjrJn7nZTeFKEEnhRDTKZd6dqX'
},
{
event_type: '0xbc3df36be17f27ac98e3c839b2589db8475fa07b20657b08e8891e3aaf5ee5f9::mint_event::MintEvent<0xac176715abe5bcdaae627c5048958bbe320a8474f524674f3278e31af3c8b86b::fuddies::Fuddies>',
id: '304865',
module: 'fuddies',
sender: '0x65afcd7679a1570f11b3865d8c0d13e070b4cf7587af11c3eacd98e97b6252a3',
transaction_digest: 'FDPsGKnux8gCDcPWbKqkLbg28bnu6A16NUdsQN9LQb5x'
},
{
event_type: '0xbc3df36be17f27ac98e3c839b2589db8475fa07b20657b08e8891e3aaf5ee5f9::mint_event::MintEvent<0xac176715abe5bcdaae627c5048958bbe320a8474f524674f3278e31af3c8b86b::fuddies::Fuddies>',
id: '304864',
module: 'fuddies',
sender: '0x65afcd7679a1570f11b3865d8c0d13e070b4cf7587af11c3eacd98e97b6252a3',
transaction_digest: 'FDPsGKnux8gCDcPWbKqkLbg28bnu6A16NUdsQN9LQb5x'
},
{
event_type: '0xbc3df36be17f27ac98e3c839b2589db8475fa07b20657b08e8891e3aaf5ee5f9::mint_event::MintEvent<0xac176715abe5bcdaae627c5048958bbe320a8474f524674f3278e31af3c8b86b::fuddies::Fuddies>',
id: '304863',
module: 'fuddies',
sender: '0x65afcd7679a1570f11b3865d8c0d13e070b4cf7587af11c3eacd98e97b6252a3',
transaction_digest: 'FDPsGKnux8gCDcPWbKqkLbg28bnu6A16NUdsQN9LQb5x'
},
...
Experience Sui's Dashboard with a Front-End Demo

In the fast-paced world of blockchain technology, data management can seem daunting. However, with a tool like Chainbase at your disposal, you can easily navigate through the sea of data that blockchain platforms like Sui generate. From generating insightful SQL queries to making API calls, Chainbase empowers developers to make the most of blockchain data.
1. What is Chainbase?
Chainbase is a leading data cloud indexing provider in the Sui blockchain ecosystem, enhancing data retrieval processes for developers.
2. What makes Sui different from other blockchain platforms?
Sui uses an innovative object-oriented storage model, contrasting the traditional account-based models of other blockchain systems.
3. What do I need to start using Chainbase?
You will need a free account at Chainbase and an API key, along with an Integrated Development Environment (IDE) like VS Code.
4. How can I extract specific data from the Sui blockchain?
You can utilize SQL queries to extract specific data. We also allows you to generate API requests for real-time data retrieval.
5. How do I authenticate my requests to the Chainbase API?
You will use an API key acquired from Chainbase to authenticate all your requests.
Chainbase is an all-in-one data infrastructure for Web3 that allows you to index, transform, and use on-chain data at scale. By leveraging enriched on-chain data and streaming computing technologies across one data infrastructure, Chainbase automates the indexing and querying of blockchain data, enabling developers to accomplish more with less effort.
Want to learn more about Chainbase?
Visit our website chainbase.com Sign up for a free account, and Check out our documentation.
Website|Blog|Twitter|Discord|Link3
The Original Link: Guidelines for Indexing SUI Blockchain Data
The Author: masterdai
Indexing is an essential tool in the blockchain ecosystem, streamlining the organization and retrieval of data. It bolsters efficiency, enhances user experience, simplifies data analysis, and ensures scalability. By facilitating rapid data access, it supports real-time applications and optimizes interactions, a feature that is particularly crucial for platforms like DeFi. Indexing also aids in various tasks, from detecting fraudulent activity to understanding user behavior. As the volume of blockchain data grows, indexing ensures that application performance remains high.
As the only data cloud indexing provider in the Sui blockchain ecosystem, Chainbase plays a critical role in enabling efficient data retrieval. In the upcoming guide, I will illustrate how developers can effectively access on-chain data using several SQL examples. This will offer a hands-on understanding of how to utilize Chainbase's indexing capabilities to improve data interaction and analysis within the Sui blockchain.
Sui is a groundbreaking smart contract platform that revolutionizes the traditional blockchain model by centering storage around objects, which are programmable entities managed by smart contracts. Unlike the conventional account-based storage model where each account contains a key-value store, Sui's approach focuses on objects as the fundamental unit of data storage.
These objects are digital entities that store data directly on the blockchain. Developers can define, create, and manage these objects, which represent user-level assets. Each object possesses distinct attributes, including ownership, and these attributes can be updated based on the governing logic of the smart contract that created the object.
This object-centric data model of Sui allows digital assets and their attributes to exist on-chain and independently of smart contracts. This innovative approach offers a new level of flexibility and functionality in the blockchain space, enabling more complex and dynamic interactions with digital assets.
A free account at Chainbase with an API key.
An IDE. Our examples are shown in JavaScript, you can use VS Code as your IDE for example.
To begin with, you'll need to register on Chainbase and obtain an API key. This key will be used to authenticate your requests to the Chainbase API.
Log in to your Chainbase dashboard.
Execute the following SQL query to retrieve the required data:
Want to identify the most transaction-heavy address in your blockchain? The following SQL query can help:
SELECT
sender,
count() as total
FROM
sui.transactions
GROUP BY
sender
ORDER BY
total DESC
To identify the most commonly used module and event type, use the query below:
SELECT
module,
event_type,
COUNT(*) AS total
FROM
sui.events
GROUP BY
event_type,
module
ORDER BY
total DESC;
Looking for specific transaction content? Filter your search using this SQL query:
select
*
from
sui.transactions
where
transaction_content like "%fuddies%%orderbook%"
order by
id DESC
limit
100
For retrieving specific event data from the Sui blockchain, execute the following query:
SELECT
id,
module,
sender,
transaction_digest,
event_type
FROM
sui.events
WHERE
event_type LIKE "%0xac176715abe5bcdaae627c5048958bbe320a8474f524674f3278e31af3c8b86b%"
ORDER BY
id DESC
LIMIT
100
Once you have the SQL query to retrieve the desired data, the next step involves generating an API request to fetch the real-time Sui blockchain data. Follow the steps below:

Step 1: Install Node.js and the Axios library if you haven't already.
Step 2: Use the following code snippet to make the API call:
const axios = require('axios');
axios.post('https://api.chainbase.online/v1/dw/query', {"query":"SELECT\n id,\n module,\n sender,\n transaction_digest,\n event_type\nFROM\n sui.events\nWHERE\n event_type LIKE \"%0xac176715abe5bcdaae627c5048958bbe320a8474f524674f3278e31af3c8b86b%\"\norder by\n id desc\nlimit\n 100"}, {
headers: {
'x-api-key': '[api-key]'
}
})
.then(response => {
const data = response.data.data;
console.log(data);
})
.catch(error => {
console.error(error);
});
This code snippet utilizes the Axios library to send a POST request to the Chainbase API endpoint (https://api.chainbase.online/v1/dw/query). The SQL query is included in the request payload, and the 'x-api-key' header is used for authentication.
After making the API call, you will receive a response containing the real-time Sui onchain data. Follow the steps below to extract and print the data:
Access the retrieved data from the response using response.data.data.
Display the data by printing it on the console log.
Run node 'filename'.js
{
event_type: '0xbc3df36be17f27ac98e3c839b2589db8475fa07b20657b08e8891e3aaf5ee5f9::mint_event::MintEvent<0xac176715abe5bcdaae627c5048958bbe320a8474f524674f3278e31af3c8b86b::fuddies::Fuddies>',
id: '306968',
module: 'fuddies',
sender: '0x65afcd7679a1570f11b3865d8c0d13e070b4cf7587af11c3eacd98e97b6252a3',
transaction_digest: '6GMShTdQyeLzieJBLyVjrJn7nZTeFKEEnhRDTKZd6dqX'
},
{
event_type: '0xbc3df36be17f27ac98e3c839b2589db8475fa07b20657b08e8891e3aaf5ee5f9::mint_event::MintEvent<0xac176715abe5bcdaae627c5048958bbe320a8474f524674f3278e31af3c8b86b::fuddies::Fuddies>',
id: '304865',
module: 'fuddies',
sender: '0x65afcd7679a1570f11b3865d8c0d13e070b4cf7587af11c3eacd98e97b6252a3',
transaction_digest: 'FDPsGKnux8gCDcPWbKqkLbg28bnu6A16NUdsQN9LQb5x'
},
{
event_type: '0xbc3df36be17f27ac98e3c839b2589db8475fa07b20657b08e8891e3aaf5ee5f9::mint_event::MintEvent<0xac176715abe5bcdaae627c5048958bbe320a8474f524674f3278e31af3c8b86b::fuddies::Fuddies>',
id: '304864',
module: 'fuddies',
sender: '0x65afcd7679a1570f11b3865d8c0d13e070b4cf7587af11c3eacd98e97b6252a3',
transaction_digest: 'FDPsGKnux8gCDcPWbKqkLbg28bnu6A16NUdsQN9LQb5x'
},
{
event_type: '0xbc3df36be17f27ac98e3c839b2589db8475fa07b20657b08e8891e3aaf5ee5f9::mint_event::MintEvent<0xac176715abe5bcdaae627c5048958bbe320a8474f524674f3278e31af3c8b86b::fuddies::Fuddies>',
id: '304863',
module: 'fuddies',
sender: '0x65afcd7679a1570f11b3865d8c0d13e070b4cf7587af11c3eacd98e97b6252a3',
transaction_digest: 'FDPsGKnux8gCDcPWbKqkLbg28bnu6A16NUdsQN9LQb5x'
},
...
Experience Sui's Dashboard with a Front-End Demo

In the fast-paced world of blockchain technology, data management can seem daunting. However, with a tool like Chainbase at your disposal, you can easily navigate through the sea of data that blockchain platforms like Sui generate. From generating insightful SQL queries to making API calls, Chainbase empowers developers to make the most of blockchain data.
1. What is Chainbase?
Chainbase is a leading data cloud indexing provider in the Sui blockchain ecosystem, enhancing data retrieval processes for developers.
2. What makes Sui different from other blockchain platforms?
Sui uses an innovative object-oriented storage model, contrasting the traditional account-based models of other blockchain systems.
3. What do I need to start using Chainbase?
You will need a free account at Chainbase and an API key, along with an Integrated Development Environment (IDE) like VS Code.
4. How can I extract specific data from the Sui blockchain?
You can utilize SQL queries to extract specific data. We also allows you to generate API requests for real-time data retrieval.
5. How do I authenticate my requests to the Chainbase API?
You will use an API key acquired from Chainbase to authenticate all your requests.
Chainbase is an all-in-one data infrastructure for Web3 that allows you to index, transform, and use on-chain data at scale. By leveraging enriched on-chain data and streaming computing technologies across one data infrastructure, Chainbase automates the indexing and querying of blockchain data, enabling developers to accomplish more with less effort.
Want to learn more about Chainbase?
Visit our website chainbase.com Sign up for a free account, and Check out our documentation.
Website|Blog|Twitter|Discord|Link3
The Original Link: Guidelines for Indexing SUI Blockchain Data
No activity yet