<?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: Sharathxct</title>
    <description>The latest articles on DEV Community by Sharathxct (@sharathxct_19).</description>
    <link>https://dev.to/sharathxct_19</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%2F2023825%2Fd25b5d54-c8b3-4ebf-84e4-2b5c82466df1.jpeg</url>
      <title>DEV Community: Sharathxct</title>
      <link>https://dev.to/sharathxct_19</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sharathxct_19"/>
    <language>en</language>
    <item>
      <title>Solana: Wallet adapter for a web based wallet</title>
      <dc:creator>Sharathxct</dc:creator>
      <pubDate>Wed, 04 Sep 2024 03:09:16 +0000</pubDate>
      <link>https://dev.to/sharathxct_19/solana-wallet-adapter-for-a-web-based-wallet-1b9f</link>
      <guid>https://dev.to/sharathxct_19/solana-wallet-adapter-for-a-web-based-wallet-1b9f</guid>
      <description>&lt;h2&gt;
  
  
  Working of my project wallet adapter for a web based wallet app which is a submission for 100xdev x Superteam hackathon.
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Overview of my web based wallet
&lt;/h3&gt;

&lt;p&gt;My wallet is a nextjs web app (Not extension), where users can create their solana wallet by logging in using google, a wallet automatically gets generated for the user after logging in and user can access the wallet only if they are signed in.&lt;a href="https://dallet-one.vercel.app/" rel="noopener noreferrer"&gt;Live&lt;/a&gt;, &lt;a href="https://github.com/Sharathxct/dallet/tree/main/apps/dallet" rel="noopener noreferrer"&gt;Github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;NOTE: Private keys are stored on the server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmuj88izipvdk4ecvjvho.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmuj88izipvdk4ecvjvho.png" alt="Wallet homepage" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Working of my wallet adapter
&lt;/h3&gt;

&lt;p&gt;My wallet adapter is an npm package which will be integrated by dapps to connect to my wallet, this basically exports my WalletAdapter class which extends BaseSignInMessageSignerWalletAdapter which contains the methods to perform connect, signTransaction etc. Go through &lt;a href="https://github.com/anza-xyz/wallet-adapter" rel="noopener noreferrer"&gt;solana walletadapter standard&lt;/a&gt; to know more. As my wallet now is web app and cannot inject code into other websites unlike web extension, I need to figure out how to make a communication connection between my wallet and the Solana dapps so that I do not give dapps the whole access to wallet instead make them just able to request connection or request signing of transaction etc.&lt;/p&gt;

&lt;p&gt;After researching a bit I found this open source repository &lt;a href="https://github.com/torusresearch/solana-embed" rel="noopener noreferrer"&gt;torus solana embed&lt;/a&gt; it uses a popup window to open their wallet in the window and take input from user if the user wants to approve or reject the request made by dapp client and now my question was how the wallet communicates with the dapp if user approved or rejected? then I found out about window.postMessage(). Parent window and window popups and iframes can communicate in real time using postMessage() method.&lt;/p&gt;

&lt;p&gt;First i tried to implement iframe method then found out google login from iframe is not possible then implemented window popup and it worked. &lt;/p&gt;

&lt;p&gt;Take a look at the live working example of how dapps can connect to my wallet &lt;a href="https://example-nextjs-dallet-connect.vercel.app/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Thank you Harkirat sir for 100xdevs, web3 cohort and the guidance.
&lt;/h3&gt;

</description>
      <category>100xdevs</category>
      <category>superteam</category>
      <category>solana</category>
    </item>
  </channel>
</rss>
