
Have you been searching for a simple solution on how to monitor all ETH transfer transactions? If so, youโve come to the right place! Thanks to the Moralis Streams API, you can easily monitor ETH transactions, and you can do so either via Moralisโ user-friendly UI or SDK. Whatโs more, even when you choose the SDK path, you only need to set up a few lines of code to get the job done! For example, these are the snippets of code to use when working with JavaScript:
const newStream = await Moralis.Streams.add(options) const {id}=newStream.toJSON(); const address=โwallet_address_you_want_to_trackโ await Moralis.Streams.addAddress({address,id})
So, if youโve been wondering how to monitor all ETH transfer transactions, you can see from the above example that Moralis is the best option to do so and fetch Web3 real-time data! Now, if you worked with Moralis Web3 APIs before, you already know how to implement the above lines of code. However, if this is your first rodeo with this ultimate Web3 API provider, make sure to watch the video at the top or dive into the following sections.
Overview
Moving forward, we will dive straight into an example of how to monitor all ETH transfer transactions by focusing on crypto wallet tracking. We will approach this example in two ways. First, youโll see how to go about it using Moralisโ admin UI. Second, weโll complete the same feat by using the JS SDK.

By taking on this example, youโll learn how to get going with Moralisโ Streams API and how to implement the above-outlined lines of code. After all, you can find a complete code walkthrough below.
However, below todayโs tutorial, you can find additional sections explaining more about how to monitor crypto transactions. Aside from focusing on particular wallets, you can also focus on a particular cryptocurrency (e.g., ETH). Essentially, you can monitor any fungible and non-fungible token smart contract and receive notifications whenever the token in question is transferred.
Tutorial: How to Monitor All ETH Transfer Transactions with the Moralis Streams API
Whether you plan on using Moralisโ admin UI or SDK, you need an active Moralis account. Thus, before moving forward, make sure to create your free Moralis account. Simply click on the link in the previous sentence or hit the โStart for Freeโ button on the far right-hand side of the Moralis website top menu:

Also, for the sake of this tutorial, we will focus on the Polygon testnet. However, the principles are the same if you focus on the Ethereum mainnet or any other EVM-compatible chain. With that said, if you wish to follow our lead, make sure to get some โtestโ MATIC by using the Polygon Mumbai faucet that awaits you on the Moralis Pure Faucets page.
Note: Feel free to focus on any other chain. However, we strongly recommend that you start by targeting testnets.
ETH Transfer Tracking with Moralis Admin UI โ Getting Started
With your Moralis account up and running, youโll be able to access your admin area. Feel free to start with the โGet Startedโ tutorial that awaits you on the inside. Or, simply hit the โCreate a projectโ button and name your project:

After creating your project, you can focus on the โhow to monitor all ETH transfer transactionsโ challenge. To do so, select the Streams option from the side menu and then click on one of the two โCreate a new Streamโ buttons:

Next, you must enter an Ethereum address you wish to monitor. This can be a wallet address or a token smart contract address. For the sake of this tutorial, weโll focus on wallet tracking. So, feel free to use any wallet address that you want.
However, for educational and testing purposes, using a wallet address you control is the best option. So, if you use MetaMask, simply copy your address.
To proceed, simply paste the address into the โAdd EVM/Aptos Address to Streamโ entry field:

As soon as you paste an address into the designated fields, the UI will automatically present you with stream configuration options.
Stream Setup
As indicated in the image below, you can toggle between โDemoโ and โProdโ, among other options. Once youโre ready to use this feature for production purposes, youโll want to switch to โProdโ. However, for the sake of this tutorial, stick to โDemoโ:

Looking at the above screenshot, you also see the โWebhook URLโ, โDescriptionโ, and โTagโ entry fields. For demonstration purposes, you donโt need to provide a webhook URL. As for the description and tag fields, you can go with the default options.
Scrolling further down, youโll see the โSelect Networksโ section. This is where you can toggle the buttons next to all the networks you wish to focus on. However, as pointed out previously, for the sake of this tutorial, weโll be focusing on Polygonโs testnet (Mumbai):

After selecting the network(s) you wish to focus on, you can move on to the fourth step of the stream setup process. Again, you have multiple options:

