<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: HassanHabibTahir</title>
    <description>The latest articles on DEV Community by HassanHabibTahir (@hassanhabibtahir).</description>
    <link>https://dev.to/hassanhabibtahir</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F745735%2Fe795c2ee-0024-49f1-90dd-05c1f4d4f4bc.jpg</url>
      <title>DEV Community: HassanHabibTahir</title>
      <link>https://dev.to/hassanhabibtahir</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hassanhabibtahir"/>
    <language>en</language>
    <item>
      <title>Build a Full Stack Chat App with Next.js, Node.js, Socket.io, PostgreSQL &amp; Tailwind CSS</title>
      <dc:creator>HassanHabibTahir</dc:creator>
      <pubDate>Sat, 26 Oct 2024 03:18:17 +0000</pubDate>
      <link>https://dev.to/hassanhabibtahir/build-a-full-stack-chat-app-with-nextjs-nodejs-socketio-postgresql-tailwind-css-4gc7</link>
      <guid>https://dev.to/hassanhabibtahir/build-a-full-stack-chat-app-with-nextjs-nodejs-socketio-postgresql-tailwind-css-4gc7</guid>
      <description>&lt;p&gt;🚀 Want to learn how to build a fully functional real-time chat app?&lt;/p&gt;

&lt;p&gt;Join me in this comprehensive tutorial where we'll create a full-stack chat application using cutting-edge technologies that are in high demand!&lt;/p&gt;

&lt;p&gt;What to Expect&lt;br&gt;
In this video, you’ll discover how to build a scalable, production-ready chat app with Next.js, Node.js, Socket.io, PostgreSQL, and Tailwind CSS. We’ll cover every step of the development process:&lt;/p&gt;

&lt;p&gt;Frontend Development: Set up Next.js with Tailwind CSS for a responsive and modern interface.&lt;br&gt;
State Management: Utilize Redux Toolkit and Redux Query for efficient state management.&lt;br&gt;
Backend Development: Build a robust Node.js backend with Prisma ORM and PostgreSQL database.&lt;br&gt;
Real-Time Messaging: Implement real-time communication using Socket.io.&lt;br&gt;
Form Handling: Manage forms and inputs seamlessly with React Hook Form.&lt;br&gt;
Project Structure: Learn how to structure and organize your TypeScript project for scalability.&lt;br&gt;
What You'll Gain&lt;br&gt;
Whether you're a beginner or an experienced developer, this tutorial is packed with valuable insights to enhance your full-stack development skills. You'll learn:&lt;/p&gt;

&lt;p&gt;How to implement user authentication.&lt;br&gt;
Best practices for optimizing app performance.&lt;br&gt;
Techniques for building high-performance applications.&lt;br&gt;
🔗&lt;a href="https://www.youtube.com/watch?v=JqvAhum30oQ&amp;amp;list=PLyOoRXNGNcjP46UPoYDdzMMVZ1yrJilJ4" rel="noopener noreferrer"&gt;CLICK HERE to get the full content!&lt;/a&gt; &lt;br&gt;
Join the Code Stream Channel, your go-to destination for programming tutorials and live coding sessions that will elevate your skills. Don't miss out—code along with us and take your development skills to the next level!&lt;/p&gt;

&lt;p&gt;Hashtags&lt;/p&gt;

&lt;h1&gt;
  
  
  ChatAppTutorial #Nextjs #Nodejs #Prisma #PostgreSQL #Socketio #TailwindCSS #ReduxToolkit #ReactHookForm #TypeScript #FullStackDevelopment #RealTimeChatApp #WebDevelopment #JavaScript #FrontendDevelopment #BackendDevelopment
&lt;/h1&gt;

</description>
    </item>
    <item>
      <title>Revalidate in nextjs</title>
      <dc:creator>HassanHabibTahir</dc:creator>
      <pubDate>Sat, 22 Apr 2023 15:28:36 +0000</pubDate>
      <link>https://dev.to/hassanhabibtahir/revalidate-in-nextjs-2jha</link>
      <guid>https://dev.to/hassanhabibtahir/revalidate-in-nextjs-2jha</guid>
      <description>&lt;p&gt;In the context of Next.js, revalidation refers to the process of updating the cache for a specific page or set of pages when new data becomes available.&lt;/p&gt;

