<?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: cryptorustacean.com</title>
    <description>The latest articles on DEV Community by cryptorustacean.com (@cryptorustacean).</description>
    <link>https://dev.to/cryptorustacean</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%2F702763%2F0a8d41ce-b1af-4f4e-bfcc-f3c85a39057e.png</url>
      <title>DEV Community: cryptorustacean.com</title>
      <link>https://dev.to/cryptorustacean</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cryptorustacean"/>
    <language>en</language>
    <item>
      <title>Connecting the Phantom wallet to Your Project</title>
      <dc:creator>cryptorustacean.com</dc:creator>
      <pubDate>Thu, 23 Sep 2021 00:00:00 +0000</pubDate>
      <link>https://dev.to/cryptorustacean/connecting-the-phantom-wallet-to-your-project-3m67</link>
      <guid>https://dev.to/cryptorustacean/connecting-the-phantom-wallet-to-your-project-3m67</guid>
      <description>&lt;p&gt;I'll be honest. I had some preconceived notions about how hard it would be to connect a crypto wallet to my web app, but after having done it, I can really say how surprisingly simple it is.&lt;/p&gt;

&lt;p&gt;First off, I'll be using &lt;a href="https://nextjs.org/"&gt;NextJS&lt;/a&gt; but you can very easily use this tutorial to add Phantom to any web app, be it a front-end or an MVC framework.&lt;/p&gt;

&lt;p&gt;Let's create our application with &lt;code&gt;npx create-next-app --typescript -e with-tailwindcss phantom-wallet-example&lt;/code&gt;. For my particular app, I'll be using &lt;a href="https://www.typescriptlang.org/"&gt;TypeScript&lt;/a&gt; and &lt;a href="https://tailwindcss.com/"&gt;TailwindCSS&lt;/a&gt;, so I'll add those dependencies right when I create the app.&lt;/p&gt;

&lt;p&gt;I'll rename my &lt;code&gt;pages/index.js&lt;/code&gt; and &lt;code&gt;pages/_app.js&lt;/code&gt; files to &lt;code&gt;pages/index.tsx&lt;/code&gt; and &lt;code&gt;pages._app.tsx&lt;/code&gt; respectively.&lt;/p&gt;

&lt;p&gt;Now, if I run &lt;code&gt;npm run dev&lt;/code&gt; from the console, NextJS will be helpful and tell you to install some dev dependencies. Let's go do that now with &lt;code&gt;npm i -D typescript @types/react&lt;/code&gt;. After installing these dependencies, run &lt;code&gt;npm run dev&lt;/code&gt; again and NextJS will create a &lt;code&gt;tsconfig.json&lt;/code&gt; file for us and start the dev server.&lt;/p&gt;

&lt;p&gt;Now, let's first think of what we want to show on the screen. If the browser doesn't have a Phantom wallet extension, we want to display a link to the Phantom website so user can add the extension. If the user has an extension, we either want to ask if they want to connect their wallet if they aren't already connected or disconnect if they are already connected.&lt;/p&gt;

&lt;p&gt;Let's start with the first state (the link to the Phantom website). First, create the file &lt;code&gt;components/ConnectToPhantom.tsx&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ConnectToPhantom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;
      &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"https://phantom.app/"&lt;/span&gt;
      &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"_blank"&lt;/span&gt;
      &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"bg-purple-500 px-4 py-2 border border-transparent rounded-md text-base font-medium text-white"&lt;/span&gt;
    &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      Get Phantom
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;ConnectToPhantom&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Taking a look at the &lt;a href="https://docs.phantom.app/integrating/detecting-the-provider"&gt;documentation&lt;/a&gt;, looks like we can access the Phantom on the &lt;code&gt;window&lt;/code&gt; object. This makes things much simpler than having to use the &lt;a href="https://github.com/solana-labs/wallet-adapter"&gt;wallet adapter&lt;/a&gt; from Solana Labs. Obviously, if you need to integrate all these wallets, it's probably good to use it, but if you're only supporting Phantom, you don't need it.&lt;/p&gt;