As you can see in the image above, we decided to focus on contract interactions because we will do an example ERC-20 transfer. However, if you were to tackle the โhow to monitor all ETH transfer transactionsโ task head-on, youโd need to select Ethereum in step three and tick the โNative Transactionsโ box in step four.
Scrolling further down your stream setup, youโll also see the โAdvanced Optionsโ and โTriggersโ sections. The former allows you to filter your monitoring agenda further by using the smart contractโs ABI to target specific smart contract functions.
As for the Moralis triggers, you get to run read-only smart contract functions. By doing so, you get results from those functions as part of your Web3 webhooks.
View the Results โ Example Transaction
Without any special tweaks, you can already see the power of your new stream. Hereโs our example transaction of Chainlink (LINK) tokens on the Mumbai testnet:

Our demo stream detects the above example transaction instantaneously:

To experience the power of this amazing tool, we encourage you to run your own example transaction. Then, youโll get to see all the relevant on-chain data that this type of monitoring offers (see the above screenshot), including the transaction hash, the smart contract involved in the event, the โfromโ and โtoโ addresses, the transferred value, and more.
Essentially, setting a Moralis stream gives you a powerful detector to spot on-chain events. And, when any of the events occur, you not only detect them, but you also get the related details. As such, you can easily utilize those details to create powerful bots, auto-messaging dapps, and much more.

How to Monitor All ETH Transfer Transactions with Moralisโ JS SDK
Although setting up on-chain monitoring via the Moralis admin area is the simplest path, when building more advanced dapps, you might prefer to set things up via Moralisโ SDK.
Note: If you want detailed instructions on how to use Streams via the SDK, hit the relevant button on the โStreamโ page of your Moralis admin area:

So, you might be wondering how to monitor all ETH transfer transactions programmatically. First, you must decide which programming language/framework you wish to use. You have many options, though JavaScript or Python combined with NodeJS tends to be the most popular.
However, before you can focus on creating your stream via the SDK, you need to prepare a server. The latter will receive a webhook. Fortunately, you can create a simple NodeJS Express app, which will provide you with a โwebhookโ endpoint.
Create a Local Server
So, to that end, you can use the following lines of code โ simply copy-paste them into your โindex.jsโ file:
const express = require("express"); const app = express(); const port = 3000; app.use(express.json()); app.post("/webhook", async (req, res) => { const {body} = req; try { console.log(body); } catch (e) { console.log(e); return res.status(400).json(); } return res.status(200).json(); }); app.listen(port, () => { console.log(`Listening to streams`); });
Note: If youโve never created NodeJS applications and set up Express servers, dive into our โQuickstart NodeJSโ guide.
With the above script in place, simply enter and run the npm run start
command using your terminal.
In response to the above command, your terminal should return the โListening to streamsโ message:

Create a Forwarding Tunnel
Next, open a new terminal and run the ngrok http 3000
command. This will create a tunnel to port 3000
. In response to this command, you will get a URL address to use as a webhook URL for your stream.

With your local server and tunnel ready, you can use the lines of code outlined in the upcoming section to monitor various on-chain activities. And, of course, the โhow to monitor all ETH transfer transactionsโ feat is also one of the options you can focus on.
Crypto Transfer Monitoring โ Code Walkthrough
Start by initializing another NodeJS app. Next, create a new โindex.jsโ file, which needs to require Moralis and dotenv
:
const Moralis = require("moralis").default; const { EvmChain } = require("@moralisweb3/common-evm-utils"); require("dotenv").config();
In addition, you need to create a โ.envโ file. Inside that file, store your Moralis Web3 API key under the MORALIS_KEY
variable. To obtain the value of that variable, access your Moralis admin area, go to โSettingsโ, and copy the default API key or create a new one:

Now that you have your API key, you can initialize Moralis. To do so, add the following lines of code below require (โdotenvโ).config();
:
Moralis.start({ apiKey: process.env.MORALIS_KEY, });
Then, itโs time to focus on the streamโs options with the following lines of code:
async function streams(){ const options = { chains: [EvmChain.MUMBAI], tag: "transfers", description: "Listen to Transfers", includeContractLogs: false, includeNativeTxs: true, webhookUrl: "your webhook url" }
Looking at the above code snippet, you can see that it defines a chain to focus on, a description, a tag, and a webhook URL. Those are all the same options we covered in the above section, as we used Moralisโ admin UI.
We will focus on listening to native transactions on the Mumbai testnet. So, we set includeContractLogs
to false
in order to not listen to ERC-20 transactions. Furthermore, we focus on native currency transfers by setting includeNativeTxs
to true
. Regarding the Mumbai network, the native currency is โtestโ MATIC.
To use the above lines of code in your โindex.jsโ script, you just need to replace your webhook url
with the previously generated ngrok
URL:

As indicated in the above image, make sure to add /webhook
at the end of your ngrok
URL.
Create a New Stream
By covering all the above-outlined steps, you are finally ready to implement the lines of code showcased in the introduction of this article.
As such, focus on the above-defined async function streams
and add the following snippets of code below the webhookUrl
line:
const newStream = await Moralis.Streams.add(options) const {id} = newStream.toJSON(); const address = "wallet_address_you_want_to_track"; await Moralis.Streams.addAddress({address, id}) console.log("Fin") } streams()
The Moralis.Streams.add(options)
method uses the above-defined stream option to create a new stream. Next, the code uses const {id}
to fetch the new streamโs ID. Plus, it defines a wallet address to monitor. This is where you need to replace wallet_address_you_want_to_track
with an actual address.
The Moralis.Streams.addAddress
method uses your streamโs ID to assign the wallet address to it. Finally, the code logs Fin
once it completes all the previous steps.
To run your script, enter node index.js
. If you did everything according to the above instructions, you should see Fin
in your terminal:

Native Currency Example Transaction
Before you go and execute a native currency transaction for testing purposes, open your โExpress serverโ terminal. There, you should see an empty webhook initializing:

Now, use your MetaMask and transfer some โtestโ MATIC from or to the address you are monitoring. Once the transaction is confirmed, youโll be able to see the details of your test transaction in your terminal:

And that is how to monitor all ETH transfer transactions using Moralis Streams via its SDK!
What is Crypto Transaction Monitoring?
Whether you decide to track specific smart contracts or wallets, it all comes down to listening to real-time, on-chain transactions. And since transactions revolve around different activities, you have many options.
For instance, in the above tutorial, we first focused on ERC-20 transfers and then on native transfers. However, these are just two popular examples of on-chain events. There are several other on-chain events you can focus on. And all sorts of dapps can greatly benefit from using this sort of monitoring.

Best Crypto Transaction Monitoring Tool
As you probably know, on-chain data (for public blockchains) is available to anyone. However, in its raw format, this data is not useful. So, devs can either waste their time and resources by parsing the data themselves, or they can use excellent tools to do the work for them.
When it comes to monitoring crypto transactions, Moralisโ Streams API is the best tool. It allows devs to detect events as they occur, and it returns parsed data related to those events. Consequently, this saves dapp developers a ton of time and allows them to focus on creating the best UX instead.
Some of the core benefits of the Streams API tool include:
Cross-chain interoperability
User-friendliness (cross-platform interoperability)
Listening to crypto wallets and smart contracts
Speed and efficiency
Advanced filtering options
Accessible with a free account
Whatโs more, with this powerful tool in your corner, you also avoid:
Connecting and maintaining buggy RPC nodes
Building unnecessary abstractions
Wasting time building complex data pipelines
There are some devs who are still using ethers.js to listen to the blockchain and, in turn, miss out on all of the above benefits. If you are one of them, make sure to check out our ethers.js vs Web3 streams comparison.

How to Monitor All ETH Transfer Transactions โ Summary
In todayโs article, you had a chance to take on our example tutorial. Furthermore, we demonstrated two different paths to complete the feat regarding how to monitor ETH transfer transactions, including using Moralisโ admin UI or SDK.
In the first example, we focused on monitoring ERC-20 token transactions. However, in the SDK example, we focused on native currencies, which is the option youโd need to choose when focusing on ETH transfers. In both examples, we targeted Polygonโs testnet; however, the principles are the same for all supported EVM-compatible chains, including Ethereum.
So, make sure to use the knowledge obtained in this article to start monitoring on-chain activities without breaking a sweat or the bank!
Donโt forget to move beyond the โhow to monitor all ETH transfer transactionsโ challenge. After all, there are many other features you can incorporate into your killer dapps. Fortunately, for many Web3 features, you can avoid the trap of reinventing the wheel by using Moralisโ Web3 API fleet. The NFT API, Market Data API, Token API, Price API, and Auth API are some popular examples. Moreover, if you want to learn more about these powerful shortcuts, make sure to visit Moralisโ homepage and explore the โProductsโ menu option.
On the other hand, you may be new to crypto and need to learn more about dapp development first. In that case, we recommend diving into Moralisโ blog. Some of the latest topics there will help you learn about NFT marketplace development, the getLogs method, Web3 market data API, and much more. Nonetheless, you might be interested in taking a professional approach to your crypto education. In that case, consider enrolling in Moralis Academy.
Read More: moralis.io