Sol.College

Full lesson

AABC-Labs-v1

The Ultimate Form of Blockchain AI Agents. Deploy AI agents that interact with smart contracts, launch tokens, build websites, and connect the crypto ecosystem.

What it does

From the project README:

[](https://opensource.org/licenses/MIT) [](https://www.python.org/downloads/) [](https://nodejs.org/) [](https://solana.com/)
Original
labsaistudio/AABC-Labs-v1
SuperStack fork
Blockchains/AABC-Labs-v1 @ 5eadce8
Stars
1
Last push (original)
2025-11-11
Languages
Python, JavaScript, TypeScript, PLpgSQL, Dockerfile, Shell
Detected stack
Next.jsSolana Agent Kitweb3.js
Categories
AI & Agents
Licence
MIT

Architecture

103 source files. By extension: .py ×70, .js ×25, .ts ×7, .tsx ×1.

Top-level directorySource files
agent56
solana-bridge25
blockchain_tools7
backend7
frontend6
gateway2

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/aabc-labs-v1/. 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.

labsaistudio/AABC-Labs-v1 · gateway/src/x402-bridge.ts L1–24 @ 5eadce8 · MIT · original
import { Connection, Keypair, PublicKey, SystemProgram, Transaction } from '@solana/web3.js'import { createTransferCheckedInstruction, getAssociatedTokenAddress } from '@solana/spl-token'import bs58 from 'bs58' // X402 Payment Protocol Typesinterface PaymentRequirements {  maxAmountRequired: string // Atomic units (micro-USDC on mainnet, lamports on devnet)  asset: string // USDC mint address (mainnet) or 'SOL' (devnet)  description: string  resource: string} interface X402Payment {  x402Version: number  // v1.0 uses number 1, not string  scheme: string  network: string  payload: string // Base64 encoded transaction} // Initialize Solana connection (mainnet by default)const connection = new Connection(  process.env.SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com',  'confirmed')
  1. Line 2 import { createTransferCheckedInstruction, getAssociatedTokenAddress } from '@solana/spl-t: A checked token transfer, which also verifies the mint and decimals.
  2. Line 14 x402Version: number // v1.0 uses number 1, not string: Uses x402, an HTTP 402 pattern where an agent pays per request with an on-chain payment.
labsaistudio/AABC-Labs-v1 · gateway/src/index.ts L265–287 @ 5eadce8 · MIT · original
      )      const createTx = new Transaction().add(createIx)      createTx.feePayer = agent.publicKey      const createBlockhash = await conn.getLatestBlockhash('finalized')      createTx.recentBlockhash = createBlockhash.blockhash      createTx.sign(agent)       const createSig = await conn.sendRawTransaction(createTx.serialize(), { skipPreflight: false })      console.log('[Gateway] Create ATA transaction sent:', createSig)      await conn.confirmTransaction(createSig, 'confirmed')      console.log('[Gateway] Treasury token account created ✓')    }     // Per teacher's guidance (010.txt line 138-146):    // Only 1 transferChecked instruction, no Memo    const transferIx = createTransferCheckedInstruction(      agentAta,      new PublicKey(USDC),  // Must use mint address from accept.asset      destAta,      agent.publicKey,      priceAtomic,      6  // USDC decimals    )
  1. Line 268 const createBlockhash = await conn.getLatestBlockhash('finalized'): Fetches a recent blockhash. Transactions expire if it gets too old.
  2. Line 280 const transferIx = createTransferCheckedInstruction(: A checked token transfer, which also verifies the mint and decimals.
labsaistudio/AABC-Labs-v1 · frontend/src/app/x402-test/page.tsx L37–60 @ 5eadce8 · MIT · original
      const connection = new Connection(        process.env.NEXT_PUBLIC_SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com'      )       const fromTokenAccount = await getAssociatedTokenAddress(        USDC_MINT,        publicKey      )       const toTokenAccount = await getAssociatedTokenAddress(        USDC_MINT,        TREASURY_WALLET      )       const transaction = new Transaction().add(        createTransferInstruction(          fromTokenAccount,          toTokenAccount,          publicKey,          PRICE_USDC        )      )       const { blockhash } = await connection.getLatestBlockhash()
  1. Line 52 createTransferInstruction(: An SPL token transfer through the Token Program.
  2. Line 60 const { blockhash } = await connection.getLatestBlockhash(): Fetches a recent blockhash. Transactions expire if it gets too old.
labsaistudio/AABC-Labs-v1 · frontend/src/lib/x402-client.ts L85–108 @ 5eadce8 · MIT · original
    const usdcMint = new PublicKey(USDC_MINT);    const treasuryPubkey = new PublicKey(treasuryAddress);     const senderTokenAccount = await getAssociatedTokenAddress(      usdcMint,      publicKey    );     const recipientTokenAccount = await getAssociatedTokenAddress(      usdcMint,      treasuryPubkey    );     const transferInstruction = createTransferCheckedInstruction(      senderTokenAccount,      usdcMint,      recipientTokenAccount,      publicKey,      amountMicroUsdc,      USDC_DECIMALS    );     const { blockhash } = await connection.getLatestBlockhash('confirmed');    const transaction = new Transaction({
  1. Line 98 const transferInstruction = createTransferCheckedInstruction(: A checked token transfer, which also verifies the mint and decimals.
  2. Line 107 const { blockhash } = await connection.getLatestBlockhash('confirmed');: Fetches a recent blockhash. Transactions expire if it gets too old.

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
gatewaynpm run devtsx watch src/index.ts
gatewaynpm run startnode dist/index.js
gatewaynpm run buildtsc
gatewaynpm run testjest
frontendnpm run devnext dev
frontendnpm run startnext start
frontendnpm run buildnext build
frontendnpm run lintnext lint
solana-bridgenpm run devnodemon index.js
solana-bridgenpm run startnode index.js
solana-bridgenpm run testjest

What you could build from it

Used in lessons