Murphy Logo Murphy
Metaplex/Token Metadata

Update Collection Form

A Solana NFT collection update component with shadcn UI styling

Update Collection Form

Update Collection
Update an existing NFT collection on Solana

Loading...

Installation

Install dependencies

Start by installing required Solana dependencies

pnpm add @solana/web3.js @solana/wallet-adapter-react @metaplex-foundation/mpl-token-metadata @metaplex-foundation/umi @metaplex-foundation/umi-bundle-defaults @metaplex-foundation/umi-signer-wallet-adapters

Add Wallet Provider

Make sure you have added the Wallet Provider to your application. If not, follow the steps in the Connect Wallet Button guide first.

Add Update Collection Form

pnpm dlx shadcn@canary add https://www.murphyai.dev/r/update-collection-form.json

Basic Usage

import { UpdateCollectionForm } from "@/components/ui/murphy/update-collection-form";
export default function MyPage() {
  return (
    <div>
      <h1 className="text-xl font-bold mb-2">Update NFT Collection</h1>
      <UpdateCollectionForm />
    </div>
  );
}

Features

  • Load Existing Metadata: Automatically fetch and populate current collection metadata
  • Form Validation: Built-in validation for mint addresses and metadata URIs
  • Real-time Updates: Live feedback during the update process
  • Network Detection: Automatically detects and displays current network
  • Transaction Links: Direct links to view transactions and collections on explorers
  • Error Handling: Comprehensive error handling with user-friendly messages
  • Wallet Integration: Seamless integration with Solana wallet adapters

Advanced Usage

You can pre-populate the collection mint address and handle update callbacks:

export default function MyPage() {
  const handleCollectionUpdated = (collectionMint: string) => {
    console.log(`Collection updated: ${collectionMint}`);
  };

  return (
    <div>
      <h1 className="text-xl font-bold mb-2">Update Collection</h1>
      <UpdateCollectionForm
        className="max-w-md"
        collectionMint="DUSTawucrTsGU8hcqRdHDCbuYhCPADMLM2VcCb8VnFnQ"
        onCollectionUpdated={handleCollectionUpdated}
      />
    </div>
  );
}

Props

PropTypeDefaultDescription
collectionMintstringundefinedPre-populate collection mint address
onCollectionUpdated(mint: string) => voidundefinedCallback fired when collection is updated
classNamestringundefinedAdditional CSS classes

Notes

  • Only the collection authority can update collection metadata
  • Make sure your wallet has the necessary permissions to update the collection
  • The form will automatically load existing metadata when a valid mint address is provided
  • Updates are processed on-chain and may take a few seconds to complete

On this page

How are you feeling?

Join Our Community