&lt;p&gt;When a user visits a page on a Next.js site, the page is typically served from a cache instead of being generated on the server each time. This makes the site faster and more responsive. However, if the data that the page relies on changes frequently, it's important to update the cache so that users see the most up-to-date information.&lt;/p&gt;

&lt;p&gt;Next.js provides a few different options for configuring revalidation. One common approach is to use the getStaticProps function, which fetches data at build time and generates static pages. By default, Next.js will revalidate the cache every 10 seconds, but this can be adjusted with the revalidate option.&lt;/p&gt;

&lt;p&gt;Another approach is to use the getServerSideProps function, which fetches data at runtime instead of build time. In this case, the cache is updated on each request, so there's no need to specify a revalidation interval.&lt;/p&gt;

&lt;p&gt;Overall, revalidation in Next.js ensures that users are always seeing the most up-to-date information, while still taking advantage of the performance benefits of caching.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example to illustrate how revalidation works in Next.js&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let's say you're building a blog using Next.js, and you have a page that shows a list of the latest posts. You want to make sure that the list is always up-to-date, so you decide to use revalidation.&lt;/p&gt;

&lt;p&gt;First, you create a getStaticProps function for the page. This function fetches the latest blog posts from a database and returns them as props:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Head from 'next/head';
import axios from 'axios';


function Home({ news }) {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;Head&amp;gt;
        &amp;lt;title&amp;gt;Latest News&amp;lt;/title&amp;gt;
      &amp;lt;/Head&amp;gt;
      &amp;lt;h1&amp;gt;Latest News Headlines&amp;lt;/h1&amp;gt;
      &amp;lt;ul&amp;gt;
        {news.map((headline) =&amp;gt; (
          &amp;lt;li key={headline.id}&amp;gt;{headline.title}&amp;lt;/li&amp;gt;
        ))}
      &amp;lt;/ul&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export async function getStaticProps() {
const {data} = await axios.get('https://localhost:3000/api/news');
  return {
    props: {
      news:data,
    },
    // - When a request comes in
    // - At most once every 60 seconds
    revalidate: 60, // revalidate every 60 seconds
  };
}

export default Home;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Next.js fundamentals</title>
      <dc:creator>HassanHabibTahir</dc:creator>
      <pubDate>Fri, 21 Apr 2023 09:56:49 +0000</pubDate>
      <link>https://dev.to/hassanhabibtahir/nextjs-fundamentals-19ho</link>
      <guid>https://dev.to/hassanhabibtahir/nextjs-fundamentals-19ho</guid>
      <description>&lt;h2&gt;
  
  
  &lt;em&gt;Server-side rendering (SSR)&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;Next.js allows you to perform server-side rendering of your React components,which means that your pages are pre-rendered on the server and delivered as static HTML to the client.The HTML page is generated on the server for each request.&lt;br&gt;
React 18 and Next 12 introduce React server Components, Server completely rendered on the server and do not require client-side rendering.it can  degrade performance if it is heavy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export async function getServerSideProps(context) {
  const { id } = context.params
  const res = await fetch(`https://api.example.com/posts/${id}`)
  const post = await res.json()

  return {
    props: {
      post
    }
  }
}

function Post({ post }) {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;{post.title}&amp;lt;/h1&amp;gt;
      &amp;lt;p&amp;gt;{post.body}&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  )
}

export default Post

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Static site generation (SSG)
&lt;/h2&gt;

