Full lesson
dlmm-alm-frontend
- Original
- y-pakorn/dlmm-alm-frontend
- SuperStack fork
- Blockchains/dlmm-alm-frontend @
7b969af - Stars
- 0
- Last push (original)
- 2024-10-08
- Languages
- TypeScript, CSS, JavaScript
- Detected stack
- MetaplexNext.jsweb3.js
- Categories
- Other
- Licence
- MIT
Architecture
43 source files. By extension: .ts ×22, .tsx ×20, .js ×1.
| Top-level directory | Source files |
|---|---|
src | 41 |
(root) | 2 |
Dapp: deploying
This fork is queued for its own live dapp on Sol.College, with a Devnet/Mainnet switch. It appears here, at /dapps/dlmm-alm-frontend/, once it is deployed and checked on devnet. Until then, 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/lib/umi/sendAndConfirmWithWalletAdapter.ts L13–35 @ 7b969af · MIT · original const umi = useUmiStore.getState().umi; const currentSigner = useUmiStore.getState().signer; umi.use(signerIdentity(currentSigner!)); const blockhash = await umi.rpc.getLatestBlockhash({ commitment: settings?.commitment || "confirmed", }); const transactions = tx .add(setComputeUnitPrice(umi, { microLamports: BigInt(100000) })) .setBlockhash(blockhash); const signedTx = await transactions.buildAndSign(umi); const signature = await umi.rpc .sendTransaction(signedTx, { preflightCommitment: settings?.commitment || "confirmed", commitment: settings?.commitment || "confirmed", skipPreflight: settings?.skipPreflight || false, }) .catch((err) => { throw new Error(`Transaction failed: ${err}`); });- Line 17
const blockhash = await umi.rpc.getLatestBlockhash({: Fetches a recent blockhash. Transactions expire if it gets too old. - Line 28
.sendTransaction(signedTx, {: 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 |
. | 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 Other gaps listed on the idea page.
- Learn the pattern first: Program Derived Addresses (PDAs)
- Learn the pattern first: Cross-Program Invocations (CPIs)