
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!
All-in-one web3 data infrastructure for indexing, transforming, and utilization of on-chain data at scale.

Subscribe to Chainbase

Subscribe to Chainbase
Share Dialog
Share Dialog
<100 subscribers
<100 subscribers


Most blockchain networks as of now have “event”.
It plays an important role in the blockchain interaction. In traditional Web2 development, most of the interactions between clients and servers can read-and-write synchronously, while the interaction with the blockchain networks is like an asynchronous read-write separation system (similar to the currently popular CQRS model). Results returned from many contracts are generated after the mining of blocks, therefore, submitting events in contracts is an essential way to interact with the blockchain users.
Event has two functions:
Get the returned data of the contract in a transaction
Monitor various operating states of the contract

In Aptos architecture design, you can use fullnode’s REST service to interact with the chain through Node API. For a single transaction, the process will be:
Proxy the transaction from REST service to validator’s mempool component for caching Through the efforts of several components, the block reaches consensus. Call Storage component via Execution to permanently store the data off-chain, including the event data representing the running result REST service gets the event data via Storage component.

Chainbase has now provided a stable and efficient fullnode cluster. To get an Aptos Mainnet Node API endpoint, please check out the documentation.

After registration, you will have your own Node API: https://aptos-mainnet.s.chainbase.online/{your-api-key}/v1
(Note: don’t forget to replace {your-api-key} )
Take querying Aptos name v1’s (provided by the official team) domain mapping event as an example, Through on-chain data analysis, the project’s account address is:
Let’s look at the event definition of ABI (Aptos is developer-friendly, that ABI can be queried on-chain), through Get account modules. The request is:

Extract the key information defined by the event, you can use Get events by event handle to construct a request for this event:
address = "0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c"
event_handle = "0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c::domains::SetNameAddressEventsV1"
field_name = "set_name_events"

In this way, you are able to continuously polling the event data through Node API. The new_address will be the mapping address.
From the example above, you can constantly get the latest event. But if you want to query the latest mapping address for a specific domain, or analyze the number of registered domains per day, etc. Node API will not satisfy your needs.
Essentially, Aptos Node API is for basic interactions with the chain, the storage and other components behind it are not designed for multi-dimensional data query, index, and analytics.
Chainbase Data Cloud enables users to access any Aptos data efficiently and easily, as well as generate customized APIs via SQL, through structuring, processing, indexing, and importing data into a cloud-based data warehouse, which is more suitable for on-chain data analytic purposes.
Aptos Raw Data: events, transactions, table_items, move_modules, move_resources, etc.
Aptos Abstract Data: coin, token, etc.
Again, take Aptos name v1 as an example:
select
JSONExtract(data, 'domain_name', 'String') as domain,
JSONExtract(JSONExtract(data, 'new_address', 'String'), 'vec', 'Array(String)') as registered_address,
toDateTime(JSONExtract(data, 'expiration_time_secs', 'String')) as expiration,
transaction_version
from
aptos.events
where
type = '0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c::domains::SetNameAddressEventV1'
and account_address = '0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c'
and domain = '000'

select
count(1)
from
aptos.events
where
type = '0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c::domains::RegisterNameEventV1'
and account_address = '0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c'

select
JSONExtract(JSONExtract(data, 'new_address', 'String'), 'vec', 'String') as registered_address,
count(*) as holder_total
from
aptos.events
where
type = '0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c::domains::SetNameAddressEventV1'
and account_address = '0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c'
and registered_address != "[]"
group by registered_address
order by holder_total desc
limit
10

As you can see from the example, Chainbase Data Cloud is very fast and efficient in getting the Aptos event data. More examples and respective codes can be found in our developer documentation.
Have fun at Aptos!
Chainbase is a leading Web3 blockchain interaction layer infrastructure. By providing cloud-based API services, it helps developers quickly access and utilize blockchain networks and easily build Web3 applications.
Chainbase makes blockchain interaction and data query/index on chains simple and easy to operate. Anyone can use, build and publish open APIs, which allows developers to focus on application-level innovation instead of solving the back-end hassles.
Chainbase currently supports Ethereum, Polygon, BSC, Fantom, Avalanche, Arbitrum, Aptos and other chains. This allows projects of all sizes to quickly reduce development time and costs, no matter which chains they are building on!
Website | Blog | Twitter | Discord | Link3
Stay connected with Chainbase on Medium, Twitter, and Discord. If you are a back-end dev and would like to experience the product, please submit a request as well as read the dev documentation on our website.
Most blockchain networks as of now have “event”.
It plays an important role in the blockchain interaction. In traditional Web2 development, most of the interactions between clients and servers can read-and-write synchronously, while the interaction with the blockchain networks is like an asynchronous read-write separation system (similar to the currently popular CQRS model). Results returned from many contracts are generated after the mining of blocks, therefore, submitting events in contracts is an essential way to interact with the blockchain users.
Event has two functions:
Get the returned data of the contract in a transaction
Monitor various operating states of the contract