&lt;p&gt;Now let's first set the state of whether we detect the &lt;code&gt;solana&lt;/code&gt; object on &lt;code&gt;window&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Phantom&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ConnectToPhantom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;phantom&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setPhantom&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Phantom&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;solana&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]?.&lt;/span&gt;&lt;span class="nx"&gt;isPhantom&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;setPhantom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;solana&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Here we are initializing &lt;code&gt;phantom&lt;/code&gt; to null, but upon mounting of the component, we want to see if &lt;code&gt;window&lt;/code&gt; has a property named &lt;code&gt;solana&lt;/code&gt;. If it does, then we check if its &lt;code&gt;isPhantom&lt;/code&gt; property is truthy. If it is, we'll set the state of &lt;code&gt;phantom&lt;/code&gt; with &lt;code&gt;setPhantom&lt;/code&gt; &lt;a href="https://reactjs.org/docs/hooks-reference.html#usestate"&gt;dispatch&lt;/a&gt; function. This all happens in the &lt;code&gt;useEffect&lt;/code&gt; React hook. The second parameter here is an empty array, so this callback only runs when the component is first mounted.&lt;/p&gt;

&lt;p&gt;Once we have the Phantom provider, we want to display a button to either connect to the user wallet.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;  &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;phantom&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;
        &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;connectHandler&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"bg-purple-500 py-2 px-4 border border-transparent rounded-md text-sm font-medium text-white whitespace-nowrap hover:bg-opacity-75"&lt;/span&gt;
      &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        Connect to Phantom
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;In order to connect to the wallet, we'll use the &lt;code&gt;connect&lt;/code&gt; method on &lt;code&gt;phantom&lt;/code&gt; and we'll wrap it all in a click event handler for the &lt;code&gt;Connect to Phantom&lt;/code&gt; button.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Phantom&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ConnectToPhantom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;connectHandler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;phantom&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Now that we can connect, let's handle the state for when we're already connected. We'll want the user to be able to disconnect. We'll also want it to be visually distinct from the disconnected state.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Event&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;connect&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;disconnect&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Phantom&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ConnectToPhantom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;connected&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setConnected&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;phantom&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;connect&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;setConnected&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nx"&gt;phantom&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;disconnect&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;setConnected&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;phantom&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;The state of &lt;code&gt;connected&lt;/code&gt; will determine what the button looks like and what it says. We can take advantage event emitter provided by Phantom for this. If a &lt;code&gt;"connect"&lt;/code&gt; event is emitted, we'll set &lt;code&gt;connected&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;. If a &lt;code&gt;"disconnect"&lt;/code&gt; event is emitted, we'll set &lt;code&gt;connected&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt;. Here, we are using another &lt;code&gt;useEffect&lt;/code&gt; that will trigger once the &lt;code&gt;phantom&lt;/code&gt; variable is set. Then we tell the event handlers what to do in either case ("connect" or "disconnect").&lt;/p&gt;

&lt;p&gt;Now let's add the button to disconnect the wallet (shown only in a connected state):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;phantom&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;connected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;
          &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;disconnectHandler&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
          &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"py-2 px-4 border border-purple-700 rounded-md text-sm font-medium text-purple-700 whitespace-nowrap hover:bg-purple-200"&lt;/span&gt;
        &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
          Disconnect from Phantom
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;We will employ the &lt;code&gt;disconnect&lt;/code&gt; method on &lt;code&gt;phantom&lt;/code&gt; to disconnect the wallet. Since we already have the event handlers set for both &lt;code&gt;"connect"&lt;/code&gt; and &lt;code&gt;"disconnect"&lt;/code&gt;, the UI state should change once those events fire.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Phantom&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="nx"&gt;disconnect&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ConnectToPhantom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;disconnectHandler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;phantom&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;disconnect&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Now let's stick this component on the index page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;ConnectToPhantom&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../components/ConnectToPhantom&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;Home&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"h-screen flex items-center justify-center"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ConnectToPhantom&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Now that we have a functional component, I'll leave it to you to do some cleanup to refactor some of the code it you'd like. Also, Phantom provides &lt;a href="https://docs.phantom.app/resources/assets"&gt;logos and assets&lt;/a&gt; for you to use in your project.&lt;/p&gt;

