DeveloperBreeze

Blockchain Development Programming Tutorials, Guides & Best Practices

Explore 30+ expertly crafted blockchain development tutorials, components, and code examples. Stay productive and build faster with proven implementation strategies and design patterns from DeveloperBreeze.

How to Query ERC-20 Token Balances and Transactions Using Ethers.js and Etherscan API

Tutorial October 24, 2024

npm install ethers
npm install axios

In this step, we will use Ethers.js to query the balance of an ERC-20 token for a specific Ethereum address.

Understanding and Using the Etherscan API to Query Blockchain Data

Tutorial October 24, 2024

const axios = require('axios');

// Replace this with your actual Etherscan API key
const apiKey = 'YOUR_ETHERSCAN_API_KEY';

// Replace this with the transaction hash you want to query
const transactionHash = '0xYourTransactionHash';

// Etherscan API URL to fetch transaction details
const url = `https://api.etherscan.io/api?module=proxy&action=eth_getTransactionByHash&txhash=${transactionHash}&apikey=${apiKey}`;

async function getTransactionDetails() {
  try {
    // Make the API request to Etherscan
    const response = await axios.get(url);
    const transactionDetails = response.data.result;

    // Log the transaction details
    console.log('Transaction Details:', transactionDetails);
  } catch (error) {
    console.error('Error fetching transaction details:', error);
  }
}

// Call the function to get the transaction details
getTransactionDetails();
  • Replace 'YOUR_ETHERSCAN_API_KEY' with your actual Etherscan API key.
  • Replace '0xYourTransactionHash' with the transaction hash you want to query.
  • This script uses the eth_getTransactionByHash endpoint to fetch transaction details, such as gas price, block number, and sender/receiver addresses.

Getting Wallet Balance Using Ethers.js in Node.js

Tutorial October 24, 2024

  • Node.js installed on your machine.
  • Basic understanding of JavaScript.
  • An Ethereum wallet (with private key or mnemonic phrase).
  • (Optional) An Infura account to access the Ethereum network.

First, you need to install Ethers.js, a library for interacting with the Ethereum blockchain.

Understanding 0x000000000000000000000000000000000000dead Address and Token Burns in Ethereum

Tutorial October 24, 2024

Burning tokens refers to the process of sending cryptocurrency tokens to an address from which they cannot be retrieved. Tokens sent to this address are effectively removed from circulation forever. The address ends with "dead," signaling its purpose of making tokens unreachable.

Token burns serve several key purposes in the cryptocurrency world:

Tracking Solana Address for New Trades and Amounts

Tutorial August 09, 2024
javascript nodejs

  • Node.js and npm installed on your system.
  • Basic knowledge of JavaScript and Solana.
  • A Solana wallet address you wish to track.

Step 1: Set Up Your Project