Thank you for considering a contribution to this repository. We welcome new examples, fixes, and improvements from the community.
- Code: Add new examples or improve existing ones (bug fixes, optimizations, additional features).
- Bug reports, ideas, feedback: Open an issue describing what you found or what you'd like to see.
- Each example lives at
category/example-name/<framework>/, e.g.basics/counter/anchor/. - Supported frameworks:
anchor,quasar,pinocchio,native. Use the existing layout as a reference. - Tests live alongside the program in a
tests/directory.
- Package manager:
pnpm. Commitpnpm-lock.yaml. Do not use yarn or npm here. - Formatter / linter: Biome. Run
pnpm fixfrom the repo root before submitting a PR.
This repo uses an in-process test runtime — no local validator boot, no solana-test-validator, no anchor test --validator legacy.
For Anchor and Quasar examples, tests are written in TypeScript and run with node:test via tsx:
npx tsx --test --test-reporter=spec tests/*.tsThe conventional Anchor.toml [scripts] entry is:
[scripts]
test = "npx create-codama-clients; npx tsx --test --test-reporter=spec tests/*.ts"The TypeScript tests use:
solana-kitefor the connection, wallet creation, token mint helpers, PDA derivation, andsendTransactionFromInstructions.@solana/kitfor the core types (KeyPairSigner,Address,lamports).- A Codama-generated client (via
npx create-codama-clients) for invoking the program instructions. Do not useanchor.workspaceorprogram.methods.X().rpc().
Native and Pinocchio examples may use litesvm directly from Rust where appropriate.
Write American English in prose (e.g. "behavior", "initialize", "favor"). Code identifiers stay as-is.
Other conventions:
- One H1 per markdown file.
- Fenced code blocks include a language tag (
```rust,```typescript,```bash,```toml). - Use full words rather than abbreviations (
transaction, nottxortxn;account, notacc). - Prefer
async/awaitover.then()/.catch(). - Use
Array<T>rather thanT[]in TypeScript. - Avoid magic numbers — name or explain them.
- Write "onchain" / "offchain" as single words (no hyphen).
Add the project path to .ghaignore to skip it during CI builds. If you remove or replace an example, update .ghaignore accordingly.
Be respectful and inclusive. Constructive feedback only. Report any conduct issues to the maintainers.