&lt;p&gt;Static Generation describes the process of compiling and rendering a website at build time.The output is a bunch of static files, including the HTML file itself and assets like JavaScript and CSS.&lt;br&gt;
With Static Generation, tools like Next.js try to render that page mostly like it would in the browser but at compile time. This gives us the ability to serve the entire content on first load.&lt;br&gt;
If you only use &lt;em&gt;*&lt;em&gt;getStaticProps *&lt;/em&gt;&lt;/em&gt; to fetch data, Next.js will fetch that data at build time, leaving you with a completely static page.&lt;br&gt;
&lt;em&gt;*&lt;em&gt;How to build a Next.js app&lt;br&gt;
*&lt;/em&gt;&lt;/em&gt;&lt;br&gt;
Now that we have our application available, let’s try to build it.&lt;br&gt;
npm run build&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import path from "path";
import fs from "fs/promises";
import { Fragment } from "react";
import { useRouter } from "next/router";
function ProductDetailPage(props: any) {
  const router = useRouter();
  const { loadedProduct } = props;
  if (router?.isFallback) {
    return &amp;lt;h2&amp;gt; page Not Found!&amp;lt;/h2&amp;gt;;
  }
  return (
    &amp;lt;Fragment&amp;gt;
      &amp;lt;h1&amp;gt;this is page&amp;lt;/h1&amp;gt;
      &amp;lt;h1&amp;gt;{loadedProduct?.title}&amp;lt;/h1&amp;gt;
      &amp;lt;h1&amp;gt;{loadedProduct?.description}&amp;lt;/h1&amp;gt;
    &amp;lt;/Fragment&amp;gt;
  );
}

async function getData() {
  const filePath = path.join(process.cwd(), "data", "dummy-data.json");
  const jsonData = await fs.readFile(filePath, "utf-8");
  const data = JSON.parse(jsonData);
  return data;
}

export async function getStaticProps(context: any) {
  const { params } = context;
  const productId = params.pid;
  const data = await getData();
  const product = data.products.find(
    (product: any) =&amp;gt; product.id === productId
  );
  if (product) {
    return {
      props: {
        loadedProduct: product || null,
      },
    };
  }
}

export async function getStaticPaths() {
  const data = await getData();
  const ids = data.products.map((product: any) =&amp;gt; product.id);
  const params = ids.map((id: string) =&amp;gt; ({ params: { pid: id } }));
  return {
    paths: params,
    fallback: false,
  };
}

export default ProductDetailPage;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Automatic code splitting
&lt;/h2&gt;

&lt;p&gt;Next.js splits your JavaScript into separate chunks for each route. When users load your application, Next.js only sends the code needed for the initial route.&lt;br&gt;
Next.js automatically performs code splitting by analyzing the application code and determining which parts of it are needed for each page. It then generates separate chunks of JavaScript for each page, so that each page only loads the code it needs.&lt;/p&gt;

&lt;p&gt;Overall, automatic code splitting is a powerful tool for optimizing the performance of a Next.js application, by reducing the initial load time and memory footprint of each page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// pages/index.js

export default function Home() {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;Welcome to my Next.js app!&amp;lt;/h1&amp;gt;
      &amp;lt;p&amp;gt;This is a simple example of a Next.js application.&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  )
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next.js provides a file-based routing system, which means that each file in the pages directory corresponds to a URL route in the application. For example, the index.js file corresponds to the root URL of the application (i.e. /).&lt;br&gt;
Here's an example of using an API route in Next.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// pages/api/hello.js

export default function handler(req, res) {
  res.status(200).json({ message: 'Hello from the API!' })
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;em&gt;Dynamic routing&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;Next.js supports dynamic routing, which allows you to create routes with parameters that can be accessed by pages and components.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// pages/posts/[id].js

import { useRouter } from 'next/router'

export default function Post() {
  const router = useRouter()
  const { id } = router.query

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;Post {id}&amp;lt;/h1&amp;gt;
      &amp;lt;p&amp;gt;This is the post with ID {id}&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  )
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we have a dynamic route for blog posts. The route is defined in a file called [id].js inside the pages/posts directory. The brackets around id indicate that this part of the URL is dynamic, and can be replaced with any value.&lt;br&gt;
When a user navigates to a URL that matches this route, Next.js will automatically route the request to this page and pass the value of id as a query parameter. We use the useRouter hook from Next.js to get access to the router object, and then we extract the id query parameter from the query object.&lt;br&gt;
Dynamic routing is a powerful feature of Next.js that allows you to build flexible and dynamic web applications.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;em&gt;Layouts&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;Next.js provides a way to define reusable layouts that can be used across multiple pages. This can help you avoid duplicating code and improve maintainability.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// components/Layout.js

import Head from 'next/head'

const Layout = ({ children }) =&amp;gt; {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;Head&amp;gt;
        &amp;lt;title&amp;gt;My Next.js App&amp;lt;/title&amp;gt;
        &amp;lt;link rel="icon" href="/favicon.ico" /&amp;gt;
      &amp;lt;/Head&amp;gt;
      &amp;lt;header&amp;gt;
        &amp;lt;nav&amp;gt;
          {/* navigation links */}
        &amp;lt;/nav&amp;gt;
      &amp;lt;/header&amp;gt;
      &amp;lt;main&amp;gt;
        {children}
      &amp;lt;/main&amp;gt;
      &amp;lt;footer&amp;gt;
        {/* footer content */}
      &amp;lt;/footer&amp;gt;
    &amp;lt;/div&amp;gt;
  )
}

