Sol.College

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 directorySource files
src41
(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.

y-pakorn/dlmm-alm-frontend · 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}`);    });
  1. Line 17 const blockhash = await umi.rpc.getLatestBlockhash({: Fetches a recent blockhash. Transactions expire if it gets too old.
  2. 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.

DirectoryCommandRuns
.npm run devnext dev
.npm run startnext start
.npm run buildnext build
.npm run lintnext lint

What you could build from it