<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Phosphor</title>
        <link>https://paragraph.com/@phosphor</link>
        <description>Making creator-fan relationships more rewarding &amp; enabling the next generation of builders. </description>
        <lastBuildDate>Mon, 23 Nov 2026 09:09:22 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>Phosphor</title>
            <url>https://storage.googleapis.com/papyrus_images/4d96716c5d23fa40521ca6bef0dc3a1f</url>
            <link>https://paragraph.com/@phosphor</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[How to Create NFT Farcaster Frames Using Phosphor APIs]]></title>
            <link>https://paragraph.com/@phosphor/create-nft-farcaster-frames-with-phosphor-api</link>
            <guid>Sd56yu2tv9IRPaTmR73y</guid>
            <pubDate>Wed, 28 Feb 2024 16:39:43 GMT</pubDate>
            <description><![CDATA[In recent weeks, Farcaster Frames have gained a lot of attention for their endless potential. They can turn a regular social post into a dynamic expe...]]></description>
            <content:encoded><![CDATA[<p>In recent weeks, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.farcaster.xyz/learn/what-is-farcaster/frames"><u>Farcaster Frames</u></a> have gained a lot of attention for their endless potential. They can turn a regular social post into a dynamic experience that any developer can create, letting you collect reactions, play mini-games, or even showcase and mint NFTs directly from the feed. The latter is the most common use case by far. In this tutorial, you'll learn how to implement this kind of frame using the Phosphor APIs.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.phosphor.xyz/developer"><u>Phosphor APIs</u></a> are an <strong>all-in-one solution</strong> that helps you create, manage, and sell NFTs seamlessly. Phosphor API is for any type of developer to facilitate the convenience of paying blockchain fees with a credit card. This simplifies the process for users unfamiliar with cryptocurrency and/or private keys, while also enabling full ownership of smart contracts for those that want to retain total control over the collections deployed on-chain.&nbsp;</p><p>We'll leverage the API to allow Farcaster users to claim an NFT for free (this means, the transaction gas is paid by the NFT creator).</p><h3>Our goal</h3><p>We’re going to create a frame that:</p><ul><li><p>Gets the item data from a <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/platform-features/digital-asset-distribution/listings/"><u>listing</u></a> identifier.</p></li><li><p>Shows the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/platform-features/digital-asset-creation/items"><u>item</u></a> image and a button users will press to mint. The button shows the call to action with item title and quantities (remaining / total supply).</p></li><li><p>Requires that the user has liked the cast, and if not, asks the user to like and try again.</p></li><li><p>After mint, shows a success or error message.&nbsp;</p></li></ul><p>To make things really simple, we'll use the raw item image, without any overlay, and a single button, which at the same time will provide feedback messages.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/c6f04fcbe2399f6cfcbabdfc36d9fe0a.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAICAIAAAAX52r4AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAY3RFWHRSYXcACmdlbmVyaWMgcHJvZmlsZQogICAgICAzNAo0OTQ5MmEwMDA4MDAwMDAwMDEwMDMxMDEwMjAwMDcwMDAwMDAxYTAwMDAwMDAwMDAwMDAwNTA2OTYzNjE3MzYxMDAwMAozQmzXAAAC3ElEQVR4nE2QSWgTARiFfyiRutDWTrNMJjHpNM1qaVPNUjPTTGZJZpLMTDJppkmbmKi4K7iBqAcRvFRBUAt6EJEi6sGL1Uov0ouKIrYo4kkpblhprXVriwqRqhThO7z38U4PTPXWzTJ1hESPC7azWfwkAwdbIBKqA2W/70jxkAonErAnArvisFWELAHFFpB04DkH8BTgPuxLwm4vpHeCdAyKOyDHe7fJgfJ6Vg64mDhjbwkCXq29pFI3DijHimT/ltLpg5379ttKRWZ3tjzQd/j1KfgwJN29XBTPwOkh4sr5DYcpfLsVugcg39e4yVElAKj25ZEGbQSpo0lvVyRUoDuDzWuJRlMpzXhwNxCt5OT4+I9KZerZyOid4YvDfWdvXRt7Pj4//bby7dPc1Iu5nzPfZz8+/zA4WXk8W5men3j5/tHNr7/ezk9MPNzbP3T0zGD/hZHrg7evDj65+/jdqzeTU18ejIyN3ns083k6RiXBjLqSvJriu9NyqStVzMQLXfFeJZ6XhJ4Er0p8jxhVxZia5nvkaF6MqlKiNyWXpVguKaiyUuzKlLPpUlYp57IbFbkgJ/IpvjuXKWXTpYxYsKIuqAG9YSXuxNvceHs4yMUokSHidEigQ0KUFDkykeQUnpF5RqbD8QSbJtbQPCPxjMwRiVg4meQUMZrhKYn0s1Ism+QUgU3bra0uvM2wEq8BPSAazGbyeN0dXncHEeCodbFwiCcCHBHgyGA0tCZC+GiOSFCEQPpZ0s+ua6fIYLQzwJF+lvDRpJ+lQwLho4PecLhjwXcGuFZnwOsKNhndiAaDWjAg1aaGpeaGpWZEgyFVxvo/IH/RYIgGq69CF4zmX0U0GIrYjEgzprUb6ptQpMmI2BaM1o7+CSa9A9PZzQYnssS0cNEK0C2yHPSLLMoa0P8309YCakbdllUtVvNqTOcwGZxW82qjzm7BPGbUbTK4LJjHqHPYGtu0yyy/AaP/27f4yGYiAAAAAElFTkSuQmCC" nextheight="282" nextwidth="1064" class="image-node embed"><figcaption htmlattributes="[object Object]" class="">Our frame in its initial state</figcaption></figure><p>You can access the finished project repository at <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Consensys/phosphor-frame-tutorial"><u>GitHub</u></a> and a working version here at <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://phosphor-frame-tutorial.vercel.app">https://phosphor-frame-tutorial.vercel.app</a></p><h3>Before we start</h3><p>We'll assume that you already have created a <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/platform-features/digital-asset-distribution/listings/"><u>listing</u></a>, and have the corresponding <strong>listing identifier</strong>. If you haven’t, in the repo, you can find a <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Consensys/phosphor-frame-tutorial/blob/main/create-free-mint-listing.mjs"><u>this script</u></a> to help you create your own collection and get a listing identifier. Change the parameters in the script to your preferences and then run it using:</p><pre class="dont-break-out text-sm md:text-base"><code>node create-free-mint-listing.mjs</code></pre><p>To create a listing, you’ll need a Phosphor API key. <strong>Get your API key</strong> from <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.phosphor.xyz/developer"><u>https://www.phosphor.xyz/developer</u></a><u>.</u></p><div><div class="callout-base callout-tip" data-node-view-wrapper="" style="white-space:normal"><img src="https://paragraph.xyz/editor/callout/tip-icon.png" class="callout-button"><div class="callout-content"><div><p>Recommended reading: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://paragraph.xyz/@phosphor/developer-guide-phosphor">The Developer Guide to Getting Started with Phosphor</a></p></div></div></div></div><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/27166032546e1c01f9a26a4ff0592b71.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAACXBIWXMAAAsTAAALEwEAmpwYAAALZklEQVR4nE3V918TBhoG8Md6lloXIhpAhkwNQzAhshICYWSwV1gBApERJGCCTCEQZIOADAVjRcGaikZ7gHhItRyHxaOCiAwF9drzwIqCdzLU2pP76E/3/gHv9/O8zw8vnj97PD//25Phh1dk8vONZ35WNI59Vz8zfn9k7OXA3IdX82/mX6/I24bY0h88yibq5f1j0y+KB2dvDC9O3/1t/Mmz4aWFgeV3kx8/Tt6fHLv+49LSwuPBbmV+zmR7+/OHo69mHuN+Pu12Bu16oHccLCm6pCwf+kFV8CgWkdElHs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CG8yRaZlK1C0paTcVQ5V73IFV4GWEOkwD2XJbAopKKYAaEjfNzBdYaHGRw3wxxQFX3aDiXYDCSown4/nDxAYcLeco2HwQa2JYFJ1tmjAqa7HarZ9gP1WfWHAvK5rAwBV5hO4CVxsuMDzkkk95rFC+fJC1Pl1y8fZLSgffJAd2deVaC91AqZl01z5axUaLgB9C2gq+2gr9NyMDCM5IVFstnhgbFkrT2BztS46DDMzf72cXX149v5+Ym/Dz/sa77V+rcHs4uLb1dXP374/f3yu7crf/zx9t3iq+WhpY+zy38s//f98n9mp35/v7K6uvpI0fPz2T8PdfVODA6Pj0w8Gpl88/rNhw9/vH33+/TY9OLi8srS0v8Ash2pkiVUQ+sAAAAASUVORK5CYII=" nextheight="1080" nextwidth="1080" class="image-node embed"><figcaption htmlattributes="[object Object]" class=""><em>What if we inject Phosphor into a Frame?</em></figcaption></figure><h2>Getting started</h2><p>The concept behind Frames is actually pretty simple. Essentially, It’s an extension of the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ogp.me/"><u>Open Graph protocol</u></a>, relying on <code>&lt;meta&gt;</code> tags and optionally a backend handler for buttons (refer to the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.farcaster.xyz/reference/frames/spec"><u>specification</u></a>). However, manually crafting <code>&lt;meta&gt;</code> tags can quickly become tedious and state management can become overwhelming.</p><p>That’s why we’ll use the excellent <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://framesjs.org/"><u>frames.js library</u></a>, which abstracts a lot of the frame state and generation complexities by leveraging familiar React patterns. Additionally, we'll base our repository on the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://framesjs.org/#1-clone-the-framesjs-starter-template-with-local-debugger"><u>frames.js starter template</u></a> – a Next.js project that provides a tool to debug your frames locally (eg. user impersonation, button testing, mock cast reactions, and more).</p><h3>Exploring the code</h3><p>Follow the instructions on the provided <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Consensys/phosphor-frame-tutorial"><u>README</u></a> to install dependencies, start the server, and familiarize yourself with the project structure.</p><p>A frame created with frames.js and React consists of two parts:</p><ol><li><p>A React component (in our case, <code>app/listing/[slug]/page.tsx</code>) which contains most of our frame code.</p></li><li><p>A route handler for POST requests (in our case, <code>app/listing/[slug]/frames/route.ts</code>, which is completely handled by a frames.js function).</p></li></ol><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/ad1b24aad4c620af632ae7a06928a974.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAaCAIAAABZ+cloAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAY3RFWHRSYXcACmdlbmVyaWMgcHJvZmlsZQogICAgICAzNAo0OTQ5MmEwMDA4MDAwMDAwMDEwMDMxMDEwMjAwMDcwMDAwMDAxYTAwMDAwMDAwMDAwMDAwNTA2OTYzNjE3MzYxMDAwMAozQmzXAAAFt0lEQVR4nJVW608UVxSf3U5hundm7szO484uKj6W1xTKEnZZdQGRZ3UBtwURKqu4LgRqV2ClPIogrisrPjGARApuEEITE4NaJPLFEBtiStJvxvrFpv+CSWP8RjM7QFEXqDcnk5k7557fuef3u2cG43nhYxNEtOZeXMdHXM9h7Qy2eofQclCW1QMC8MoQIAkhCXme5/S8IIosq1d9GMiSBKWHyiMFKJbVCyJSHTg9H16+BgCFh1aLq693xJsqW9zxackkQSWlfZlZkidbzYKIKEAjo5HT84YtMQmp8uGm41kleTiG51c4EtJkQAAGsoIoWnLtrs56HU6qZVAAaBp6PLWlpYd+8HoNyCDbzP2/jbeM+i9MD5y73983N9IaCvQvTDYOdZ2fHmge7k5Ila25drff6wk0XXw05Bs93z7em+0sbBm9cOXpWG3fmdo+HyThfwAsq9+6dVt7e3tGhk2D4bLV3L8w2TERvPPyYWso0BoK3FyYqGxxX3061jf386W5kT1F+3Ylxtf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sAgohyqxuO+W856n5EkhGS8KC7vOBoqWw17684kJZlq/SdkK3mQw2VDGRL6454gr59zkJrvt1WkGWS4zcpkcrtocaug3U+l38wNi6R54XBxamLs7euzYfml/688exucPb2gzfPF5b+ynYWlnmrg7O3J17PNg93zy+9MmdmkAQV8VSv7kBkaDopI/Prk82WvGJWOcbC6Ivp76+2Ng51XZge8I30zLxdbBzqbg0FcisPOtzl1R21zcPdnt7mhuvt5syMiBr9WEU8Q9NsWDyCKKbn7GEgAwhAaIi07N3fnjrKQAaSkNPzLKtXfkEUUSit6dN60aqF/4gUpPCXUvkovu+g5Ctu2Ih4XvgXpwqsjY0kJrUAAAAASUVORK5CYII=" nextheight="188" nextwidth="228" class="image-node embed"><figcaption htmlattributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3>Implementation steps</h3><div><div class="callout-base callout-info" data-node-view-wrapper="" style="white-space:normal"><img src="https://paragraph.xyz/editor/callout/information-icon.png" class="callout-button"><div class="callout-content"><div><p>All of the following code snippets can be found in <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Consensys/phosphor-frame-tutorial/blob/main/app/listing/%5Bslug%5D/page.tsx"><em><u>app/listing/[slug]/page.tsx</u></em></a> within the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Consensys/phosphor-frame-tutorial"><u>phosphor-frame-tutorial</u></a> repository.</p></div></div></div></div><h4>1. Get the frame message and validate it</h4><p>The first step involves retrieving the frame state (via search parameters) and the signed message generated when a user presses a frame button. For this, we use the frames.js function <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://framesjs.org/reference/js/getFrameMessage">getFrameMessage</a>.</p><pre class="dont-break-out text-sm md:text-base"><code>export default async function Home({ params,  searchParams }: NextServerPageProps) {
  const previousFrame = getPreviousFrame&lt;State&gt;(searchParams)
  let listingId = params.slug
  const [state] = useFramesReducer&lt;State&gt;(reducer, initialState, previousFrame)

  // Keep in mind that frameMessage is undefined on the first frame
  const frameMessage = await getFrameMessage(previousFrame.postBody, {
    ...HUB_OPTIONS,
  })
  console.log({ frameMessage })

  // Check the frame payload for validity
  if (frameMessage &amp;&amp; !frameMessage.isValid) {
    throw new Error("Invalid frame payload")
  }</code></pre><p>To validate the frame message and determine whether the user has liked the cast, we need access to a <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.farcaster.xyz/learn/architecture/hubs"><u>Farcaster Hub</u></a>. There are many alternatives available, but for this tutorial we’ll use the <em>free</em> <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.pinata.cloud/farcaster"><u>Pinata Farcaster Hub</u></a>. You can switch to a different hub (such as Neynar) by setting a different value for <code>FALLBACK_HUB_OPTIONS</code> in the <code>app/constants.ts</code> file.</p><p>We use the <code>slug</code> parameter to pass the <strong>listing identifier</strong>. Why call it <code>slug</code> in the code? Simply to reuse the type <code>NextServerPageProps</code> (from <code>frames.js/next/server</code>), which already defines it.</p><h4>2. Get the recipient’s address</h4><p>Next step is to get the recipient's address from the frame message:</p><pre class="dont-break-out text-sm md:text-base"><code>const userAddress: string | undefined =
  frameMessage?.requesterVerifiedAddresses?.[0] ||
  frameMessage?.requesterCustodyAddress</code></pre><p>We adopt a straightforward approach by using the first verified address, if available, and defaulting to the custody address otherwise. While we can count on the custody address being always available for a valid message, the verified address is more user-friendly. It’s worth noting that during the first frame, when <code>frameMessage</code> is undefined, <code>userAddress</code> will also be undefined.</p><h4>3. Get the listing data and validate it</h4><p>Next, we get the listing data and validate it. To achieve this, we use the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/latest-public-api#/paths/~1v1~1listings~1%7Blisting_id%7D/get"><em><u>GET /listings/{listing_id}</u></em></a><em> </em>endpoint.</p><pre class="dont-break-out text-sm md:text-base"><code>const listing = await requestPhosphorApi(`/listings/${listingId}`)

let errorMessage = await validateListing(listing, userAddress)</code></pre><p>The validation process includes a call to the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/latest-public-api#/paths/~1v1~1listings~1redemption-eligibility/get"><em><u>GET /listings/redemption-eligibility</u></em></a> endpoint, which will provide us with additional information about the user’s eligibility at that moment.&nbsp;</p><div><div class="callout-base callout-tip" data-node-view-wrapper="" style="white-space:normal"><img src="https://paragraph.xyz/editor/callout/tip-icon.png" class="callout-button"><div class="callout-content"><div><p>Learn more about <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/platform-features/digital-asset-distribution/listings/"><u>listings</u></a> and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/platform-features/digital-asset-distribution/listings/listing-policy"><u>listing policies</u></a> at the Phosphor documentation site.</p></div></div></div></div><pre class="dont-break-out text-sm md:text-base"><code>async function validateListing(listing: any, address: any) {
  if (!listing || listing.error) {
    return "Listing not found"
  }
  if (!listing.payment_providers.includes("ORGANIZATION")) {
    return "Invalid listing"
  }
  if (listing.quantity_remaining === 0) {
    return "No more items remaining"
  }
  if (listing.end_time &amp;&amp; new Date(listing.end_time) &lt; new Date()) {
    return "Listing has ended"
  }
  if (address) {
    const eligibility = await requestPhosphorApi(
      `/listings/redemption-eligibility?listing_id=${listing.id}&amp;eth_address=${address}`
    )
    if (!eligibility?.is_eligible) {
      if (eligibility?.quantity_claimed === eligibility?.quantity_allowed) {
        return "You have already minted this item"
      }
      return "You are not eligible to mint this item"
    }
  }
}</code></pre><h4>4. Add other checks </h4><p>Once the listing validation is completed, we add a validation about the cast itself. In this case, we added the requirement of liking the cast.</p><pre class="dont-break-out text-sm md:text-base"><code>if (!errorMessage &amp;&amp; frameMessage?.likedCast === false) {
  errorMessage = "Mmmh... maybe if you like it first? Try again"
}</code></pre><h4>5. Create a purchase intent </h4><p>Now, with an eligible user address at hand and all validations passed, we are ready to create a purchase intent using the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/latest-public-api#/paths/~1v1~1purchase-intents/post"><em><u>POST /purchase-intents</u></em></a> endpoint. The response can be used to check errors or to monitor the status of your request (see ideas for improvements below).</p><div><div class="callout-base callout-tip" data-node-view-wrapper="" style="white-space:normal"><img src="https://paragraph.xyz/editor/callout/tip-icon.png" class="callout-button"><div class="callout-content"><div><p>Learn more about <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/platform-features/digital-asset-distribution/listings/purchase-intents"><u>purchase intents</u></a> at the Phosphor documentation site.</p></div></div></div></div><pre class="dont-break-out text-sm md:text-base"><code>if (!errorMessage &amp;&amp; userAddress) {
  const purchaseIntent = await requestPhosphorApi("/purchase-intents", {
    method: "POST",
    body: JSON.stringify({
      provider: "ORGANIZATION",
      listing_id: listing.id,
      quantity: 1,
      buyer: { eth_address: userAddress },
    }),
  })

  if (purchaseIntent.error) {
    console.error({ purchaseIntent })
    errorMessage = "There was an error minting this item"
  } else {
    console.log({ purchaseIntent })
    errorMessage =
      "Your item has been minted successfully. It could take up a few minutes to arrive..."
  }
}</code></pre><h4>6. Get the item data</h4><p>Regardless of the status of our frame flow, we’ll present the item image. To get its URL, we use both the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/latest-public-api#/paths/~1v1~1items/get"><em><u>GET /items/{item_id}</u></em></a> and the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/latest-public-api#/paths/~1v1~1collections/get"><em><u>GET /collections/{collection_id}</u></em></a> endpoints.&nbsp;</p><div><div class="callout-base callout-tip" data-node-view-wrapper="" style="white-space:normal"><img src="https://paragraph.xyz/editor/callout/tip-icon.png" class="callout-button"><div class="callout-content"><div><p>Learn more about <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/platform-features/digital-asset-creation/items"><u>items</u></a>&nbsp; and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/platform-features/digital-asset-creation/collections"><u>collections</u></a> at the Phosphor documentation site.</p></div></div></div></div><pre class="dont-break-out text-sm md:text-base"><code>const { imageUrl, title, collectionName } = await getItemData(listing)</code></pre><pre class="dont-break-out text-sm md:text-base"><code>async function getItemData(listing: any) {
  if (!listing || listing.error) {
    return {}
  }

  const item = await requestPhosphorApi(`/items/${listing.item_id}`)

  const collection = await requestPhosphorApi(
    `/collections/${item.collection_id}`
  )


  let imageUrl = item.media.image.full
  if (!imageUrl) {
    imageUrl = collection.media.thumbnail_image_url
  }
  const title = item.attributes.title
  const collectionName = collection.name


  return { imageUrl, title, collectionName }
}</code></pre><h4>7. Render the frame</h4><p>Finally, we render our frame. Frames.js handles the generation of all necessary <code>&lt;meta&gt;</code> tags based on the <code>&lt;Frame*&gt;</code><em> </em>elements.</p><p>To make debugging easier, we also generate some content visible to browser users. Normally your app content would go there.</p><pre class="dont-break-out text-sm md:text-base"><code>const listingUrl = `/listing/${listingId}`
const isLocalhost = APP_BASE_URL.includes("localhost")
return (
  &lt;&gt;
    {/* These elements will generate the Frame &lt;meta&gt; tags */}
    &lt;FrameContainer
      pathname={`${listingUrl}`}
      postUrl={`${listingUrl}/frames`}
      state={state}
      previousFrame={previousFrame}
    &gt;
      &lt;FrameImage src={imageUrl} aspectRatio="1:1" /&gt;
      &lt;FrameButton&gt;
        {errorMessage ||
          `Like cast to mint "${title}" (${listing.quantity_remaining}/${listing.quantity_listed})`}
      &lt;/FrameButton&gt;
    &lt;/FrameContainer&gt;

    {/* This is the content visible to browser users */}
    ...</code></pre><h4>Try your frame locally </h4><p>Start the local server executing:</p><pre class="dont-break-out text-sm md:text-base"><code>npm run dev</code></pre><p>Let’s say the listing identifier is <code>a414b244-9174-4ab5-9ac5-f366b9d48307</code>, your local frame URL is: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://localhost:3000/listing/a414b244-9174-4ab5-9ac5-f366b9d48307"><u>http://localhost:3000/listing/a414b244-9174-4ab5-9ac5-f366b9d48307</u></a></p><p>You can also view it in the debugger by opening the following link:</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://localhost:3000/debug?url=http://localhost:3000/listing/a414b244-9174-4ab5-9ac5-f366b9d48307"><u>http://localhost:3000/debug?url=http://localhost:3000/listing/a414b244-9174-4ab5-9ac5-f366b9d48307</u></a></p><p>The frames.js debugger has a few cool features. Among others, you can impersonate an arbitrary user and, especially relevant to our project, you can mock hub states such as whether the requester has liked the cast.</p><div><div class="callout-base callout-warning" data-node-view-wrapper="" style="white-space:normal"><img src="https://paragraph.xyz/editor/callout/warning-icon.png" class="callout-button"><div class="callout-content"><div><p>Next.js can take a while to compile some routes the first time. If you get error messages on the frame validations because of the timeout, simply refresh the page and try again.</p></div></div></div></div><p>Here is a video that shows how our frame should behave:</p><div data-type="youtube" videoid="gv1JO360zhw">
      <div class="youtube-player" data-id="gv1JO360zhw" style="background-image: url('https://i.ytimg.com/vi/gv1JO360zhw/hqdefault.jpg'); background-size: cover; background-position: center">
        <a href="https://www.youtube.com/watch?v=gv1JO360zhw">
          <img src="https://paragraph.xyz/editor/youtube/play.png" class="play">
        </a>
      </div></div><h3>Deploy your frame</h3><p>The last step is to deploy your frame to a public host, so that Farcaster can access it.&nbsp;</p><p><strong>Congrats, you’ve completed the tutorial and created your first Farcaster Frame powered by the Phosphor APIs!&nbsp;</strong></p><h3>Conclusion</h3><p>Today, we learned a lot! But remember, this is just the beginning of the journey. You can <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.phosphor.xyz/developer"><u>sign up for early access to Phosphor</u></a> and be among the first to explore its capabilities.&nbsp;</p><p>So, let your creativity flow, have fun, and build awesome frames with the Phosphor APIs!</p><h3>Ideas for improvements</h3><ul><li><p>Enhance the user experience by displaying feedback messages (errors, instructions, etc.) as overlays on the image or as separate frames.</p></li><li><p>Create a frame that shows the payment intent status using the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/platform-features/digital-asset-distribution/listings/purchase-intents/get-purchase-intents"><em><u>GET /purchase-intents</u></em></a><em> </em>endpoint and the payment intent identifier you got after creation.</p></li><li><p>Generate a button that redirects to the transaction status on Etherscan (or similar for the network you’re on) using the endpoint <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/platform-features/supporting-functionalities/transactions/get-transactions"><em><u>GET /transactions</u></em></a><em> </em>to get the<em> </em><code>tx_hash</code><em>.</em></p></li><li><p>Require the user to follow a specific account to mint. You can check whether the requester is following the account that posted the frame using <code>frameMessage.requesterFollowsCaster</code>, but you might want to require following the original artist's account, for example.</p><div><div class="callout-base callout-tip" data-node-view-wrapper="" style="white-space:normal"><img src="https://paragraph.xyz/editor/callout/tip-icon.png" class="callout-button"><div class="callout-content"><div><p><strong>Hint:</strong> use your preferred hub's <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.thehubble.xyz/docs/httpapi/links.html"><u>Links API</u></a> or equivalent in other services. For example, to check whether fid 1 follows fid 2 using Pinata Hub: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://hub.pinata.cloud/v1/linkById?fid=1&amp;target_fid=2&amp;link_type=follow"><u>https://hub.pinata.cloud/v1/linkById?fid=1&amp;target_fid=2&amp;link_type=follow</u></a></p></div></div></div></div></li></ul><p></p>]]></content:encoded>
            <author>phosphor@newsletter.paragraph.com (Phosphor)</author>
            <author>phosphor@newsletter.paragraph.com (Ricardo Stuven)</author>
            <category>developers</category>
            <category>guide</category>
            <category>phosphor</category>
            <category>farcaster</category>
            <category>tutorial</category>
            <enclosure url="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f3e57e5abc9d0d7c16d3e400514fed05.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[The Developer Guide to Getting Started with Phosphor]]></title>
            <link>https://paragraph.com/@phosphor/developer-guide-phosphor</link>
            <guid>HufrY44lFjK0S9YPS1bz</guid>
            <pubDate>Tue, 27 Feb 2024 23:34:16 GMT</pubDate>
            <description><![CDATA[Exploring the vibrant world of NFTs brings a mix of creative thrill and technical challenges, from navigating smart contracts to tracking digital ass...]]></description>
            <content:encoded><![CDATA[<p>Exploring the vibrant world of NFTs brings a mix of creative thrill and technical challenges, from navigating smart contracts to tracking digital assets across various blockchains. Phosphor simplifies the management and lifecycle of NFT drops through an advanced API that sidesteps the complexity of direct smart contract interactions. Phosphor transforms the complex tasks associated with managing digital collectibles into a seamless, enjoyable process.&nbsp;</p><h3>Why use Phosphor as a developer?</h3><p>Phosphor enables creators to efficiently generate and administer NFT collections, facilitate the distribution and listing of assets, and securely handle the collection of royalties and payments for both non-fungible and semi-fungible items using a set of simple API commands.</p><p>The platform is built to support NFTs based on ERC-721 and ERC-1155 standards and is compatible with multiple blockchain networks, including Mainnet, Polygon, Linea, and Palm, out of the box. Additionally, it offers the flexibility to integrate with other EVM-compatible sidechains and Layer 2 solutions through manual configuration, providing users with a versatile and powerful tool for NFT management.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/7189a00fcf224c3a7ab5eb21e469a262.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAPCAIAAAAK4lpAAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEAUlEQVR4nH1T3W/aVhRnD5u0h0qT9vfsaU972dOepj5MqzS1W6WmnRqRToSYbxwIBVwGcYmxMbuxMf6OAScmjJI5hMaKkxBoOtItykfVRlGlrdPeNpkbpWk6zfrp6Oic4/u795zfcQ3s1eNnvcdtwzIb/4OBbe5Y7XfjdqcJU5ew3W2dHDzpb5iuYa8rAELlinUJ1CWgCQ5Unq6KZ35VBCJLNDVB5WmVK2oCqEvzToovVUUgAGKtVYMnvoPm4XDbtdaqyS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qPbHZXLhX8vru5N9g4Pf7tr1fPX58e/XFy8KdjD1+fHv/z96uB3fkX7h3MAt6oqMEAAAAASUVORK5CYII=" nextheight="718" nextwidth="1564" class="image-node embed"><figcaption htmlattributes="[object Object]" class="hide-figcaption"></figcaption></figure><ul><li><p><strong>Full Ownership of Smart Contracts</strong>: Users retain total control over their smart contracts, with Phosphor facilitating their management.</p></li><li><p><strong>Contract Versatility and Security</strong>: Provides a selection of pre-audited contract templates or the option to use custom contracts, all audited by Diligence for enhanced security.</p></li><li><p><strong>Efficient Minting Infrastructure</strong>: Features a robust infrastructure for multi-wallet minting, streamlining the NFT creation process.</p></li><li><p><strong>Bulk Minting Capability</strong>: Allows the creation of hundreds of NFTs with a single API call, perfect for extensive collections or projects.</p></li><li><p><strong>High Customization Options</strong>: Supports extensive customization for creating branded storefronts and personalizing email communications, including SMTP email provider integration.</p></li><li><p><strong>Comprehensive API for NFT Lifecycle Management</strong>: Simplifies the entire lifecycle of managing NFT drops, from creation to royalty collection, through straightforward API calls.</p></li><li><p><strong>Secure Royalty and Payment Processing</strong>: Ensures the secure collection of royalties and payments from both non-fungible and semi-fungible assets.</p></li><li><p><strong>Flexible Integration Options</strong>: Allows for the integration of additional EVM-compatible sidechains and Layer 2 solutions, offering flexibility for users to expand their NFT projects' capabilities.</p></li><li><p><strong>Credit Card Payments for Blockchain Fees</strong>: Facilitates the convenience of paying blockchain fees with a credit card, simplifying the process for users unfamiliar with cryptocurrency.</p></li><li><p><strong>No web3 experience required</strong>: Phosphor API is for any type of developer to facilitate the convenience of paying blockchain fees with a credit card. This simplifies the process for users unfamiliar with cryptocurrency and/or private keys, while also enabling full ownership of smart contracts for those that want to retain total control over the collections deployed on-chain.</p></li></ul><h3>Phosphor dashboard for developers</h3><p>The Phosphor Dashboard, serves as a command center for users. Upon signing up for Phosphor Developer, users are allocated to an organization, streamlining activities and features. This organization-centric approach facilitates straightforward and secure management of API keys, user roles, collections, and communications. It also includes tools for payment integration, email marketing, and real-time notifications via webhooks, simplifying NFT management for creators and collectors.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/f54958d5d70093bc784e4272e84fee41.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAATCAIAAAB+9pigAAAACXBIWXMAAAsTAAALEwEAmpwYAAACLElEQVR4nO2UQU9UMRDH+xm4+AX4Bsp+ApTVRGNMRC5GYmKMiXKRFSIHPInEDX4CEs98Bg/GKMYExShxMVkIC7oBRfbte+1rZ6btmLa4HvSiqzf+mTTTvtf5zUz7nuClpUfj9ZmLc/dGH8xemqudnZ0YmZkYnrk5HMaJv7JbJ+/ers7WL9eZl0RjvjY5ulC79nj6xuKd64tjp+5fvVC/cm7+TGW6OjR1+of96leHpqon4picaOGFyvTI8anx8wuTYw+f12qiOjjQeLa5sSbXV/dbzbzdKrNOubd7sLd7YAwkAwOIBIDRRwSCIEyLPQeRjEFZGCUNM39t7gwKIQaFyFq7zGxKctYzs3OuLLWU0jnHUdZaQLDWMrP3HhG9d9ZaRHDOESEAkCUAY51lHyIwc7bVHkiATgToEsGQi1KqVKrEsMtZYq1knh3khQz5Gup2CwTqdlWnk+nS5HlRFFJKlWVdMGStUxKYudP6FAAVIb5ttJkZNPUAWmsiSvl6z0zS6SwvpC5LIlJKOeeL3EgpjTFx6gBAa53K7eyrCIgVVMTAIcBgDOdj1UFpGuRiAwCJQgYA4JxPJ0FEiJi2IGLqsC7xN4AUMVXAfcrxT0A45J1wBs66mK3/94AiAtJq6vsRwB216A9bJHf2eo/SNfX9iRNg+/PhhybbX/q8pr4XOm2PoYr2fvibHhOi8fRlc2Vt/cWbj8urzVfvtl6v9WmbK++3335oPFk+Jv6/vgMcg8o7aV9YVAAAAABJRU5ErkJggg==" nextheight="974" nextwidth="1600" class="image-node embed"><figcaption htmlattributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Prior to creating a collection, it's essential to generate an API key within the Phosphor Dashboard. This key grants access to a wide array of NFT management features, enabling secure interaction with the Phosphor API. With this key, we can seamlessly create, manage, and distribute our NFT collections, ensuring smooth integration of digital assets within the Phosphor ecosystem and a streamlined start to our NFT projects.</p><p>Head over to User Profile and you will find the API keys option. Make sure to create your own API key first.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/a36a241cf39edcdb6a97de7fb97bf4fc.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAATCAIAAAB+9pigAAAACXBIWXMAAAsTAAALEwEAmpwYAAACJ0lEQVR4nO1UTWuTQRDe3/Be+gfyE2J+gWJSDxZUEKUQ8BpzUGMav3rS+hFFPAqioKeePHj04MFWrFWLBhttbJpE3ySaNDHN7rs7uzsru0nTgrS2gV7Eh4dlhxn22ZnZWWLMdDaezYxdvXL0+uVjU2dik8mDFxP7LZPD8vSBC2ejk9nxrDHT5OmN1MSJu5nEo0vJh5nEg/FDU6eO3I4fvjkamYjuS1uG07FwOub2g3UbjkYy0fD5+Nidc8dvvUylSIR4fr5Mqeq0Ge3ygHPGglq12W51QErOQQgQQnAu7MaZnIutGARitdn51aJozM9CJUQICRHSLtWMMYKDVmiMQURKA84FokaUCowUBlErpRBRa41ow7aC9WptjGmv+F5PoOUEOBOCS+3gjtMAIKWkbdVZVVJKIYSUCgCUsiF/EtGAUPmFem7O/1agja8ugwjx6ku+1oZ2gXUlCKWU1R8OAZOP7725f23m2ZMv9SUncNLzludK1aIq5jvNGjSqgjMVMKZsMqg1KqkpZZQylzr+lVbH3bBVciWKEK/hMhDc3l26InHujHUEQSB7jh0AhGw16IZAiJC1iu2B6wy6Jg1foj42Z7BJoO/d/pHsCP8F/sESyf6cS0S079uN6oZAt1IfhA5+m10BADjnAKC1thPTEyh/7w9a1/+xFyVa8xv2qxghZPHFq8J8Lj/z7vPs+8LrDytvc7tlcZ09c3n+Y3nh0+Lz2RGy9/gNfBzIxkFdaXQAAAAASUVORK5CYII=" nextheight="974" nextwidth="1600" class="image-node embed"><figcaption htmlattributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>We can use two types of token standards for phosphor, ERC721 and ERC1155.</p><p>The Phosphor platform provides a few default contracts that users can pick, including <em>FrozenERC721</em>, <em>FrozenERC1155, FlexibleERC721, FlexibleERC1155</em>, and <em>SignatureERC721.</em></p><p>You can check more about using platform contracts over <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/platform-features/digital-asset-creation/collections/collection-contract/platform-contract"><u>here.</u></a>&nbsp;</p><p>ERC-721 handles transactions on a one-token-at-a-time basis, suited for individual transfers. In contrast, ERC-1155 supports batch transfers, enabling multiple token types to be sent in a single transaction, significantly enhancing efficiency and reducing costs.</p><p>You can also use a custom contract, meaning <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/platform-features/digital-asset-creation/collections/collection-contract#bring-your-own-contract"><u>bringing your own contract (BYOC)</u></a>.</p><h3><strong>Creating collections with Postman</strong></h3><p>Let's dive into creating and managing our NFT collection. We'll start by creating different collections that leverage the strengths of both ERC-1155 and ERC-721 standards, each suited for different use cases of our project. First we need to get the postman collection from <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.consensys-nft.com/quickstart#postman-collection-for-api-quickstart"><u>here</u></a> .</p><p>Head over to the postman and import the collection, and you’ll notice a few quickstarts that are given to you. If you’re new to Postman, then <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://learning.postman.com/"><u>here’s</u></a> the learning resource. </p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/2c6099378ccfd26cfec1231417b2b123.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAWCAIAAAAuOwkTAAAACXBIWXMAAAsTAAALEwEAmpwYAAACe0lEQVR4nO2Vv0scQRTHp936mriFgam2PExz5ZUp/QMSsqbxtoos5gIbNIFBsRgkBAY0hKzlFMaDIQgy3ElgTKFkNNWCARMmvyCDJqCTKscG98mi3h2KpPRTLMuw+/2+79vHWxQVjI6OBkFAKY3jGGMcRZEu2Nh4BzetVuvBxMTtgjAMhRDqLFJKxhjn/MbQEEJobOx+vV6nlKIkSTDGnucRQqSU8GYYhkEQYIw77fbc7MyT6anmw8nXy8tZlhlj7ACEEJxzrbVzzlqrtSaEoEql4vs+L5BSQjnwKGOs024/ftRsTsb37t7Z2db5AKy1SiljDFyhDuecEAIhhDzPS5LE931cEIYhKyCEcM7HGw1CyHijIYQ4+P1La62UAgljjNZ679NelmVKKedceW6tdc5JKREt4JxHUVSpVDzPwxj7BZDgBWMfd3eN+bK5tfntx/cPOztQJtBpd7a232dZdrC/fy6Wc04pdWIA/apWq0EQ1Gq1arVar9eVUtbaPM+hY9A6aGOapkIIY0yvKHwDuD9OkBYopTjnSZLEcZwkCSGEMQaV5nleq9VQPxhjp6XzPIfzMwlKA+gsAKNZGhhjoHBZAJMGsaSUnPMsy0B0+OZwHMelwXGCMnVfTGEQxzFCKAgCQkiappTSNE0ZY5RSmAWlFIguLizeGhmJoogxdmIwSPq0gSv42+0OGtNznwGA6Jcy6KGb591SqJTr5bIGq2vrc/OsOTX7fGFpemb+6eyzz+ZrX8UrGvwpODxycD086l/v1Q2uzLXBhVy36EKOWwR7rdxu/39MYTMDvQblH+oc1v5c77x99XIJ9uub1dWV1grszXLFSinTNP0HeuOY5fXPtwoAAAAASUVORK5CYII=" nextheight="1116" nextwidth="1600" class="image-node embed"><figcaption htmlattributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Let’s go to <strong>variables</strong> on postman, there add your API key and your wallet address. Variables is mostly to store your environment variables.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/b986228866fc0180d6078955be144c41.png" blurdataurl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAPCAIAAAAK4lpAAAAACXBIWXMAAAsTAAALEwEAmpwYAAADZklEQVR4nIWU20sjVxzHpyXOTOZ2zlySlHiSSE26dO2bbxpoBrsajRRsXdBlX40xGqX0DyiFQqEv/Q+2hcUIffVFU7rVQmH/BjWZOBknM+nKpo012c3AlMwxIXXt9sNw5sz1+7sTEEJpCFmW37yUvVXs4/P5CIJ45w0IgqBpevAm3hCSJEEIWZb19+E4jmEYvKdpmmEYmqYBAIMvV1ZWCoXChkc+n8/lcuvr69lstlAopFIpjuOGrSEghIFAYGpqKplMfuwxMTExOTmZSqXm5+cfeMzMzMRiMeAxOjp6fn7uum6r1ep0OldXV47juK7b7XZd193d3SVJUpbl2wJzc3OLi4sPPRYWFjKZzPLy8uzsrKqqyWRSVVWEEIQQAIAQ0jSt3W5Xq1Vd1w3DsCzLtm3DMPoClCwr/xJQFCWdTk9PT3/ukclk0un00tJSMBgkSXI4RIIgIISwBxemadt2vV63LMswDHxzb29vZMQniiKEAELQE8A6giAAACCEQh+e50VRHOQcJw0LaJrmuu7Lyxd/NBrGxYVpmrVaTdd7Ak+f7ilK6P79j+7d+3B8PAEhvBGQ+3+ShxguJ9F7JghCJBI5OzvrdF79+cLUKqflcqVcLp+cnJyenr5+7fz4w08QhmKxDxCKh8OxGw8UReF4wc+wLMsMDp7ncTkxDMNznMiyEgCiJCGEqudV13X/7rZMu2ZemIZh1Go1nINisXg7RL0yFcXvv/v2+e/HpdKz0uFRqXR8ePjr/v7+wcHBs6Oj58e/ffPkycgvP49//ZVAUZFoFAtcd1v1htmwG5Zl4SjhHNyuIhyBh58tbRfyGxtbm5vbudxWdj2/traWzWY3t7a+2N7+9PGj93NfogefAI5DkQjOZ/OvZqNh4wzX63Vd1/9TQFEUhmVJkqQoyustiqIpv99PedA0zTNMgFNEhpEkadAHzWbz8vISm4/L1HGcYrF4W8ArDzkQUAIeys05oPR3spft98LxXpJ5HiFUqVRc17Xtnvmmaeq6rmlapVJxHOeORhPfCoQwFAohhGKxRDQaDQaDAw+ur687nU673X7l0W637+7k4blxp0A4HI7H42NjY4lEAvfz6uoqnkX5fB6veCLt7Oyoqjo8iyRJ+h8PRFEEAAxaD4Be5fl8vnc93j5NsX3/AB6Et7AII89jAAAAAElFTkSuQmCC" nextheight="718" nextwidth="1564" class="image-node embed"><figcaption htmlattributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3><strong>Airdrop 1 NFT to multiple addresses</strong></h3><p>First up, we have the airdrop quickstart. Airdrop refers to the free distribution of tokens or coins to the blockchain community's wallet addresses, typically used for promotion, rewarding loyalty and encouraging adoption. For this, we'll lean on the ERC-1155 standard due to its flexibility in handling multiple types of tokens under a single contract. This makes it perfect for distributing a unique NFT to a wide array of recipients efficiently. Whether it's directly minting to wallet addresses or sending out personal claim links via email, ERC-1155's ability to batch process transactions will save us time and reduce costs.</p><p><strong>Steps to Follow:</strong></p><ol><li><p><strong>Add an item as ERC-1155 NFT to the collection</strong> and lock it for minting.</p></li><li><p><strong>Execute the airdrop:</strong></p><ul><li><p>Mint the NFT directly to recipients with wallet addresses.</p></li><li><p>For recipients with email addresses, send a personal claim link to redeem the NFT.</p></li></ul></li></ol><p><strong>Why ERC-1155?</strong> ERC-1155 is chosen for the airdrop phase due to its versatility and efficiency in handling bulk operations, making it cost-effective and straightforward to distribute the NFT to a diverse recipient list without the need for individual transactions for each transfer.</p><h3><strong>Sell multiple NFTs</strong></h3><p>Next, we're setting the stage for selling exclusive NFTs. Here, the ERC-721 standard shines by allowing us to offer individual, one-of-a-kind tokens, each with its own distinct properties and value. This part of our project is all about giving collectors something special they can own exclusively, which is why ERC-721's emphasis on uniqueness is key. We'll add these NFTs to our collection, lock them for minting, and then create a listing for the sale. This phase is about connecting our unique digital creations with those who value them most.</p><p><strong>Steps to Follow:</strong></p><ol><li><p><strong>Add multiple ERC-721 NFTs to the collection</strong>, locking them for minting.</p></li><li><p><strong>Create a primary market </strong><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.consensys-nft.com/platform-features/digital-asset-distribution/listings"><strong><u>listing</u></strong></a> to put these NFTs up for sale.</p></li><li><p><strong>Generate a purchase intent</strong> for customers, facilitating the sale process.</p></li></ol><p><strong>Why ERC-721?</strong> ERC-721 is selected for the sale of unique NFTs due to its standard for one-of-a-kind digital assets, making it ideal for creating and selling individual pieces of art or collectibles. This ensures that each NFT sold is recognized as a distinct entity, appealing to collectors and investors seeking exclusive ownership.</p><h3><strong>Snapshot an NFT smart contract</strong></h3><p>Finally, understanding the distribution and engagement within our collection is crucial. We'll wrap up by generating a snapshot of our NFT contract. This isn't just about crunching numbers; it's a powerful way to see who's holding our tokens and how our collection is growing over time. Whether our tokens follow the ERC-721 or ERC-1155 standard, this snapshot gives us a clear picture of our community's landscape, aiding in future decisions and strategies.</p><p><strong>Steps to Follow:</strong></p><ol><li><p><strong>Request a snapshot generation</strong> of the NFT contract, utilizing custom options to target specific details like the list of active NFT holders.</p></li><li><p><strong>Monitor the snapshot generation status</strong>, acknowledging that the process may take a few minutes based on the complexity and selected options.</p></li><li><p><strong>Retrieve the list of NFT holders</strong> once the snapshot generation is completed, gaining insights into the distribution and engagement of your collection.</p></li></ol><p><strong>Why Snapshot Across Both Standards?</strong> The snapshot process is essential for both ERC-721 and ERC-1155 tokens because it offers a comprehensive view of the token distribution regardless of the type. For ERC-721 tokens, snapshots help identify the unique ownership of individual assets, which is crucial for collections where each piece is distinct. For ERC-1155 tokens, snapshots can reveal the distribution of both fungible and non-fungible assets within a single contract, offering insights into how different types of assets are held across the community.</p><p><strong>Tools and Resources:</strong></p><ul><li><p>Utilize the Phosphor Quickstart Postman collection to execute this comprehensive scenario within your own organization, leveraging the platform's API for streamlined management and deployment of your NFT project.</p></li></ul><h3><strong>Other resources you might want to explore:</strong></h3><p><strong>Phosphor Snippets:</strong></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Consensys/snippets"><u>https://github.com/Consensys/snippets</u></a> (github)<br><u><br></u><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://snippets-gules.vercel.app/"><u>https://snippets-gules.vercel.app/</u></a> (website)</p><p><strong>Hardhat Phosphor Plugin:</strong></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.npmjs.com/package/hardhat-phosphor"><u>https://www.npmjs.com/package/hardhat-phosphor</u></a></p><p>This Hardhat plugin makes it easy to deploy smart contracts to phosphor via hardhat.</p><p><strong>Phosphor Docs:</strong><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.consensys-nft.com/"> </a><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.phosphor.xyz/"><u>https://docs.phosphor.xyz/</u></a>&nbsp;</p><p><strong>Phosphor Developer Dashboard</strong>: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://developer.phosphor.xyz/"><u>https://developer.phosphor.xyz/</u></a>&nbsp;</p><p>As you keep exploring Phosphor, it's clear there's a lot more you can do with digital projects. It shows us how technology can really boost your creative ideas like never before, opening up exciting new possibilities for what you can create and share in the digital world. Enjoy and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/tryphosphor"><u>follow along</u></a> for more updates.&nbsp;</p><p></p>]]></content:encoded>
            <author>phosphor@newsletter.paragraph.com (Phosphor)</author>
            <author>phosphor@newsletter.paragraph.com (Sushmita)</author>
            <category>developers</category>
            <category>guide</category>
            <category>phosphor</category>
            <enclosure url="https://img.paragraph.com/cdn-cgi/image/format=auto/https://storage.googleapis.com/papyrus_images/e58bab1e9a7b579f0ad75cf416810f76.png" length="0" type="image/png"/>
        </item>
    </channel>
</rss>