<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[kabugu]]></title><description><![CDATA[kabugu]]></description><link>https://abdulkabugu.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Mon, 31 Aug 2026 06:04:25 GMT</lastBuildDate><atom:link href="https://abdulkabugu.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to Achieve Seamless Wallet Integration in Your Polkadot dApps with Polconnect]]></title><description><![CDATA[Polconnect is the React library for connecting Polkadot wallets and managing connected chains, as well as fetching connected user information like user balances, user addresses, etc. focused on making life easy for Developers and ensuring a stellar U...]]></description><link>https://abdulkabugu.hashnode.dev/how-to-achieve-seamless-wallet-integration-in-your-polkadot-dapps-with-polconnect</link><guid isPermaLink="true">https://abdulkabugu.hashnode.dev/how-to-achieve-seamless-wallet-integration-in-your-polkadot-dapps-with-polconnect</guid><category><![CDATA[polkadot]]></category><category><![CDATA[Kusama]]></category><category><![CDATA[React]]></category><category><![CDATA[library]]></category><category><![CDATA[connect-polkadot wallet]]></category><dc:creator><![CDATA[abdul kabugu]]></dc:creator><pubDate>Mon, 09 Oct 2023 11:25:32 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1696829501843/385b8699-9f2f-49a6-be77-01c677c86886.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a target="_blank" href="https://www.npmjs.com/package/polconnect">Polconnect</a> is the React library for connecting Polkadot wallets and managing connected chains, as well as fetching connected user information like user balances, user addresses, etc. focused on making life easy for Developers and ensuring a stellar UX for end-users</p>
<p>Imagine this: With just one simple line of code, your users gain the ability to effortlessly select their preferred wallet for connection. It might sound unbelievable, but it's entirely achievable.</p>
<p>In this technical tutorial, I'll show you how to add a <strong>'connect wallet '</strong> feature to your polkadot Dapp</p>
<h2 id="heading-behold-this-is-our-end-result">Behold, this is our end result</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696748550796/e97f07bd-956f-4261-a835-bdbe32fef405.gif" alt class="image--center mx-auto" /></p>
<h3 id="heading-here-is-what-you-need-to-follow-along">Here is what you need to follow along</h3>
<ul>
<li><p>Basic understanding of reactjs and nextjs</p>
</li>
<li><p>Basic understanding of tailwind CSS</p>
</li>
<li><p>Initialize new NextJs project with tailwind CSS</p>
</li>
</ul>
<p>In this tutorial, we will be using Tailwind CSS for styling and I assume you have a basic understanding of Tailwind CSS</p>
<h3 id="heading-lets-start-coding">Let's start coding 👨‍💻</h3>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://media.giphy.com/media/umYMU8G2ixG5mJBDo5/giphy.gif">https://media.giphy.com/media/umYMU8G2ixG5mJBDo5/giphy.gif</a></div>
<p> </p>
<p>After initializing the new NextJs project</p>
<p>We also need to install two additional packages, <strong>polconnect</strong> and <strong>polkadot/api</strong></p>
<pre><code class="lang-typescript"><span class="hljs-comment">// run the command </span>
 yarn add polconnect <span class="hljs-meta">@polkadot</span>/api
</code></pre>
<h3 id="heading-polconnect-setup">Polconnect setup</h3>
<p>First of all, we have to wrap our application inside <strong>PolkitProvider</strong></p>
<pre><code class="lang-typescript"><span class="hljs-comment">//  anviagate to  src/pages/_app.tsx</span>
</code></pre>
<pre><code class="lang-typescript"><span class="hljs-comment">// _app.tsx</span>

<span class="hljs-keyword">import</span> <span class="hljs-string">'@/styles/globals.css'</span>
<span class="hljs-keyword">import</span> <span class="hljs-keyword">type</span> { AppProps } <span class="hljs-keyword">from</span> <span class="hljs-string">'next/app'</span>
<span class="hljs-comment">// import polkitProvider  from polconnect</span>
<span class="hljs-comment">// and import import  chain  you can import any supported chain but for  this  demo  we will use astar network as default chain</span>

<span class="hljs-comment">// The  polkitProvider takes 3 parameters </span>
<span class="hljs-comment">// 1 - defaultChain: this  is the chain will be initialized by default</span>
<span class="hljs-comment">// 2- theme : you  can used  dark theme or light theme </span>
<span class="hljs-comment">// 3- appName : it's  your application name </span>

