Full lesson
DealMint
Turn discounts into liquid, ownable assets. Claim a perk, redeem via QR, or transfer in seconds.
What it does
From the project README:
Turn discounts into liquid, ownable assets. Claim a perk, redeem via QR, or transfer in seconds.
- Original
- N-45div/DealMint
- SuperStack fork
- Blockchains/DealMint @
c8b810b - Stars
- 0
- Last push (original)
- 2025-10-30
- Languages
- TypeScript, CSS, JavaScript
- Detected stack
- MetaplexNext.jsSolana Payweb3.js
- Categories
- DeFi
- Licence
- MIT
Architecture
93 source files. By extension: .tsx ×50, .ts ×43.
| Top-level directory | Source files |
|---|---|
src | 85 |
scripts | 3 |
(root) | 2 |
tests | 2 |
prisma | 1 |
Dapp: devnet deploy pending
⏳ Devnet deploy pending — goes live when the devnet wallet is topped up. This fork's own dapp is not deployed yet, so there is no program address or transaction to show. It is queued in dapp-queue.txt; once devnet SOL is available it is deployed, exercised with real devnet transactions, and this section switches to the live dapp at /dapps/dealmint/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.
Key code, explained
Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.
src/app/api/nft/prepare-mint-signed/route.ts L37–60 @ c8b810b · MIT · original const serverTx = new Transaction() serverTx.add( SystemProgram.createAccount({ fromPubkey: feePayer.publicKey, newAccountPubkey: mintKp.publicKey, lamports: rent, space: MINT_SIZE, programId: TOKEN_PROGRAM_ID, }), createInitializeMintInstruction(mintKp.publicKey, 0, ownerPk, null, TOKEN_PROGRAM_ID), ) serverTx.feePayer = feePayer.publicKey serverTx.recentBlockhash = (await connection.getLatestBlockhash('finalized')).blockhash await connection.sendTransaction(serverTx, [feePayer, mintKp], { skipPreflight: true }) // Build unsigned tx for owner: create ATA (payer=owner) + mintTo (mintAuthority=owner) const ata = await getAssociatedTokenAddress(mintKp.publicKey, ownerPk) const clientTx = new Transaction() clientTx.feePayer = ownerPk clientTx.recentBlockhash = (await connection.getLatestBlockhash('finalized')).blockhash clientTx.add( createAssociatedTokenAccountInstruction(ownerPk, ata, ownerPk, mintKp.publicKey), createMintToInstruction(mintKp.publicKey, ata, ownerPk, 1), )- Line 49
serverTx.recentBlockhash = (await connection.getLatestBlockhash('finalized')).blockhash: Fetches a recent blockhash. Transactions expire if it gets too old. - Line 50
await connection.sendTransaction(serverTx, [feePayer, mintKp], { skipPreflight: true }): Submits the signed transaction to the cluster. - Line 59
createMintToInstruction(mintKp.publicKey, ata, ownerPk, 1),: Mints new tokens. The mint authority must sign.
How to run, build and test
These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.
| Directory | Command | Runs |
|---|---|---|
. | npm run dev | next dev --turbopack |
. | npm run start | next start |
. | npm run build | next build |
. | npm run lint | next lint |
What you could build from it
- Fork the SuperStack copy and extend it within the DeFi gaps listed on the idea page.
- Learn the pattern first: Program Derived Addresses (PDAs)
- Learn the pattern first: Cross-Program Invocations (CPIs)
- Learn the pattern first: SPL Tokens: mints, accounts and transfers