1 min read
Upgrade Your Data Streaming
Streams is our next-generation blockchain data product, offering robust filtering, access to real-time and historical data, reorg handling, and expanded destination options.
Try Streams today. Start with our step-by-step guides or dive deeper into the documentation for more information.
In this video, we will set up a QuickAlert for ENS Domain registrations and get notified via email with the help of Pipedream.
Subscribe to our YouTube channel for more videos!Subscribe
The following code example includes the QuickAlerts expression for ENS Domain registrations, as seen in the video.
Expression
1tx_logs_topic0 == '0xca6abbe9d7f11422cb6ca7629fbf6fe9efb1c621f71ce8f02b9f2a230097404f'
Following is the code added to Pipedream in the video.
import Web3 from 'web3';
export default defineComponent({
async run({ steps, $ }) {
const domainsData = [];
steps.trigger.event.forEach(e => {
domainsData.push(e.logs[8].data);
})
const dataArray = domainsData.map(domain => Web3.utils.hexToAscii('0x' + domain.substr(-128)));
let emailString = 'New ENS domain(s) registered:\n';
dataArray.forEach(d => {
emailString += (domain + '\n, ');
})
return emailString;
},
})
We ❤️ Feedback!
Let us know if you have any feedback or requests for new topics. We'd love to hear from you.