Răsfoiți Sursa

changed theming colors from blue to neutral + more

tonyboylehub 1 an în urmă
părinte
comite
ab31e5e669

+ 8 - 0
markdoc/tags.js

@@ -14,6 +14,7 @@ import {
 import {Seperator} from '@/components/Seperator'
 import { MarkdocGrid as ProductGrid } from '@/components/products/Grid'
 import { MarkdocGrid as AllProductsGrid } from '@/components/products/GridAllProducts'
+import { PackagesUsed } from '@/components/helperComponents/packagesUsed'
 
 const tags = {
   callout: {
@@ -142,6 +143,13 @@ const tags = {
     },
     selfClosing: true,
   },
+  packagesUsed: {
+    render: PackagesUsed,
+    attributes: {
+      packages: { type: Array },
+      type: { type: String },
+    },
+  },
 }
 
 export default tags

BIN
public/assets/banners/touch-screen.jpg


BIN
public/assets/candy-machine/core-candy-machine.jpg


BIN
public/assets/candy-machine/core-cm-v2.jpg


+ 1 - 1
src/components/Callout.jsx

@@ -5,7 +5,7 @@ import { Icon } from '@/components/icons/dual-tone'
 const styles = {
   note: {
     container:
-      'bg-sky-50 dark:bg-slate-800/60 dark:ring-1 dark:ring-slate-300/10',
+      'bg-sky-50 dark:bg-neutral-800/60 dark:ring-1 dark:ring-neutral-300/10',
     title: 'text-sky-900 dark:text-sky-400',
     body: 'text-sky-800 [--tw-prose-underline:theme(colors.sky.400)] [--tw-prose-background:theme(colors.sky.50)] prose-a:text-sky-900 prose-code:text-sky-900 dark:text-slate-300 dark:prose-code:text-slate-300 dark:[--tw-prose-underline:theme(colors.accent.700)]',
   },

+ 4 - 4
src/components/Layout.jsx

@@ -28,7 +28,7 @@ export function Layout({ children, page }) {
     <>
       <Header page={page} />
 
-      {Hero && <Hero page={page} />}
+      {Hero && page.product.name !== 'Guides' && <Hero page={page} />}
 
       <div
         className={clsx(
@@ -77,9 +77,9 @@ export function Layout({ children, page }) {
             <Prose className="break-words">
               {children}
 
-<div className='flex justify-between text-neutral-600 italic text-sm'>
-              {page.created && <div>Date created: {page.created}</div>}
-              {page.updated && <div>Date updated: {page.updated}</div>}
+              <div className="flex justify-between text-sm italic text-neutral-600">
+                {page.created && <div>Date created: {page.created}</div>}
+                {page.updated && <div>Date updated: {page.updated}</div>}
               </div>
             </Prose>
           </article>

+ 16 - 0
src/components/Navigation.jsx

@@ -49,6 +49,22 @@ export function Navigation({ product, navigation, className }) {
                     {link.created && isRecent(link.created) && (
                       <Badge type="new" />
                     )}
+                    {/* {link.links && link.links.map(sublink => {
+                      return (
+                        <Link
+                          href={sublink.href}
+                          key={`${sublink.title}-${sublink.href}`}
+                          className={clsx(
+                            'block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-[2px] before:top-1/2 before:h-4 before:w-[3px] before:-translate-y-1/2 before:rounded',
+                            sublink.href === router.pathname
+                              ? 'font-semibold text-accent-500 before:bg-accent-500'
+                              : 'text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block dark:text-slate-400 dark:before:bg-slate-700 dark:hover:text-slate-300'
+                          )}
+                        >
+                          {sublink.title}
+                        </Link>
+                      )
+                    })} */}
                   </Link>
                 </li>
               ))}

+ 5 - 5
src/components/Prose.jsx

@@ -5,19 +5,19 @@ export function Prose({ as: Component = 'div', className, ...props }) {
     <Component
       className={clsx(
         className,
-        'prose prose-slate max-w-none dark:prose-invert dark:text-slate-400',
+        'prose prose-neutral max-w-none dark:prose-invert dark:text-neutral-400',
         // headings
         'prose-headings:scroll-mt-28 prose-headings:font-display prose-headings:font-normal lg:prose-headings:scroll-mt-[8.5rem]',
         // lead
-        'prose-lead:text-slate-500 dark:prose-lead:text-slate-400',
+        'prose-lead:text-neutral-500 dark:prose-lead:text-neutral-400',
         // links
         'prose-a:font-semibold dark:prose-a:text-accent-400',
         // link underline
-        'prose-a:no-underline prose-a:shadow-[inset_0_-2px_0_0_var(--tw-prose-background,#fff),inset_0_calc(-1*(var(--tw-prose-underline-size,4px)+2px))_0_0_var(--tw-prose-underline,theme(colors.accent.300))] hover:prose-a:[--tw-prose-underline-size:6px] dark:[--tw-prose-background:theme(colors.slate.900)] dark:prose-a:shadow-[inset_0_calc(-1*var(--tw-prose-underline-size,2px))_0_0_var(--tw-prose-underline,theme(colors.accent.800))] dark:hover:prose-a:[--tw-prose-underline-size:6px]',
+        'prose-a:no-underline prose-a:shadow-[inset_0_-2px_0_0_var(--tw-prose-background,#fff),inset_0_calc(-1*(var(--tw-prose-underline-size,4px)+2px))_0_0_var(--tw-prose-underline,theme(colors.accent.300))] hover:prose-a:[--tw-prose-underline-size:6px] dark:[--tw-prose-background:theme(colors.neutral.900)] dark:prose-a:shadow-[inset_0_calc(-1*var(--tw-prose-underline-size,2px))_0_0_var(--tw-prose-underline,theme(colors.accent.800))] dark:hover:prose-a:[--tw-prose-underline-size:6px]',
         // pre
-        'prose-pre:rounded-xl prose-pre:bg-slate-900 prose-pre:shadow-lg dark:prose-pre:bg-slate-800/60 dark:prose-pre:shadow-none dark:prose-pre:ring-1 dark:prose-pre:ring-slate-300/10',
+        'prose-pre:rounded-xl prose-pre:bg-neutral-800 prose-pre:shadow-lg dark:prose-pre:bg-neutral-800/60 dark:prose-pre:shadow-none dark:prose-pre:ring-1 dark:prose-pre:ring-neutral-300/10',
         // hr
-        'dark:prose-hr:border-slate-800',
+        'dark:prose-hr:border-neutral-800',
         // table
         'prose-table:m-0'
       )}

+ 19 - 0
src/components/helperComponents/badgesList.jsx

@@ -0,0 +1,19 @@
+export const badgesList = ({ badges }) => {
+  const packageList = badges.map((badge, index) => {
+    return (
+      <div key={index} className="rounded-lg bg-neutral-800 p-2 shadow-md">
+        <div className="text-xs">{badge}</div>
+      </div>
+    )
+  })
+
+  return (
+    <div className="flex flex-col gap-4">
+      <div>{type}</div>
+      <div className="flex flex-wrap gap-2">
+        {packageList}
+        {/* {JSON.stringify(installationPackages, null, 2)} */}
+      </div>
+    </div>
+  )
+}

+ 64 - 0
src/components/helperComponents/packages.js

@@ -0,0 +1,64 @@
+export const installationPackages = {
+  umi: {
+    name: 'umi',
+    description: 'A client wrapper for Solana protocols by Metaplex',
+    npm: '@metaplex-foundation/umi',
+    crate: null,
+    docs: '/umi',
+  },
+  umiDefaults: {
+    name: 'umi',
+    description: 'A client wrapper for Solana protocols by Metaplex',
+    npm: '@metaplex-foundation/umi-bundle-defaults',
+    crate: null,
+    docs: '/umi',
+  },
+  tokenMetadata: {
+    name: 'token-metadata',
+    description: 'Token Metadata program by Metaplex',
+    npm: '@metaplex-foundation/mpl-token-metadata',
+    crate: 'mpl-token-metadata',
+    docs: '/token-metadata',
+  },
+  core: {
+    name: 'core',
+    description: 'Newest Core Asset standard by Metaplex',
+    npm: '@metaplex-foundation/mpl-core',
+    crate: 'mpl-core',
+    docs: '/core',
+  },
+  candyMachineTm: {
+    name: 'candy-machine',
+    description: 'A toolkit for React best practices.',
+    npm: '@metaplex-foundation/mpl-candy-machine',
+    crate: 'mpl-candy-machine',
+    docs: '/candy-machine',
+  },
+  candyMachineCore: {
+    name: 'candy-machine-core',
+    description: 'A toolkit for React best practices.',
+    npm: '@metaplex-foundation/mpl-core-candy-machine',
+    crate: 'mpl-core-candy-machine-core',
+    docs: '/candy-machine-core',
+  },
+  bubblegum: {
+    name: 'bubblegum',
+    description: 'Compressed Nft standard by Metaplex',
+    npm: '@metaplex-foundation/mpl-bubblegum',
+    crate: 'mpl-bubblegum',
+    docs: '/bubblegum',
+  },
+  toolbox: {
+    name: 'toolbox',
+    description: 'A toolkit wrapped for Solana protocols by Metaplex',
+    npm: '@metaplex-foundation/mpl-toolbox',
+    crate: 'mpl-toolbox',
+  },
+  hydra: {
+    name: 'hydra',
+    description: 'A toolkit wrapped for Solana protocols by Metaplex',
+    npm: '@metaplex-foundation/mpl-hydra',
+    crate: 'mpl-hydra',
+    docs: '/hydra',
+  },
+}

+ 57 - 0
src/components/helperComponents/packagesUsed.jsx

@@ -0,0 +1,57 @@
+import { installationPackages } from './packages.js'
+
+export const PackagesUsed = ({ packages, type }) => {
+  console.log({ installationPackages })
+
+  const url = (installationPackage, type) => {
+    if (type === 'npm') {
+      return `https://www.npmjs.com/package/${installationPackages[installationPackage].npm}`
+    } else if (type === 'rust') {
+      return `https://crates.io/crates/${installationPackages[installationPackage].crate}`
+    } else if (type === 'github') {
+      return installationPackage.github
+    }
+  }
+
+  const packageName = (installationPackage) => {
+    const metaplexPackage = installationPackages[installationPackage]
+
+    if (metaplexPackage) {
+      if (type == 'npm' && metaplexPackage.npm) {
+        return metaplexPackage.npm
+      } else if (type == 'crates' && metaplexPackage.crate) {
+        return metaplexPackage.crate
+      }
+    } else {
+      return installationPackage
+    }
+  }
+
+  const packageList = packages.map((installationPackage, index) => {
+    return (
+      <div
+        key={index}
+        className="dark:text-neutral-300 rounded-lg bg-neutral-300 p-2 text-neutral-700 shadow-md dark:bg-neutral-800"
+      >
+        <div className="text-xs">{packageName(installationPackage)}</div>
+        {/* <p className="text-sm text-gray-500">{packageName}</p> */}
+        {/* <a
+          href={url(installationPackage, type)}
+          className="text-blue-500 hover:underline"
+        >
+          View Package
+        </a> */}
+      </div>
+    )
+  })
+
+  return (
+    <div className="flex flex-col gap-4">
+      <div>{type}</div>
+      <div className="flex flex-wrap gap-2">
+        {packageList}
+        {/* {JSON.stringify(installationPackages, null, 2)} */}
+      </div>
+    </div>
+  )
+}

+ 1 - 1
src/components/products/guides/Hero.jsx

@@ -20,7 +20,7 @@ const codeProps = {
 export function Hero({ page }) {
   return (
     <BaseHero page={page}>
-      <img src={HoloCode.src} className='rounded-xl dropShadowLight' />
+      {/* <img src={HoloCode.src} className='rounded-xl dropShadowLight' /> */}
       {/* <HeroCode {...codeProps}></HeroCode> */}
     </BaseHero>
   )

+ 136 - 9
src/components/products/guides/index.js

@@ -1,6 +1,4 @@
-import {
-  documentationSection
-} from '@/shared/sections'
+import { documentationSection } from '@/shared/sections'
 import { BookOpenIcon } from '@heroicons/react/24/outline'
 import { Hero } from './Hero'
 
@@ -10,7 +8,7 @@ export const guides = {
   description: 'Guides for the Solana Blockchain.',
   path: 'guides',
   navigationMenuCatergory: 'Guides',
-  icon: <BookOpenIcon className='text-green-500' />,
+  icon: <BookOpenIcon className="text-green-500" />,
   github: 'https://github.com/metaplex-foundation/mpl-core',
   className: 'accent-green',
   heroes: [{ path: '/guides', component: Hero }],
@@ -19,27 +17,156 @@ export const guides = {
       ...documentationSection('guides'),
       navigation: [
         {
-          title: 'Assets/Nfts',
+          title: 'Solana Newcomers',
           links: [
             {
-              title: 'Creating an Nft',
-              href: '/guides/how-to-create-an-nft-on-solana',
+              title: 'What is Solana?',
+              href: '/guides/what-is-solana',
               created: '2021-10-01',
               updated: null, // null means it's never been updated
-            }
+            },
+            {
+              title: 'RPCs and DAS',
+              href: '/guides/rpcs-and-das',
+              created: '2021-10-01',
+              updated: null, // null means it's never been updated
+            },
+            {
+              title: 'Solana Programs',
+              href: '/guides/solana-programs',
+              created: '2021-10-01',
+              updated: null, // null means it's never been updated
+            },
+            {
+              title: 'Understanding PDAs',
+              href: '/guides/understanding-pdas',
+              created: '2021-10-01',
+              updated: null, // null means it's never been updated
+            },
+            {
+              title: 'Where do I start?',
+              href: '/guides/where-do-i-start-on-solana',
+              created: '2021-10-01',
+              updated: null, // null means it's never been updated
+            },
           ],
         },
         {
-          title: 'Spl Token',
+          title: 'Javascript',
           links: [
+            {
+              title: 'Working with Javascript',
+              href: '/guides/javascript/working-with-javascript',
+              created: '2021-10-01',
+              updated: null, // null means it's never been updated
+            },
+            {
+              title: 'Creating an Nft',
+              href: '/guides/how-to-create-an-nft-on-solana',
+              created: '2021-10-01',
+              updated: null, // null means it's never been updated
+            },
+            {
+              title: 'Freezing an Nft',
+              href: '/guides/how-to-freeze-an-nft-on-solana',
+              created: '2021-10-01',
+              updated: null, // null means it's never been updated
+            },
             {
               title: 'Creating an SPL Token',
               href: '/guides/how-to-create-an-spl-token-on-solana',
               created: '2024-06-16',
               updated: null, // null means it's never been updated
             },
+            {
+              title: 'Updating an SPL Token',
+              href: '/guides/how-to-update-an-spl-token-on-solana',
+              created: '2024-06-16',
+              updated: null, // null means it's never been updated
+            },
+            {
+              title: 'Transfering Tokens',
+              href: '/guides/how-to-transfer-an-spl-token-on-solana',
+              created: '2024-06-16',
+              updated: null, // null means it's never been updated
+            },
+            {
+              title: 'Transfering SOL',
+              href: '/guides/how-to-transfer-sol-on-solana',
+              created: '2024-06-16',
+              updated: null, // null means it's never been updated
+            },
+          ],
+        },
+        {
+          title: 'Rust',
+          links: [
+            {
+              title: 'Working With Rust',
+              href: '/guides/rust/working-with-rust',
+              created: '2021-10-01',
+              updated: null, // null means it's never been updated
+            },
+            {
+              title: 'Create a Marketplace',
+              href: '/guides/rust/create-a-marketplace',
+              created: '2021-10-01',
+              updated: null, // null means it's never been updated
+            },
+            {
+              title: 'Create a Staking Program',
+              href: '/guides/rust/create-a-staking-program',
+              created: '2021-10-01',
+              updated: null, // null means it's never been updated
+            },
+            {
+              title: 'Program Optimization',
+              href: '/guides/rust/program-optimization',
+              created: '2021-10-01',
+              updated: null, // null means it's never been updated
+            },
           ],
         },
+        // {
+        //   title: 'Assets/Nfts',
+        //   links: [
+        //     {
+        //       title: 'Creating an Nft',
+        //       href: '/guides/how-to-create-an-nft-on-solana',
+        //       created: '2021-10-01',
+        //       updated: null, // null means it's never been updated
+        //     },
+        //     {
+        //       title: 'How to freeze an Nft',
+        //       href: '/guides/how-to-freeze-an-nft-on-solana',
+        //       created: '2021-10-01',
+        //       updated: null, // null means it's never been updated
+        //     },
+        //   ],
+        // },
+        // {
+        //   title: 'Spl Token',
+        //   links: [
+        //     {
+        //       title: 'Creating an SPL Token',
+        //       href: '/guides/how-to-create-an-spl-token-on-solana',
+        //       created: '2024-06-16',
+        //       updated: null, // null means it's never been updated
+        //     },
+        //     {
+        //       title: 'Updating an SPL Token',
+        //       href: '/guides/how-to-update-an-spl-token-on-solana',
+        //       created: '2024-06-16',
+        //       updated: null, // null means it's never been updated
+        //     },
+        //     {
+        //       title: 'Transfering Tokens',
+        //       href: '/guides/how-to-transfer-an-spl-token-on-solana',
+        //       created: '2024-06-16',
+        //       updated: null, // null means it's never been updated
+        //     },
+        //   ],
+        // },
         {
           title: 'React/Nextjs',
           links: [

+ 184 - 152
src/pages/guides/how-to-create-an-nft-on-solana.md

@@ -7,7 +7,12 @@ created: '06-16-2024'
 updated: '06-18-2024'
 ---
 
-This is an intial guide on how to create a next-gen Nft (Core Asset) on the Solana blockchain using the Metaplex Mpl Core protocol. Mpl Core Assets provide the next wave of NFT projects on Solana with greater creativity and a broad dynamic experiance for both creators and owners with Mpl Core's unique plugin system.
+This is an intial guide on how to create a next-gen Nft (Core Asset) on the Solana blockchain using the Metaplex Mpl Core protocol. Mpl Core Assets provide the next wave of NFT projects on Solana with greater creativity and a broad dynamic experiance for both creators and owners with Mpl Core's simplied design and unique plugin system.
+
+## Prerequisite
+
+- Code Editor of your choice (recomended Visual Studio Code)
+- Node 18.x.x or above.
 
 ## Initial Setup
 
@@ -25,6 +30,8 @@ npm init
 
 Install the required pacakges for this guide.
 
+{% packagesUsed packages=["umi", "umiDefaults" ,"tokenMetadata", "core", "@solana/spl-token"] type="npm" /%}
+
 ```js
 npm i @metaplex-foundation/umi
 ```
@@ -41,39 +48,81 @@ npm i @metaplex-foundation/mplcore
 npm i @metaplex-foundation/umi-uploader-irys;
 ```
 
-## Setting up Umi
+### Imports and Wrapper Function
 
-This example is going to run through setting up Umi with a `generatedSigner()`. If you wish to try this example with React you'll need to setup Umi via the `React - Umi w/ Wallet Adapter` guide. Apart from the the wallet setup this guide will for fileStorage keys and wallet adapter.
+Here we will define all needed imports for this particular guide and create a wrapper function where all our code will execute.
 
 ```ts
-import { mplCore } from '@metaplex-foundation/mpl-token-metadata'
-import { generateSigner, signerIdentity } from '@metaplex-foundation/umi'
+import {
+  createFungible,
+  mplTokenMetadata,
+} from '@metaplex-foundation/mpl-token-metadata'
+import {
+  createTokenIfMissing,
+  findAssociatedTokenPda,
+  getSplAssociatedTokenProgramId,
+  mintTokensTo,
+} from '@metaplex-foundation/mpl-toolbox'
+import {
+  generateSigner,
+  percentAmount,
+  createGenericFile,
+  signerIdentity,
+} from '@metaplex-foundation/umi'
 import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
 import { irysUploader } from '@metaplex-foundation/umi-uploader-irys'
+import { base58 } from '@metaplex-foundation/umi/serializers'
+import fs from 'fs'
+import path from 'path'
+
+// Create the wrapper function
+const createNft = async () => {
+  ///
+  ///
+  ///  all our code will go in here
+  ///
+  ///
+}
+
+// run the wrapper function
+createNft()
+```
+
+## Setting up Umi
+
+This example is going to run through setting up Umi with a `generatedSigner()`. If you wish to try this example with React you'll need to setup Umi via the `React - Umi w/ Wallet Adapter` guide. Apart from the the wallet setup this guide will for fileStorage keys and wallet adapter.
+
+### Generating a New Wallet
 
+```ts
 const umi = createUmi('https://api.devnet.solana.com')
   .use(mplCore())
   .use(irysUploader())
 
+// Generate a new keypair signer.
 const signer = generateSigner(umi)
 
+// Tell umit to use the new signer.
 umi.use(signerIdentity(signer))
-```
 
-The first 3 lines we are importing packages that required to create an SPL Token.
-
-```ts
-import { mplTokenMetadata } from '@metaplex-foundation/mpl-token-metadata'
-import { generateSigner, signerIdentity } from '@metaplex-foundation/umi'
-import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
+// This will airdrop SOL on devnet only for testing.
+await umi.rpc.airdrop(umi.identity.publickey)
 ```
 
-The following lines we generate a new signer (private key) and we assign it umi.
-
+### Use an Existing Wallet
 ```ts
+const umi = createUmi('https://api.devnet.solana.com')
+  .use(mplCore())
+  .use(irysUploader())
+
+// Generate a new keypair signer.
 const signer = generateSigner(umi)
 
-umi.use(signerIdentity(signer))
+// You will need to us fs and navigation the filesystem to
+// load the wallet you wish to use via relative pathing.
+const walletFile = const imageFile = fs.readFileSync(
+    path.join(__dirname, './keypair.json')
+  ) 
 ```
 
 ## Creating the Nft
@@ -88,21 +137,6 @@ Umi comes with downloadable storage plugins that allow you to upload to storage
 This example is using a localscript/node.js approach using Irys to upload to Arweave. If you wish to upload files to a different storage provider or from the browser you will need to take a different approach. Importing and using `fs` won't work in a browser scenario.
 {% /callout %}
 
-#### New Imports
-
-```ts
-// import fs and path by adding it under the rest of the imports at the start of your file.
-import fs from 'fs'
-import path from 'path'
-
-// we also add the `createGenericFile` import to the original list of umi imports.
-import {
-  generateSigner,
-  signerIdentity,
-  createGenericFile,
-} from '@metaplex-foundation/umi'
-```
-
 ```ts
 // use `fs` to read file via a string path.
 // You will need to understand the concept of pathing from a computing perspective.
@@ -206,29 +240,19 @@ There are a few things we need to take into account when creating and minting a
 - If we are minting the Tokens then we need a Token Account (holds the minted tokens in a persons wallet)
 - Mint the token.
 
-#### New Import
-
-Add this import to the rest of your imports at the top of the page. You may be added to the existing `@metaplex-foundation/mpl-toolbox` import if there is one.
-
-```ts
-import {
-  create
-} from '@metaplex-foundation/mpl-core'
-```
-
 Now we can proceed to create the mintTokenTo instruction
 
 ```ts
-const assetSigner = generateSigner(umi);
+const assetSigner = generateSigner(umi)
 
 const createTx = await create(umi, {
-    asset: assetSigner,
-    collection: collection,
-    name: "My Asset",
-    uri: "https://example.com/my-asset.json",
-  }).sendAndConfirm(umi);
+  asset: assetSigner,
+  collection: collection,
+  name: 'My Asset',
+  uri: 'https://example.com/my-asset.json',
+}).sendAndConfirm(umi)
 
-  // finally we can deserialize the signature that we can check on chain.
+// finally we can deserialize the signature that we can check on chain.
 // import { base58 } from "@metaplex-foundation/umi/serializers";
 
 console.log(base58.deserialize(tx.signature)[0])
@@ -237,113 +261,121 @@ console.log(base58.deserialize(tx.signature)[0])
 ## Full Code Example
 
 ```ts
+import { create } from "@metaplex-foundation/mpl-core";
 import {
-  createFungible,
-  mplTokenMetadata,
-} from '@metaplex-foundation/mpl-token-metadata'
-import {
-  createTokenIfMissing,
-  findAssociatedTokenPda,
-  getSplAssociatedTokenProgramId,
-  mintTokensTo,
-} from '@metaplex-foundation/mpl-toolbox'
-import {
-  generateSigner,
-  percentAmount,
   createGenericFile,
+  generateSigner,
   signerIdentity,
-} from '@metaplex-foundation/umi'
-import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
-import { irysUploader } from '@metaplex-foundation/umi-uploader-irys'
-import { base58 } from '@metaplex-foundation/umi/serializers'
-import fs from 'fs'
-import path from 'path'
-
-const createAndMintTokens = async () => {
-  const umi = createUmi('https://api.devnet.solana.com')
-    .use(mplTokenMetadata())
-    .use(irysUploader())
-
-  const signer = generateSigner(umi)
-
-  umi.use(signerIdentity(signer))
-
-  // use `fs` to read file via a string path.
-  // You will need to understand the concept of pathing from a computing perspective.
-
-  const imageFile = fs.readFileSync(
-    path.join(__dirname, '..', '/assets/islandDao.jpg')
-  )
-
-  // Use `createGenericFile` to transform the file into a `GenericFile` type
-  // that umi can understand. Make sure you set the mimi tag type correctly
-  // otherwise Arweave will not know how to display your image.
-
-  const umiImageFile = createGenericFile(imageFile, 'island-dao.jpeg', {
-    tags: [{ name: 'Content-Type', value: 'image/jpeg' }],
-  })
-
-  // Here we upload the image to Arweave via Irys and we get returned a uri
-  // address where the file is located. You can log this out but as the
-  // uploader can takes an array of files it also returns an array of uris.
-  // To get the uri we want we can call index [0] in the array.
-
-  const imageUri = await umi.uploader.upload([umiImageFile]).catch((err) => {
-    throw new Error(err)
-  })
-
-  console.log(imageUri[0])
-
-  // Uploading the tokens metadata to Arweave via Irys
-
-  const metadata = {
-  "name": "My Nft",
-  "description": "This is an Nft on Solana",
-  "image": imageUri,
-  "external_url": "https://example.com",
-  "attributes": [
-    {
-      "trait_type": "trait1",
-      "value": "value1"
-    },
-    {
-      "trait_type": "trait2",
-      "value": "value2"
-    }
-  ],
-  "properties": {
-    "files": [
-      {
-        "uri": "https://arweave.net/my-image",
-        "type": "image/png"
-      },
-    ],
-    "category": "image"
-  }
-}
-
-// Call upon umi's uploadJson function to upload our metadata to Arweave via Irys.
-
-const metadataUri = await umi.uploader.uploadJson(metadata).catch((err) => {
-throw new Error(err)
-})
-
-// Creating the mintIx
-
-const assetSigner = generateSigner(umi);
-
-const createTx = await create(umi, {
-    asset: assetSigner,
-    collection: collection,
-    name: "My Asset",
-    uri: "https://example.com/my-asset.json",
-  }).sendAndConfirm(umi);
-
-  // finally we can deserialize the signature that we can check on chain.
-// import { base58 } from "@metaplex-foundation/umi/serializers";
-
-console.log(base58.deserialize(tx.signature)[0])
-}
+  sol,
+} from "@metaplex-foundation/umi";
+import { createUmi } from "@metaplex-foundation/umi-bundle-defaults";
+import { base58 } from "@metaplex-foundation/umi/serializers";
+import fs from "fs";
+import path from "path";
+
+const createNft = async () => {
+
+  //
+  // ** Setting Up Umi **
+  //
+
+        const umi = createUmi("https://api.devnet.solana.com");
+
+        const signer = generateSigner(umi);
+
+        umi.use(signerIdentity(signer));
+
+        // Airdrop 1 SOL to the identity
+        // if you end up with a 429 too many requests error, you may have to use
+        // the filesystem wallet method or change rpcs.
+        await umi.rpc.airdrop(umi.identity.publicKey, sol(1));
+
+  //
+  // ** Upload an image to Arweave **
+  //
+
+        // use `fs` to read file via a string path.
+        // You will need to understand the concept of pathing from a computing perspective.
+
+        const imageFile = fs.readFileSync(
+            path.join(__dirname, "../assets/images/0.png")
+        );
+
+        // Use `createGenericFile` to transform the file into a `GenericFile` type
+        // that umi can understand. Make sure you set the mimi tag type correctly
+        // otherwise Arweave will not know how to display your image.
+
+        const umiImageFile = createGenericFile(imageFile, "0.png", {
+            tags: [{ name: "Content-Type", value: "image/jpeg" }],
+        });
+
+        // Here we upload the image to Arweave via Irys and we get returned a uri
+        // address where the file is located. You can log this out but as the
+        // uploader can takes an array of files it also returns an array of uris.
+        // To get the uri we want we can call index [0] in the array.
+
+        const imageUri = await umi.uploader.upload([umiImageFile]).catch((err) => {
+            throw new Error(err);
+        });
+
+
+        console.log("imageUri: " + imageUri[0]);
+
+
+    //
+    // ** Upload Metadata to Arweave **
+    //
+        
+        const metadata = {
+            "name": "My Nft",
+            "description": "This is an Nft on Solana",
+            "image": imageUri[0],
+            "external_url": "https://example.com",
+            "attributes": [
+              {
+                "trait_type": "trait1",
+                "value": "value1"
+              },
+              {
+                "trait_type": "trait2",
+                "value": "value2"
+              }
+            ],
+            "properties": {
+              "files": [
+                {
+                  "uri": imageUri[0],
+                  "type": "image/jpeg"
+                }
+              ],
+              "category": "image"
+            }
+        }
+
+        // Call upon umi's uploadJson function to upload our metadata to Arweave via Irys.
+
+        const metadataUri = await umi.uploader.uploadJson(metadata).catch((err) => {
+            throw new Error(err)
+        })
+
+    //
+    // ** Creating the Nft **
+    //
+
+        // We generate a signer for the Nft
+        const nftSigner = generateSigner(umi);
+
+        const tx = await create(umi, {
+            asset: nftSigner,
+            name: "My Nft",
+            uri: metadataUri,
+        }).sendAndConfirm(umi);
+
+        // finally we can deserialize the signature that we can check on chain.
+        const signature = base58.deserialize(tx.signature);
+        console.log(signature)
+};
+
+createNft();
 
-createAndMintTokens()
 ```

+ 62 - 10
src/pages/guides/how-to-create-an-spl-token-on-solana.md

@@ -4,10 +4,15 @@ metaTitle: How to Create an Spl Token On Solana
 description: Learn how to create an Spl Token on the Solana blockchain with Metaplex packages.
 # remember to update dates also in /components/guides/index.js
 created: '06-16-2024'
-updated: '06-18-2024'
+updated: '06-21-2024'
 ---
 
-To create a Fungible SPL Token on Solana using Metaplex packages you'll need to install the following via your package manager of choice.
+This guide walks you through setting up and minting your very own token on the Solana blockchain using Metaplex packages.
+
+## Prerequisite
+
+- Code Editor of your choice (recomended Visual Studio Code)
+- Node 18.x.x or above.
 
 ## Initial Setup
 
@@ -23,6 +28,8 @@ npm init
 
 Install the required pacakges for this guide.
 
+{% packagesUsed packages=["umi", "umiDefaults" ,"tokenMetadata", "@metaplex-foundation/umi-uploader-irys", "toolbox"] type="npm" /%}
+
 ```js
 npm i @metaplex-foundation/umi
 ```
@@ -43,6 +50,47 @@ npm i @metaplex-foundation/umi-uploader-irys;
 npm i @metaplex-foundation/mpl-toolbox;
 ```
 
+### Imports and Wrapper Function
+
+Here we will define all needed imports for this particular guide and create a wrapper function where all our code will execute.
+
+```ts
+import {
+  createFungible,
+  mplTokenMetadata,
+} from '@metaplex-foundation/mpl-token-metadata'
+import {
+  createTokenIfMissing,
+  findAssociatedTokenPda,
+  getSplAssociatedTokenProgramId,
+  mintTokensTo,
+} from '@metaplex-foundation/mpl-toolbox'
+import {
+  generateSigner,
+  percentAmount,
+  createGenericFile,
+  signerIdentity,
+  sol,
+} from '@metaplex-foundation/umi'
+import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
+import { irysUploader } from '@metaplex-foundation/umi-uploader-irys'
+import { base58 } from '@metaplex-foundation/umi/serializers'
+import fs from 'fs'
+import path from 'path'
+
+// Create the wrapper function
+const createAndMintTokens = async () => {
+  ///
+  ///
+  ///  all our code will go in here
+  ///
+  ///
+}
+
+// run the wrapper function
+createAndMintTokens()
+```
+
 ## Setting up Umi
 
 This example is going to run through setting up Umi with a `generatedSigner()`. If you wish to try this example with React you'll need to setup Umi via the `React - Umi w/ Wallet Adapter` guide. Apart from the the wallet setup this guide will for fileStorage keys and wallet adapter.
@@ -300,6 +348,7 @@ import {
   percentAmount,
   createGenericFile,
   signerIdentity,
+  sol,
 } from '@metaplex-foundation/umi'
 import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
 import { irysUploader } from '@metaplex-foundation/umi-uploader-irys'
@@ -316,19 +365,22 @@ const createAndMintTokens = async () => {
 
   umi.use(signerIdentity(signer))
 
+  // Airdrop 1 SOL to the identity
+  // if you end up with a 429 too many requests error, you may have to use
+  // the filesystem wallet method or change rpcs.
+  await umi.rpc.airdrop(umi.identity.publicKey, sol(1))
+
   // use `fs` to read file via a string path.
   // You will need to understand the concept of pathing from a computing perspective.
 
-  const imageFile = fs.readFileSync(
-    path.join(__dirname, '..', '/assets/islandDao.jpg')
-  )
+  const imageFile = fs.readFileSync(path.join(__dirname, '/assets/image.png'))
 
   // Use `createGenericFile` to transform the file into a `GenericFile` type
   // that umi can understand. Make sure you set the mimi tag type correctly
   // otherwise Arweave will not know how to display your image.
 
-  const umiImageFile = createGenericFile(imageFile, 'island-dao.jpeg', {
-    tags: [{ name: 'Content-Type', value: 'image/jpeg' }],
+  const umiImageFile = createGenericFile(imageFile, 'image.png', {
+    tags: [{ name: 'Content-Type', value: 'image/png' }],
   })
 
   // Here we upload the image to Arweave via Irys and we get returned a uri
@@ -361,7 +413,7 @@ const createAndMintTokens = async () => {
 
   const mintSigner = generateSigner(umi)
 
-  const createFungibleIx = await createFungible(umi, {
+  const createFungibleIx = createFungible(umi, {
     mint: mintSigner,
     name: 'The Kitten Coin',
     uri: metadataUri, // we use the `metedataUri` variable we created earlier that is storing our uri.
@@ -369,7 +421,7 @@ const createAndMintTokens = async () => {
     decimals: 9, // set the amount of decimals you want your token to have.
   })
 
-  // This instruction will create a new Token Account if required, otherwise it skips.
+  // This instruction will create a new Token Account if required, if one is found then it skips.
 
   const createTokenIx = createTokenIfMissing(umi, {
     mint: mintSigner.publicKey,
@@ -392,7 +444,7 @@ const createAndMintTokens = async () => {
   // Ix's here can be ommited and added as needed during the chain.
   // If for example you just want to create the Token without minting
   // any tokens then you can only submit the `createToken` ix.
-  //
+
   // If you want to mint tokens to a different wallet then you can
   // just pull out the `createTokenIx` ix and `mintTokensIx` ix and send
   // them as another tx.

+ 7 - 1
src/pages/guides/index.md

@@ -2,4 +2,10 @@
 title: Guides
 metaTitle: Create Spl Token
 description: Learn how to create an Spl Token on the Solana blockchain.
----
+---
+
+![image info](./assets/banners/touch-screen.jpg)
+
+The guides are meticulously crafted to lower the barrier to entry for new Solana developers by providing clear, step-by-step instructions, comprehensive explanations, and practical examples. Recognizing that the complexity of blockchain technology can be daunting, these guides focus on demystifying key concepts and breaking down intricate processes into manageable tasks. They offer a structured learning path that gradually introduces developers to the Solana ecosystem, covering everything from the basics of blockchain and Solana's unique features to advanced topics such as smart contract development and optimization techniques.
+
+By incorporating a variety of learning resources, including tutorials, code samples, the guides cater to different learning styles and levels of expertise. They also emphasize hands-on experience, encouraging developers to build and deploy their own applications on the Solana network. This practical approach not only reinforces theoretical knowledge but also boosts confidence and competence. Furthermore, the guides are regularly updated to reflect the latest developments in the Solana ecosystem, ensuring that new developers have access to current information and best practices. In essence, these guides serve as a comprehensive, accessible, and up-to-date resource that empowers new developers to start their journey on Solana with confidence and clarity.