Sol.College

Full lesson

CancelChain

Revoke recurring-charge permissions on Solana in two clicks and one signature — the next charge is refused on chain. Devnet only.

What it does

From the project README:

A subscriptions dashboard for Solana. Connect a wallet and see every recurring-charge permission ever granted from it — whichever app granted it — then revoke any of them with one signature, so that the next attempt to charge is refused **by the protocol**, not by us.
Original
CancelChain-ai/CancelChain
SuperStack fork
Blockchains/CancelChain @ c53e15f
Stars
0
Last push (original)
2026-10-25
Languages
TypeScript, HTML, JavaScript, CSS, PLpgSQL
Detected stack
@solana/kit
Categories
Infrastructure & Tooling
Licence
MIT
Homepage
https://cancelchain-ai.github.io/CancelChain/

Architecture

233 source files. By extension: .ts ×202, .tsx ×28, .js ×3.

Top-level directorySource files
apps136
packages58
tests22
tools17

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/cancelchain/. 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.

CancelChain-ai/CancelChain · tools/merchant-sim/src/charge.ts L397–420 @ c53e15f · MIT · original
  const code = programErrorCodeOf(error)  if (code !== null) return String(code)  return runtimeErrorLabelOf(error) ?? 'other'} type SignatureStatus = {  err: unknown  slot: Slot} /** * Рівно та частина RPC, якою користується спроба списання. Вужчий тип, ніж * `Rpc<SolanaRpcApi>`, з тієї самої причини, що й у `packages/chain/read.ts`: * методи kit перевантажені за кодуванням, і підробити їх у тесті означало б * підробити всі перевантаження. Справжній клієнт відповідає цьому типу * структурно — це перевіряє `charge.test.ts`. */export type ChargeRpc = {  getLatestBlockhash(config?: { commitment?: Commitment }): {    send(): Promise<{      value: { blockhash: Blockhash; lastValidBlockHeight: bigint }    }>  }  sendTransaction(
  1. Line 415 getLatestBlockhash(config?: { commitment?: Commitment }): {: Fetches a recent blockhash. Transactions expire if it gets too old.
  2. Line 420 sendTransaction(: Submits the signed transaction to the cluster.
CancelChain-ai/CancelChain · tools/merchant-sim/src/plan.ts L385–408 @ c53e15f · MIT · original
  const pollIntervalMs = options.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS   let pda: Address  let plan: CreatePlanTransaction  try {    pda = await findPlanAddress({ owner: input.merchant.address, planId: input.terms.planId })    const { value } = await rpc.getLatestBlockhash({ commitment }).send()    plan = await buildCreatePlanTransaction({      ...input,      lifetime: {        blockhash: toBlockhash(value.blockhash),        lastValidBlockHeight: value.lastValidBlockHeight,      },    })  } catch (error) {    return { outcome: 'not-sent', pda: null, signature: null, detail: detailOf(error) }  }   let sendError: unknown = null  try {    await rpc      .sendTransaction(plan.wireTransactionBase64, {        encoding: 'base64',        preflightCommitment: commitment,
  1. Line 391 const { value } = await rpc.getLatestBlockhash({ commitment }).send(): Fetches a recent blockhash. Transactions expire if it gets too old.
  2. Line 406 .sendTransaction(plan.wireTransactionBase64, {: Submits the signed transaction to the cluster.

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 devpnpm -r --parallel dev
.npm run buildpnpm -r build
.npm run testpnpm -r --parallel test
.npm run lintbiome check .
packages/pushnpm run testvitest run
packages/dbnpm run testvitest run
packages/chainnpm run testvitest run
packages/sharednpm run testvitest run
apps/indexernpm run devtsx watch --env-file-if-exists=../../.env src/index.ts
apps/indexernpm run starttsx src/index.ts
apps/indexernpm run testvitest run
apps/webnpm run devvite
apps/webnpm run buildvite build
apps/webnpm run testvitest run
apps/apinpm run devtsx watch --env-file-if-exists=../../.env src/index.ts
apps/apinpm run starttsx src/index.ts

What you could build from it

Used in lessons