<span class="hljs-keyword">import</span> { PolkitProvider, astar } <span class="hljs-keyword">from</span> <span class="hljs-string">'polconnect'</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params">{ Component, pageProps }: AppProps</span>) </span>{
  <span class="hljs-keyword">return</span> (
  &lt;PolkitProvider defaultChain={astar} theme=<span class="hljs-string">'light'</span> appName=<span class="hljs-string">'testing app'</span>&gt;
    &lt;Component {...pageProps} /&gt;
  &lt;/PolkitProvider&gt;
  ) 
}
</code></pre>
<p>Everything is good so now we have completed polconnect setup, the next step is to create a <strong>component</strong> folder in the <strong>src</strong> directory</p>
<p>inside the component folder, create a new file called <strong>Navbar.tsx</strong></p>
<p>This is the file where we will add the <strong>connect wallet</strong> button</p>
<p><strong>File</strong>: <em>/Navbar.tsx</em></p>
<pre><code class="lang-typescript"><span class="hljs-comment">// Navbar.tsx</span>

<span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span>
<span class="hljs-comment">// Import connectButton from polconnect</span>

<span class="hljs-comment">// the  ConnectButton component  takes  theree  props</span>
<span class="hljs-comment">// 1- labels : this  is the label of your button  you can choose any text you want  like  'connect wallet' / 'sign in' etc</span>
<span class="hljs-comment">// 2 - backGround : this  is the background of your  button</span>
<span class="hljs-comment">//3 showChain : this is option to choose  if you want to dispaly  switch or connected chain  it takes bolean value </span>

<span class="hljs-keyword">import</span> {ConnectButton} <span class="hljs-keyword">from</span> <span class="hljs-string">'polconnect'</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">Navbar</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> (
    &lt;div className=<span class="hljs-string">'h-[60px] border-b border-pink-600 flex justify-between  w-screen items-center px-3'</span>&gt;
         &lt;h1&gt;PolconnectKit Demo 👽&lt;/h1&gt;
        &lt;ConnectButton  label=<span class="hljs-string">'connect wallet'</span> backGround=<span class="hljs-string">'blue'</span> showChain={<span class="hljs-literal">true</span>}  /&gt;
    &lt;/div&gt;
  )
}
</code></pre>
<p>Now let's open our project and see what we are working on by running <em>yarn dev and</em> opening our site on <a target="_blank" href="http://localhost:3000/">http://localhost:3000/</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696750197001/dd5bc234-dee3-42da-acc0-308cf23e4da7.gif" alt class="image--center mx-auto" /></p>
<p>Now looks good we can connect the wallet disconnect the wallet and switch networks but believe it or not we're not finished yet 😎</p>
<p>Imagine a situation where you want to check whether a wallet has been connected or not yet. For example, if you want to restrict page access to only connected users, <strong>polconnect</strong> exports another hook called <strong>usePolkit</strong> Let's write code to understand how it works</p>
<p><strong>File</strong>: src/index.ts</p>
<p>I will start by designing it a little bit; see the code below</p>
<pre><code class="lang-typescript"><span class="hljs-comment">//  we improved the style of the hero section  </span>
<span class="hljs-comment">// now  all elements inside the  hero section is vertically and  horisontally  centered </span>

<span class="hljs-keyword">import</span> Image <span class="hljs-keyword">from</span> <span class="hljs-string">'next/image'</span>
<span class="hljs-keyword">import</span> { Inter } <span class="hljs-keyword">from</span> <span class="hljs-string">'next/font/google'</span>
<span class="hljs-keyword">import</span> Navbar <span class="hljs-keyword">from</span> <span class="hljs-string">'@/components/Navbar'</span>

<span class="hljs-keyword">const</span> inter = Inter({ subsets: [<span class="hljs-string">'latin'</span>] })

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">Home</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> (
    &lt;main
      className={<span class="hljs-string">`flex min-h-screen flex-col items-center  <span class="hljs-subst">${inter.className}</span>`</span>}
    &gt;

      &lt;div&gt;
        &lt;Navbar /&gt;
      &lt;/div&gt;

      &lt;div className=<span class="hljs-string">'h-screen flex  w-screen justify-center items-center '</span>&gt;
        Hellow 
      &lt;/div&gt;
    &lt;/main&gt;
  )
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696714007607/fdd0ce7d-945d-4310-863c-72ae2b9de814.png" alt class="image--center mx-auto" /></p>
<p>as you can see, the Hellow paragraph is centered</p>
<p>Instead of displaying hellow text, we will display text conditionally if the user has connected the wallet We will display, '<strong>Hey man, You have connected the Wallet</strong></p>
<p>and if the user has not connected to a wallet, we will display the text, '<strong>Please connect your wallet first to see magic'</strong></p>
<p>File: <em>/index.tsx</em></p>
<p>let's start by importing <strong>usePolkit</strong> hook from <strong>'polconnect'</strong></p>
<pre><code class="lang-typescript"><span class="hljs-comment">// index.tsx</span>
<span class="hljs-keyword">import</span>  {usePolkit} <span class="hljs-keyword">from</span> <span class="hljs-string">'polconnect'</span>
<span class="hljs-comment">// Step 2: Retrieve the isConnected value from the usePolkit hook.</span>
  <span class="hljs-keyword">const</span> {isConnected} = usePolkit()