&lt;p&gt;Feel free to check out the complete project on &lt;a href="https://github.com/cryptorustacean/phantom-wallet-example"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>react</category>
      <category>nextjs</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>A Beginner's Survey of the Solana Ecosystem</title>
      <dc:creator>cryptorustacean.com</dc:creator>
      <pubDate>Tue, 14 Sep 2021 00:00:00 +0000</pubDate>
      <link>https://dev.to/cryptorustacean/a-beginner-s-survey-of-the-solana-ecosystem-7b1</link>
      <guid>https://dev.to/cryptorustacean/a-beginner-s-survey-of-the-solana-ecosystem-7b1</guid>
      <description>&lt;p&gt;This was from a quick survey of my &lt;a href="https://twitter.com/cryptorustacean"&gt;Twitter feed&lt;/a&gt;. Is this a complete list? Obviously not. This is just a snapshot in time of what I'm currently aware of. It'll be an interesting read in a year when everything changes.&lt;/p&gt;

&lt;p&gt;Oh, it's pretty important to have a nice landing page with a good description and/or whitepaper. I made a long list of projects, but had to edit out a bunch because some projects just didn't have enough of a landing page.&lt;/p&gt;

&lt;h1&gt;
  
  
  Projects
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Project Serum
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w_Okt516--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-project-serum.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w_Okt516--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-project-serum.png" alt="Project Serum Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://projectserum.com"&gt;Project Serum&lt;/a&gt; is a protocol for DeFi for Solana. What makes it different is it's "on-chain orderbook" design. The reasoning behind this design is that decentralized exchanges like &lt;a href="https://uniswap.org"&gt;Uniswap&lt;/a&gt; requires Automated Market Making (AMM). In AMM, there's no limit orders, bids or offers, etc. The only price is the current market price. This is a necessary limitation because Uniswap is built on the Ethereum network, and providing matching bids and offers will involve lots of operations and quickly become cost prohibitive.&lt;/p&gt;

&lt;p&gt;There are a lot of projects&lt;/p&gt;

&lt;h2&gt;
  
  
  Figment Learn
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jHRL79S2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-figment-learn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jHRL79S2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-figment-learn.png" alt="Figment Learn Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://learn.figment.io/protocols/solana"&gt;Figment Learn&lt;/a&gt; is probably the fastest onramp to learning development for Solana. It's probably also the fastest onramp to learning the other projects they have &lt;a href="https://learn.figment.io/pathways"&gt;pathways&lt;/a&gt; for, like Polkadot and Polygon.&lt;/p&gt;

&lt;p&gt;If you've ever worked with &lt;a href="https://reactjs.org/"&gt;React&lt;/a&gt;, then the learning curve will be even flatter since the project you build upon is a &lt;a href="https://nextjs.org/"&gt;NextJS&lt;/a&gt; repo.&lt;/p&gt;

&lt;h2&gt;
  
  
  Phantom
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MKeqZJwq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-phantom.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MKeqZJwq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-phantom.png" alt="Phantom Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://phantom.app/"&gt;Phantom&lt;/a&gt; is a browser extension wallet where you can keep your SOL. It's the most recommended wallet for beginners in this ecosystems since it offers a friendly UI. This wallet is also compatible with &lt;a href="https://spl.solana.com/token"&gt;SPL tokens&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Anchor Framework
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PZGblewt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-anchor-framework.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PZGblewt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-anchor-framework.png" alt="Anchor Framework Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://project-serum.github.io/anchor/getting-started/introduction.html"&gt;Anchor Framework&lt;/a&gt; was &lt;a href="https://www.youtube.com/watch?v=FmdPAwsqJC4&amp;amp;t=3186s"&gt;described by&lt;/a&gt; &lt;a href="https://twitter.com/armaniferrante"&gt;@armaniferrante&lt;/a&gt; as "the Ruby on Rails for Solana development" because of the scaffolding the framework provides for writing smart contracts.&lt;/p&gt;