export default Layout

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we define a Layout component that wraps around the content of each page. The component includes a header, navigation links, main content, and a footer. We also include a Head component from Next.js that sets the page title and favicon.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// pages/index.js

import Layout from '../components/Layout'

export default function Home() {
  return (
    &amp;lt;Layout&amp;gt;
      &amp;lt;h1&amp;gt;Welcome to my Next.js app!&amp;lt;/h1&amp;gt;
      &amp;lt;p&amp;gt;This is a simple example of a Next.js application.&amp;lt;/p&amp;gt;
    &amp;lt;/Layout&amp;gt;
  )
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we import the Layout component and wrap our page content (a heading and a paragraph) inside it. This ensures that the header, navigation, main content, and footer are consistent across all pages of the application.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;em&gt;API routes&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;API routes in Next.js provide a simple and easy way to create serverless functions that can handle API requests. Here's an example of how you can create an API route in Next.js.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// pages/api/hello.js
export default function handler(req, res) {
  res.status(200).json({ message: 'Hello from the API!' })
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we have created an API route that responds with a JSON object containing a message. The route is defined in a file called hello.js inside the pages/api.&lt;br&gt;
When a user makes a GET request to /api/hello, Next.js will automatically route the request to this page and invoke the handler function. The handler function takes two arguments: req (the incoming HTTP request) and res (the server response).&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Displaying NFTs on Ethereum</title>
      <dc:creator>HassanHabibTahir</dc:creator>
      <pubDate>Sun, 09 Apr 2023 03:36:55 +0000</pubDate>
      <link>https://dev.to/hassanhabibtahir/displaying-nfts-on-ethereum-17o8</link>
      <guid>https://dev.to/hassanhabibtahir/displaying-nfts-on-ethereum-17o8</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bGCi1TSI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gvsrimg3mtn6iqwlh9rl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bGCi1TSI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gvsrimg3mtn6iqwlh9rl.png" alt="Image description" width="460" height="752"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you have automatic NFT detection enabled, MetaMask will automatically fetch any NFTs you have on Ethereum.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xcZ1j6z7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5zkq23bnjam44hwcgv6l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xcZ1j6z7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5zkq23bnjam44hwcgv6l.png" alt="Image description" width="460" height="752"&gt;&lt;/a&gt;&lt;br&gt;
If you're on Ethereum mainnet and have NFT autodetect turned on, head to the 'NFTs' tab on your homepage. MetaMask will automatically display any detected NFTs.&lt;/p&gt;

&lt;p&gt;If you don't have NFT detection turned on, you'll see a prompt under the NFTs tab that will take you to Settings &amp;gt; Experimental to turn it on. Head there to toggle it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c4O7TGbY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ro5rartnjb5xbdyfpts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c4O7TGbY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ro5rartnjb5xbdyfpts.png" alt="Image description" width="394" height="576"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding NFTs manually
&lt;/h2&gt;

&lt;p&gt;In some cases, you may want to add an NFT manually. This could be, for example, because you have NFTs on EVM-compatible chains that MetaMask supports like Polygon ,Ethereum.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SH-0Z5mX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qm9e3ov2xfzy4epa9apq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SH-0Z5mX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qm9e3ov2xfzy4epa9apq.png" alt="Image description" width="446" height="748"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3pFUDudL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5d7xzmbsjaiz3nuwzccd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3pFUDudL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5d7xzmbsjaiz3nuwzccd.png" alt="Image description" width="450" height="747"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>BigNumbers</title>
      <dc:creator>HassanHabibTahir</dc:creator>
      <pubDate>Sat, 01 Apr 2023 07:54:22 +0000</pubDate>
      <link>https://dev.to/hassanhabibtahir/bignumbers-kka</link>
      <guid>https://dev.to/hassanhabibtahir/bignumbers-kka</guid>
      <description>&lt;p&gt;&lt;em&gt;BigNumber is an object which safely allows mathematical operations on numbers of any magnitude&lt;/em&gt;&lt;br&gt;
uint256 has a range from 0 to (2^256) - 1. Therefore, the maximum number that can be held by the uint256 datatype is astronomically large.&lt;br&gt;
Specifically, the maximum value for uint256 is:&lt;br&gt;
115792089237316195423570985008687907853269984665640564039457584007913129639935&lt;/p&gt;

&lt;p&gt;In &lt;em&gt;Javascript's number data type has a significantly smaller upper limit.&lt;br&gt;
Specifically, the maximum value of a numeric type that Javascript can hold is just&lt;/em&gt; (9007199254740991);&lt;/p&gt;

&lt;p&gt;If that number is greater than Javascript's maximum numeric value, which is quite definitely possible, then what happens?&lt;br&gt;
Javascript can not support that. Therefore, we have to use a special type called a BigNumber.&lt;br&gt;
ibraries used for interacting with Ethereum nodes - ethers.js and web3.js - both come with support for BigNumbers.&lt;/p&gt;

&lt;p&gt;BigNumber is a custom class library, written in Javascript, that introduces it's own functions for mathematical functions - add, sub, mul, div, etc. BigNumber has a significantly larger capacity for numbers than what Javascript can natively support.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Ethereum Transaction Gas Fee</title>
      <dc:creator>HassanHabibTahir</dc:creator>
      <pubDate>Fri, 31 Mar 2023 04:18:05 +0000</pubDate>
      <link>https://dev.to/hassanhabibtahir/ethereum-transaction-gas-fee-36no</link>
      <guid>https://dev.to/hassanhabibtahir/ethereum-transaction-gas-fee-36no</guid>
      <description>&lt;h2&gt;
  
  
  Gas
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Gas is the fuel of the Ethereum blockchain network. Gas is always paid in ether, Gas is the transaction fee paid to miners for executing and adding your transaction into the Ethereum blockchain. For every transaction you have to specify the value of the gas price and the gas limit, you want to set. Based on these values, the network calculates how much of a fee you are willing to pay for the transaction.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Gas Limit
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;The gas limit is the maximum unit of gas your transaction may take, in order to be executed on the Ethereum blockchain.If your transaction takes less gas, then the extra gas that you have provided will be refunded back to your wallet. If your transaction consumes all the gas and requires more gas to be executed, your transaction will fail, and gas will be consumed as part of the transaction fees.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Gas price
&lt;/h2&gt;

&lt;p&gt;_The gas price is the price per gas unit you are willing to pay for executing your transaction. The unit of gas price is always defined in gwei. According to your gas price, miners decide to process your transaction. If the transaction has a higher gas price, there is a chance that your transaction will be processed early. If your gas price is low, then your transaction might be processed after a delay or when the blockchain is free to process low-gas-price transactions.&lt;br&gt;
_&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;_ From | 0x2001152bd1cc1d37d7c0d25cd10315351b45b4a6&lt;br&gt;
To | 0x0587db0883defe769b49b78c11bdcc2f1f38b484&lt;br&gt;
gas limit| 424843&lt;br&gt;
gas price| 0.0000000.1(10 gwei)&lt;br&gt;
gas(used) = 21000;&lt;/p&gt;

&lt;p&gt;TxFee (max) = gas limit * gas Price;&lt;br&gt;
TxFee(paid) = gas(used)*GasPrice;&lt;br&gt;
TxFee(Returned)= TxFee (max) -TxFee(paid);&lt;br&gt;
TxFee (max) = 424843 * 0.00000001 =0.00424843;&lt;br&gt;
TxFee = 21000*0.00000001=0.00021;&lt;br&gt;
TxFee(Returned) = 0.00424843-0.00021=0.00403843 _&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