</code></pre>
<p>Now let's use <strong>isConnected</strong> to render text conditionally</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">import</span> Image <span class="hljs-keyword">from</span> <span class="hljs-string">'next/image'</span>
<span class="hljs-keyword">import</span> { Inter } <span class="hljs-keyword">from</span> <span class="hljs-string">'next/font/google'</span>
<span class="hljs-keyword">import</span> Navbar <span class="hljs-keyword">from</span> <span class="hljs-string">'@/components/Navbar'</span>
<span class="hljs-comment">// imported usepolkit from polconnect</span>
<span class="hljs-keyword">import</span>  {usePolkit} <span class="hljs-keyword">from</span> <span class="hljs-string">'polconnect'</span>
<span class="hljs-keyword">const</span> inter = Inter({ subsets: [<span class="hljs-string">'latin'</span>] })

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">Home</span>(<span class="hljs-params"></span>) </span>{
<span class="hljs-comment">// distructure 'isConnected' from uspolkit() hook</span>
  <span class="hljs-keyword">const</span> {isConnected} = usePolkit()
  <span class="hljs-keyword">return</span> (
    &lt;main
      className={<span class="hljs-string">`flex min-h-screen flex-col items-center  <span class="hljs-subst">${inter.className}</span>`</span>}
    &gt;
      &lt;div&gt;
        &lt;Navbar /&gt;
      &lt;/div&gt;

      &lt;div className=<span class="hljs-string">'h-screen flex  w-screen justify-center items-center '</span>&gt;
         {isConnected  ? (
          &lt;h1 className=<span class="hljs-string">'text-2xl font-semibold'</span>&gt;Hey man, You have  connected the Wallet&lt;/h1&gt;
         ) : (
          &lt;h1 className=<span class="hljs-string">'text-2xl font-semibold'</span>&gt;Please connect your  wallet first to see magic&lt;/h1&gt;
         )}
      &lt;/div&gt;
    &lt;/main&gt;
  )
}
</code></pre>
<p>Now let's open our site on <a target="_blank" href="http://localhost:3000/">http://localhost:3000/</a> to see changes</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696747270685/61c43a39-1672-47d0-a133-f30ccd67dc4f.gif" alt class="image--center mx-auto" /></p>
<p>usePolkit hook returns so many useful methods We're not going to talk about all methods in this tutorial; I wanted to make it short and straightforward</p>
<p>We have come to an end. I'm grateful for your time and attention If you have any questions, leave a comment I'll be active in answering all questions</p>
]]></content:encoded></item><item><title><![CDATA[What is Filecoin Virtual Machine and  how  it  differs  from  Ethereum virtual machine]]></title><description><![CDATA[Filecoin EVM (FEVM) is a modification of the Ethereum Virtual Machine (EVM) that is optimized for use with the Filecoin network. The key difference between FEVM and EVM is that FEVM is designed to work with data storage and retrieval, whereas EVM is ...]]></description><link>https://abdulkabugu.hashnode.dev/what-is-filecoin-virtual-machine-and-how-it-differs-from-ethereum-virtual-machine</link><guid isPermaLink="true">https://abdulkabugu.hashnode.dev/what-is-filecoin-virtual-machine-and-how-it-differs-from-ethereum-virtual-machine</guid><category><![CDATA[Blockchain]]></category><category><![CDATA[EVM]]></category><category><![CDATA[filecoin]]></category><category><![CDATA[fevm]]></category><dc:creator><![CDATA[abdul kabugu]]></dc:creator><pubDate>Mon, 30 Jan 2023 20:41:54 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1675110949792/d86f56df-f9c8-4cff-ba08-be22593237ff.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p> Filecoin EVM (FEVM) is a modification of the Ethereum Virtual Machine (EVM) that is optimized for use with the Filecoin network. The key difference between FEVM and EVM is that FEVM is designed to work with data storage and retrieval, whereas EVM is primarily used for smart contract execution.</p>
<p>Here's a simple example to understand the differences between EVM and FEVM</p>
<p>Ethereum's EVM is like a calculator that can do math problems.</p>
<p>Filecoin EVM is like a calculator that can do math problems, but it can also store and retrieve files.</p>
<p> It is like a computer that can store and retrieve files and solve math problems!</p>
]]></content:encoded></item></channel></rss>