&lt;p&gt;Another reason to use the framework is it provides a "standard" API for building smart contracts on Solana and could be the de-facto solution for a majority of programs written for Solana.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pyth Network
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://pyth.network/"&gt;Pyth&lt;/a&gt; provides real-time on-chain market data, which would be instrumental in any derivatives product built on the blockchain. It lists a lot of heavy hitters as data providers, like FTX, Jane Street, and IEX (of Flash Boys fame).&lt;/p&gt;

&lt;h2&gt;
  
  
  Solanart
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o4ja6-5x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-solanart.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o4ja6-5x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-solanart.png" alt="Solanart Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's 2021 and NFTs are all the rage. &lt;a href="https://solanart.io/"&gt;Solanart&lt;/a&gt; is the first NFT marketplace on Solana. I'm pretty ignorant about this whole NFT craze at the moment, but even I recognize the importance of idea of non-fungible tokens so I'll definitely have to spend some time learning more about the NFT market in general.&lt;/p&gt;

&lt;p&gt;Check out some interesting projects, like Degen Ape Academy and Sollamas.&lt;/p&gt;

&lt;h2&gt;
  
  
  Raydium
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://raydium.io/"&gt;Raydium&lt;/a&gt; is an AMM platform for Solana built to provide on-chain liquidity to Project Serum's central limit order book.&lt;/p&gt;

&lt;h2&gt;
  
  
  Saber
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://saber.so/"&gt;Saber&lt;/a&gt; is a cross-chain stablecoin exchange on Solana. This means it helps to facilitate the transfer of assets between Solana and other blockchains.&lt;/p&gt;

&lt;h2&gt;
  
  
  SolFarm
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9BumlXPM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-solfarm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9BumlXPM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-solfarm.png" alt="SolFarm Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://solfarm.io/"&gt;SolFarm&lt;/a&gt; aggregates yield farms from Raydium and Saber. I don't know much about yield farming at this point, but this definitely merits further investigation.&lt;/p&gt;

&lt;h2&gt;
  
  
  PsyOptions
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RC2qb6MD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-psyoptions.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RC2qb6MD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-psyoptions.png" alt="PsyOptions Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://psyoptions.io/"&gt;PsyOptions&lt;/a&gt; is a protocol for building &lt;a href="https://www.investopedia.com/terms/a/americanoption.asp"&gt;American-style options&lt;/a&gt;. Like most of crypto, the project isn't very mature (as of writing), but having a mature protocol for writing options contracts for cryptocurrencies will lead towards more mainstream adoption by players in the financial markets.&lt;/p&gt;