In Aptos architecture design, you can use fullnode’s REST service to interact with the chain through Node API. For a single transaction, the process will be:
Proxy the transaction from REST service to validator’s mempool component for caching Through the efforts of several components, the block reaches consensus. Call Storage component via Execution to permanently store the data off-chain, including the event data representing the running result REST service gets the event data via Storage component.

Chainbase has now provided a stable and efficient fullnode cluster. To get an Aptos Mainnet Node API endpoint, please check out the documentation.

After registration, you will have your own Node API: https://aptos-mainnet.s.chainbase.online/{your-api-key}/v1
(Note: don’t forget to replace {your-api-key} )
Take querying Aptos name v1’s (provided by the official team) domain mapping event as an example, Through on-chain data analysis, the project’s account address is:
Let’s look at the event definition of ABI (Aptos is developer-friendly, that ABI can be queried on-chain), through Get account modules. The request is:

Extract the key information defined by the event, you can use Get events by event handle to construct a request for this event:
address = "0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c"
event_handle = "0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c::domains::SetNameAddressEventsV1"
field_name = "set_name_events"

In this way, you are able to continuously polling the event data through Node API. The new_address will be the mapping address.
From the example above, you can constantly get the latest event. But if you want to query the latest mapping address for a specific domain, or analyze the number of registered domains per day, etc. Node API will not satisfy your needs.
Essentially, Aptos Node API is for basic interactions with the chain, the storage and other components behind it are not designed for multi-dimensional data query, index, and analytics.
Chainbase Data Cloud enables users to access any Aptos data efficiently and easily, as well as generate customized APIs via SQL, through structuring, processing, indexing, and importing data into a cloud-based data warehouse, which is more suitable for on-chain data analytic purposes.
Aptos Raw Data: events, transactions, table_items, move_modules, move_resources, etc.
Aptos Abstract Data: coin, token, etc.
Again, take Aptos name v1 as an example:
select
JSONExtract(data, 'domain_name', 'String') as domain,
JSONExtract(JSONExtract(data, 'new_address', 'String'), 'vec', 'Array(String)') as registered_address,
toDateTime(JSONExtract(data, 'expiration_time_secs', 'String')) as expiration,
transaction_version
from
aptos.events
where
type = '0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c::domains::SetNameAddressEventV1'
and account_address = '0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c'
and domain = '000'

select
count(1)
from
aptos.events
where
type = '0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c::domains::RegisterNameEventV1'
and account_address = '0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c'

select
JSONExtract(JSONExtract(data, 'new_address', 'String'), 'vec', 'String') as registered_address,
count(*) as holder_total
from
aptos.events
where
type = '0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c::domains::SetNameAddressEventV1'
and account_address = '0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c'
and registered_address != "[]"
group by registered_address
order by holder_total desc
limit
10

As you can see from the example, Chainbase Data Cloud is very fast and efficient in getting the Aptos event data. More examples and respective codes can be found in our developer documentation.
Have fun at Aptos!
Chainbase is a leading Web3 blockchain interaction layer infrastructure. By providing cloud-based API services, it helps developers quickly access and utilize blockchain networks and easily build Web3 applications.
Chainbase makes blockchain interaction and data query/index on chains simple and easy to operate. Anyone can use, build and publish open APIs, which allows developers to focus on application-level innovation instead of solving the back-end hassles.
Chainbase currently supports Ethereum, Polygon, BSC, Fantom, Avalanche, Arbitrum, Aptos and other chains. This allows projects of all sizes to quickly reduce development time and costs, no matter which chains they are building on!
Website | Blog | Twitter | Discord | Link3
Stay connected with Chainbase on Medium, Twitter, and Discord. If you are a back-end dev and would like to experience the product, please submit a request as well as read the dev documentation on our website.
No activity yet