Ga naar de hoofdinhoud
Terug naar voorbeeldapps

Solana Token Minter

The Solana Token Minter app allows you to create fungible tokens on the Solana blockchain with built-in support for IPFS image uploads.

Frontend-framework/bibliotheek:
React/Next.js
Taal:
TypeScript
Bouwtool/ontwikkelingsserver:
Next.js
Voorbeeld van een app-preview


Overzicht

The Solana Token Minter app allows you to create fungible tokens on the Solana blockchain with built-in support for IPFS image uploads using Quicknode's IPFS API. Simply upload an image for your token metadata, fill out the token details, and connect your wallet. Click "Mint" to upload your metadata to IPFS and mint your token seamlessly.

This app uses Next.js 14 project bootstrapped with create-next-app.


Aan de slag

Install Dependencies

Open the project directory:

cd sample-dapps/solana-token-maker

Then, install the dependencies:

npm install
# or
yarn
# or
pnpm install
# or
bun install

Set Environment Variables

Make sure you have a Quicknode endpoint handy--you can get one free here.


  • Rename .env.example naar .env.local and update with your Quicknode Solana Node Endpoint and Quicknode IPFS key.
  • Make sure to update the cluster to ensure your transaction URLs point to the correct explorer (use only of the enum values provided in the .env.example file).
  • You can use Quicknode's public IPFS Gateway URL or replace it with your own.
QN_IPFS_API=QN_abc123456789xyz_REPLACE_THIS
QN_ENDPOINT=https://example.solana-mainnet.quiknode.pro/123456
NEXT_PUBLIC_CLUSTER=mainnet-beta # mainnet-beta | devnet | testnet | local
NEXT_PUBLIC_GATEWAY_URL=https://quicknode.quicknode-ipfs.com/ipfs/

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.


Using the Dapp


  1. Upload an Image (this will be used for your token metadata)
  2. Fill out the form with the token details
  3. Connect your wallet
    • Make sure you have ~0.04 SOL in your wallet to cover the new account fees
    • If you are using Devnet, you can get free SOL from the Solana Faucet
  4. Click "Mint" to upload your image and metadata to IPFS and mint your token!

Architectuur

src/
├── app/
│ ├── page.tsx
│ └── layout.tsx
│ └── api/
│ └── solana/
│ └── createMintTx/route.ts # Create New Mint Transaction
│ └── sendAndConfirm/route.ts # Send and Confirm Transaction
│ └── upload/
│ └── image/route.ts # IPFS Image Upload
│ └── json/route.ts # IPFS JSON Upload
└── components/
├── SolanaProviders.tsx # Wallet Adapter Context providers
├── Minter.tsx # Main component
└── [supporting components]

Deploy on Vercel

Deploy with Vercel


Next.js Documentation

To learn more about Next.js, take a look at the following resources:


You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Bijdragen en feedback
We horen graag wat je ervan vindt en staan open voor alle bijdragen aan deze voorbeeldapp!
Om problemen te melden of feedback te geven, maak je een GitHub-issue aan in de qn-gids-voorbeelden repository.
Volg deze stappen om een bijdrage te leveren:
  1. Maak een fork van de repository
  2. Maak een feature-branch aan:
    git checkout -b feature/amazing-feature
  3. Sla je wijzigingen op:
    git commit -m "Geweldige functie toevoegen"
  4. Pushen van je branch:
    git push origin feature/amazing-feature
  5. Dien een pull-verzoek in.