Ir al contenido principal
Volver a las aplicaciones de ejemplo

Generador de tokens de Solana

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

Marco de trabajo o biblioteca de front-end:
React/Next.js
Idioma:
TypeScript
Herramienta de compilación/servidor de desarrollo:
Next.js
Vista previa de la aplicación de ejemplo


Resumen

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 proyecto puesto en marcha con create-next-app.


Primeros pasos

Instalar las dependencias

Open the project directory:

cd sample-dapps/solana-token-maker

Then, install the dependencies:

npm instalar
# o
yarn
# o
pnpm instalar
# o
bun install

Configurar variables de entorno

Asegúrate de tener a mano un punto de conexión de Quicknode; puedes conseguir uno gratis aquí.


  • Cambiar el nombre .env.example a .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/

En primer lugar, ejecuta el servidor de desarrollo:

npm ejecutar dev
# o
yarn dev
# o
pnpm dev
# o
bun dev

Abre http://localhost:3000 en tu navegador para ver el resultado.


Cómo utilizar la 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!

Arquitectura

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]

Implementar en Vercel

Implementar con Vercel


Documentación de Next.js

Para obtener más información sobre Next.js, echa un vistazo a los siguientes recursos:


Puedes echar un vistazo al repositorio de Next.js en GitHub: ¡tus comentarios y aportaciones son bienvenidos!

Aportaciones y comentarios
¡Nos encantaría conocer tu opinión y agradecemos cualquier aportación a esta aplicación de ejemplo!
Para informar de problemas o enviar comentarios, abre una incidencia en GitHub en el qn-guide-ejemplos repositorio.
Para colaborar, sigue estos pasos:
  1. Hacer un fork del repositorio
  2. Crear una rama de características:
    git checkout -b feature/amazing-feature
  3. Guarda los cambios:
    git commit -m "Añadir una función increíble"
  4. Envía tu rama:
    git push origin feature/amazing-feature
  5. Abre una solicitud de incorporación de cambios.