Full lesson
murphy
A powerful and developer-friendly Kit for building decentralized applications on Solana.
What it does
From the project README:
Murphy is an SDK designed to simplify Web3 and Solana development, allowing developers to build decentralized applications in their own way.
- Original
- Murphy-CodeLabs/murphy
- SuperStack fork
- Blockchains/murphy @
c73450f - Stars
- 29
- Last push (original)
- 2025-07-27
- Languages
- TypeScript, MDX, CSS, JavaScript
- Detected stack
- MetaplexNext.jsweb3.js
- Categories
- DeFiNFTs & Digital Assets
- Licence
- MIT
- Homepage
- https://onchainkit.murphyai.dev
Architecture
168 source files. By extension: .tsx ×138, .ts ×30.
| Top-level directory | Source files |
|---|---|
components | 126 |
app | 20 |
lib | 8 |
hook | 4 |
models | 3 |
(root) | 2 |
types | 2 |
constants | 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/murphy/. 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.
components/ui/murphy/send-token-form.tsx L337–360 @ c73450f · MIT · original mintPubkey, destinationPubkey ); transaction.add( createTransferInstruction( senderATA, receiverATA, publicKey, Math.floor( values.amount * Math.pow(10, selectedTokenInfo.decimals) ) ) ); } const { blockhash } = await connection.getLatestBlockhash(); transaction.recentBlockhash = blockhash; transaction.feePayer = publicKey; const signature = await sendTransaction(transaction, connection); toast.message("Transaction sent", { description: "Waiting for confirmation...",- Line 342
createTransferInstruction(: An SPL token transfer through the Token Program. - Line 353
const { blockhash } = await connection.getLatestBlockhash();: Fetches a recent blockhash. Transactions expire if it gets too old. - Line 357
const signature = await sendTransaction(transaction, connection);: Submits the signed transaction to the cluster.
components/ui/murphy/transfer-nft-form.tsx L229–252 @ c73450f · MIT · original toTokenAccount, recipientPubkey, mintPubkey ) ); } // Add transfer instruction transaction.add( createTransferInstruction( fromTokenAccount, toTokenAccount, publicKey, 1, // NFT amount is always 1 [], mintPubkey ) ); // Send transaction const signature = await sendTransaction(transaction, connection); // Confirm transaction await connection.confirmTransaction(signature, 'confirmed');- Line 238
createTransferInstruction(: An SPL token transfer through the Token Program. - Line 249
const signature = await sendTransaction(transaction, connection);: Submits the signed transaction to the cluster.
components/ui/murphy/claim-cToken.tsx L169–192 @ c73450f · MIT · original payer: publicKey, inputCompressedTokenAccounts: inputAccounts, toAddress: ataAddress, amount, tokenPoolInfos: selectedTokenPoolInfos, recentInputStateRootIndices: proof.rootIndices, recentValidityProof: proof.compressedProof, }); // 10. Sign and send transaction using connected wallet const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash(); // Create transaction and add instructions const transaction = new Transaction(); transaction.add(ComputeBudgetProgram.setComputeUnitLimit({ units: 300_000 })); transaction.add(ix); // Set blockhash and feePayer information transaction.recentBlockhash = blockhash; transaction.feePayer = publicKey; console.log("Signing transaction..."); try {- Line 179
const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash();: Fetches a recent blockhash. Transactions expire if it gets too old. - Line 183
transaction.add(ComputeBudgetProgram.setComputeUnitLimit({ units: 300_000 }));: Sets the compute-unit limit or price (priority fee).
components/ui/murphy/buildCurveAndCreateConfigByMarketCap-form.tsx L361–384 @ c73450f · MIT · original quoteMint: new PublicKey(values.quoteMint), config: configKeypair.publicKey, }; // Tạo transaction const transaction = await client.partners.buildCurveAndCreateConfigByMarketCap(params); // Lấy blockhash gần nhất const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash(); transaction.recentBlockhash = blockhash; transaction.lastValidBlockHeight = lastValidBlockHeight; // Đặt feePayer cho transaction transaction.feePayer = publicKey; // Ký giao dịch với configKeypair transaction.partialSign(configKeypair); // Gửi và ký giao dịch const signature = await wallet.adapter.sendTransaction( transaction, connection- Line 371
await connection.getLatestBlockhash();: Fetches a recent blockhash. Transactions expire if it gets too old. - Line 382
const signature = await wallet.adapter.sendTransaction(: 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.
| Directory | Command | Runs |
|---|---|---|
. | npm run dev | next dev --turbo |
. | npm run start | next start |
. | npm run build | next build |
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