&lt;h2&gt;
  
  
  Zeta
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bKCFnU2C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-zeta-markets.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bKCFnU2C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-zeta-markets.png" alt="Zeta Markets Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I saw &lt;a href="https://zeta.markets/"&gt;Zeta&lt;/a&gt; &lt;a href="https://www.twitch.tv/solanatv"&gt;present about their experience&lt;/a&gt; in the Solana Ignition Hackathon. Their tagline is "the premier under-collateralized DeFi options platform". I have no idea what that means, but the project seems interesting, mostly because of my interest in trading options.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flux Protocol
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UhbThBcN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-flux-protocol.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UhbThBcN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-flux-protocol.png" alt="Flux Protocol"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.fluxprotocol.org/"&gt;Flux Protocol&lt;/a&gt; is a cross-chain oracle aggregator that &lt;a href="https://www.fluxprotocol.org/blog/flux-is-launching-on-solana"&gt;will be launching on Solana&lt;/a&gt;. As with all crypto projects, who knows when this will happen. Hopefully this will make writing smart contracts dependent on an oracle much easier.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hedgehog Market
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BII3oTVw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-hedgehog.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BII3oTVw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-hedgehog.png" alt="Hedgehog Markets Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://hedgehog.markets/"&gt;Hedgehog&lt;/a&gt; is a prediction market platform built on Solana (testnet for now). They're currently in open beta so it would be interesting to know what kinds of prediction markets eventually make it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Grape Protocol
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TGHnefCn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-grape-networks.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TGHnefCn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-grape-networks.png" alt="Grape Networks Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most Solana projects try to tackle the financial markets aspect of blockchain, but &lt;a href="https://grapes.network/"&gt;Grapes Network&lt;/a&gt; tries to tackle social networking.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wormhole
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--elvQjOqQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-wormhole.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--elvQjOqQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-wormhole.png" alt="Wormhole Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://wormholenetwork.com/"&gt;Wormhole&lt;/a&gt; is a protocol for communication between different blockchains. Version 2 is currently in "active development". The main &lt;a href="https://medium.com/certus-one/introducing-the-wormhole-bridge-24911b7335f7"&gt;use of the protocol would be as a bridge&lt;/a&gt; between ERC-20 and SPL tokens.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mango Markets
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OXGUPKp5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-mango-markets.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OXGUPKp5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cryptorustacean.com/images/2021-09-14-mango-markets.png" alt="Mango Markets Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://mango.markets/"&gt;Mango Markets&lt;/a&gt; is a pretty hot decentralized exchange, or so it seems on Twitter.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Many of the projects are at various stages of development, but that seems to be the case with Solana and blockchain in general. What makes Solana so exciting the the multitudes of project currently being developed. A lot of these project also came out of the &lt;a href="https://solana.com/ignition"&gt;Solana Ignition&lt;/a&gt; or have big backers like &lt;a href="https://ftx.com/"&gt;FTX&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>solana</category>
    </item>
    <item>
      <title>Rust Learning Resources</title>
      <dc:creator>cryptorustacean.com</dc:creator>
      <pubDate>Fri, 10 Sep 2021 00:00:00 +0000</pubDate>
      <link>https://dev.to/cryptorustacean/rust-learning-resources-2jkc</link>
      <guid>https://dev.to/cryptorustacean/rust-learning-resources-2jkc</guid>
      <description>&lt;p&gt;In my current quest to efficiently ramp up my skills in Rust so that I could start contributing to the &lt;a href="https://solana.com"&gt;Solana&lt;/a&gt; ecosystem, my friend &lt;a href="https://twitter.com/logicmason"&gt;Mark&lt;/a&gt; from &lt;a href="https://alchemist.camp"&gt;Alchemist Camp&lt;/a&gt; suggested a pathway that would quickly ramp starting from some fairly approachable resources.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://pragprog.com/titles/hwrust/hands-on-rust/"&gt;Hands-on Rust&lt;/a&gt;: This book is from the author of the free &lt;a href="https://bfnightly.bracketproductions.com/rustbook/chapter_0.html"&gt;Roguelike Tutorial - In Rust&lt;/a&gt;. Since I have access to &lt;a href="https://learning.oreilly.com/"&gt;learning.oreilly.com&lt;/a&gt; already, I'll probably just straight into the book first, but the tutorial looks fun too so I may go through it as well if it doesn't duplicate too much of the content in the book.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pragprog.com/titles/khrust/programming-webassembly-with-rust/"&gt;Programming WebAssembly in Rust&lt;/a&gt;: I know Mark had a lot of good things to say about this one, and I'm happy he suggested this one for the second resource since I've been wanting to start checking out &lt;a href="https://webassembly.org/"&gt;Wasm&lt;/a&gt; but haven't had a compelling reason to do so.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.manning.com/books/rust-web-development"&gt;Rust Web Development&lt;/a&gt;: This book is still being written as we speak, so hopefully there will be a few more chapters completed by the time I get to it. Since I do mostly web development, I feel that having a book that teaches a different programming language, but in a familiar context, is a great way to learn.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nostarch.com/Rust2018"&gt;The Rust Programming Language&lt;/a&gt;: This one goes into the nitty-gritty of the language. I'd like to get some awesome things built before getting to this one. It's pretty important to figure out ways to stay motivated on the learning path and getting to this book too early may just stop me in my tracks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are a few other books that look pretty interesting, like &lt;a href="https://www.manning.com/books/rust-in-action"&gt;Rust in Action&lt;/a&gt;, that I may look at before getting to The Rust Programming Language. It all depends on how well I feel I've absorbed the information and the fluency with which I build applications.&lt;/p&gt;

</description>
      <category>rust</category>
    </item>
  </channel>
</rss>
