internet-court/internet-court-skill / vendored/solana/solana-dev
solana-dev
FlaggedUse when user asks to "build a Solana dapp", "write an Anchor program", "create a token", "debug Solana errors", "set up wallet connection", "test my Solana program", "deploy to devnet", or "explain Solana concepts" (rent, accounts, PDAs, CPIs, etc.). Also use for quick on-chain lookups via public RPC + curl — "what's the balance of <wallet>", "look up transaction <sig>", "token balance for <account>", "check this address on mainnet/devnet". End-to-end Solana development playbook covering wallet connection, Anchor/Pinocchio programs, Codama client generation, Surfpool/LiteSVM/Mollusk testing, security checklists, and JSON-RPC curl lookups against public clusters. Prefers @solana/kit v7 plugin clients (createClient + .use()), wallet connection via @solana/kit-plugin-wallet + @solana/react, web3.js v3 (Kit internals, RC) as the migration target for legacy codebases, and Surfpool for local networks and integration testing.
references/kit/codama.md
View on GitHub---
title: Codama Program Clients
description: Naming conventions and patterns for Codama-generated @solana-program/* Kit-compatible clients.
---
# Codama-Generated Program Clients
`@solana-program/*` packages are Codama-generated, Kit-compatible clients for Solana programs.
## Naming Conventions
| Category | Pattern | Example |
|----------|---------|---------|
| Program address | `{PROGRAM}_PROGRAM_ADDRESS` | `SYSTEM_PROGRAM_ADDRESS` |
| Instructions | `get{Name}Instruction()` | `getTransferSolInstruction()` |
| Instruction parse | `parse{Name}Instruction()` | `parseTransferSolInstruction()` |
| Account fetch | `fetch{Account}()` | `fetchMint()` |
| Account fetch maybe | `fetchMaybe{Account}()` | `fetchMaybeMint()` |
| Account fetch all | `fetchAll{Account}()` | `fetchAllMint()` |
| Account decode | `decode{Account}()` | `decodeMint()` |
| Account size | `get{Account}Size()` | `getMintSize()` |
| Codec | `get{Type}[Encoder\|Decoder\|Codec]()` | `getMintDecoder()` |
| PDA derivation | `find{Name}Pda()` | `findAssociatedTokenPda()` |
| Errors | `{PROGRAM}_ERROR__{NAME}` | `SYSTEM_ERROR__INSUFFICIENT_FUNDS` |
| Error check | `is{Program}Error()` | `isSystemError()` |
## Quick Examples
### Fetch Typed Account
```ts
import { fetchMint } from '@solana-program/token';
const mint = await fetchMint(rpc, mintAddress);
// mint.data.decimals, mint.data.supply — fully typed
```
### Create Instruction
```ts
import { getTransferSolInstruction } from '@solana-program/system';
import { lamports } from '@solana/kit';
const ix = getTransferSolInstruction({
source: payer,
destination: recipient.address,
amount: lamports(1_000_000n),
});
```
### Derive PDA
```ts
import { findAssociatedTokenPda, TOKEN_PROGRAM_ADDRESS } from '@solana-program/token';
const [ata] = await findAssociatedTokenPda({
owner,
mint,
tokenProgram: TOKEN_PROGRAM_ADDRESS,
});
```
### Error Handling
```ts
import { isSystemError, SYSTEM_ERROR__INSUFFICIENT_FUNDS } from '@solana-program/system';
try {
await sendTransaction(tx);
} catch (e) {
if (isSystemError(e, SYSTEM_ERROR__INSUFFICIENT_FUNDS)) {
console.error('Not enough SOL');
}
}
```
## Program-Specific References
For detailed APIs:
- [programs/system.md](programs/system.md) — Account creation, transfers, nonces
- [programs/token.md](programs/token.md) — SPL Token operations
- [programs/token-2022.md](programs/token-2022.md) — Token Extensions
- [programs/compute-budget.md](programs/compute-budget.md) — CU limits & priority fees
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |