Sol.College

Full lesson

solana-chatgpt-kit

What it does

From the project README:

Perform Solana blockchain operations directly from ChatGPT using natural language. Swap tokens, send SOL, check balances, stake assets, and more—all without leaving your conversation.
Original
The-x-35/solana-chatgpt-kit
SuperStack fork
Blockchains/solana-chatgpt-kit @ 28cd712
Stars
27
Last push (original)
2025-10-27
Languages
TypeScript, CSS, JavaScript
Detected stack
Next.jsweb3.js
Categories
AI & AgentsConsumer & Social
Licence
MIT

Architecture

39 source files. By extension: .ts ×28, .tsx ×11.

Top-level directorySource files
app25
lib6
components5
(root)3

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/solana-chatgpt-kit/. 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.

The-x-35/solana-chatgpt-kit · app/api/transfer/route.ts L97–120 @ 28cd712 · MIT · original
    const lamports = Math.round(solAmount * LAMPORTS_PER_SOL);     const transaction = new Transaction().add(      SystemProgram.transfer({        fromPubkey: fromPublicKey,        toPubkey: destination,        lamports,      })    );     transaction.feePayer = fromPublicKey;    const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash();    transaction.recentBlockhash = blockhash;     // If using external wallet, return unsigned transaction for client to sign    if (externalWallet) {      console.log("Prepared unsigned transfer transaction for client signing.");      const serialized = transaction.serialize({ requireAllSignatures: false });      const transferTransaction = Buffer.from(serialized).toString("base64");       // Settle x402 payment after preparing transaction      if (x402 && paymentHeader) {        await x402.settlePayment(paymentHeader, paymentRequirements);      }
  1. Line 108 const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash();: Fetches a recent blockhash. Transactions expire if it gets too old.
  2. Line 117 // Settle x402 payment after preparing transaction: Uses x402, an HTTP 402 pattern where an agent pays per request with an on-chain payment.

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.

DirectoryCommandRuns
.npm run devnext dev --turbopack
.npm run startnext start
.npm run buildnext build --turbopack

What you could build from it

Used in lessons