Index of every page on this site: llms.txt
All skills
Run it yourself

Use 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", "fuzz my Solana program", "deploy to devnet", "send a v1 transaction", "support larger transactions", "fix maxSupportedTransactionVersion", or "explain Solana concepts" (rent, accounts, PDAs, CPIs). Also for program architecture (state layout, compute units, throughput, naming), quick on-chain lookups via public RPC + curl, gasless or sponsored-fee transactions (Kora), server-side signing with KMS/Turnkey/Privy/Fireblocks (Solana Keychain), and issuing stablecoins or allowlisted tokens (Mosaic). Covers wallets, Anchor/Pinocchio, Codama clients, Surfpool/LiteSVM/Mollusk testing, security review, and v1 transactions (SIMD-0385). Prefers @solana/kit 8 plugin clients building transaction v1 by default, @solana/kit-plugin-wallet + @solana/react for wallets, web3.js v3 as the legacy migration target, and Surfpool for local networks.

Use this Skill: https://skilld.dev/gh/solana-foundation/solana-dev-skill/solana-dev

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referenceskitaccounts.md

≈986 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Solana Kit Accounts Reference

Fetch Single Account

import { fetchEncodedAccount, assertAccountExists, decodeAccount } from '@solana/kit';

const account = await fetchEncodedAccount(rpc, myAddress);
assertAccountExists(account); // Throws if account doesn't exist
const decoded = decodeAccount(account, myDecoder);

Check Existence Without Throwing

const account = await fetchEncodedAccount(rpc, myAddress);
if (!account.exists) {
  // Handle missing account
}

Fetch Multiple Accounts

const { value: accounts } = await rpc.getMultipleAccounts(
  [address1, address2, address3],
  { encoding: 'base64' },
).send();

Typed Account Fetching (Codama)

Codama-generated clients provide typed fetch helpers:

import { fetchMint, fetchMaybeMint } from '@solana-program/token';

// Throws if not found
const mint = await fetchMint(rpc, mintAddress);
// mint.data.decimals, mint.data.supply — fully typed

// Returns null if not found
const maybeMint = await fetchMaybeMint(rpc, mintAddress);

Account Decoding

See codecs.md for more information.

With Codama Decoder

import { decodeMint } from '@solana-program/token';

const account = await fetchEncodedAccount(rpc, mintAddress);
assertAccountExists(account);
const mint = decodeMint(account);

With Custom Codec

import { decodeAccount } from '@solana/kit';
import { getStructDecoder, getU64Decoder, fixDecoderSize, getBytesDecoder } from '@solana/kit';

const myDecoder = getStructDecoder([
  ['authority', fixDecoderSize(getBytesDecoder(), 32)],
  ['amount', getU64Decoder()],
]);

const decoded = decodeAccount(account, myDecoder);

PDA Derivation

import { findAssociatedTokenPda, TOKEN_PROGRAM_ADDRESS } from '@solana-program/token';

const [ata] = await findAssociatedTokenPda({
  owner: walletAddress,
  mint: mintAddress,
  tokenProgram: TOKEN_PROGRAM_ADDRESS,
});

Custom PDA

import { getProgramDerivedAddress, getAddressEncoder } from '@solana/kit';

const [pda, bump] = await getProgramDerivedAddress({
  programAddress: myProgramAddress,
  seeds: [
    getAddressEncoder().encode(userAddress),
    new TextEncoder().encode('vault'),
  ],
});

Account Subscriptions

const sub = await rpcSubs.accountNotifications(address, {
  encoding: 'base64',
  commitment: 'confirmed',
}).subscribe();

for await (const notif of sub) {
  console.log('Account changed:', notif);
}

Token Account Queries

// All token accounts for an owner
const { value: tokenAccs } = await rpc.getTokenAccountsByOwner(
  ownerAddress,
  { programId: TOKEN_PROGRAM_ADDRESS },
  { encoding: 'jsonParsed' },
).send();

// Filter by mint
const { value: tokenAccs } = await rpc.getTokenAccountsByOwner(
  ownerAddress,
  { mint: mintAddress },
  { encoding: 'jsonParsed' },
).send();

// Token balance
const { value: balance } = await rpc.getTokenAccountBalance(tokenAccountAddress).send();
// balance.amount (string), balance.decimals, balance.uiAmount

Program Account Queries

const accounts = await rpc.getProgramAccounts(programAddress, {
  encoding: 'base64',
  filters: [
    { memcmp: { offset: 0, bytes: 'base58discriminator...' } },
    { dataSize: 165n },
  ],
}).send();

Account Existence Pattern

Always check existence before decoding raw accounts:

import { fetchEncodedAccount, assertAccountExists, decodeAccount } from '@solana/kit';

async function getAccountData<T>(rpc, address, decoder): Promise<T> {
  const account = await fetchEncodedAccount(rpc, address);
  assertAccountExists(account);
  return decodeAccount(account, decoder).data;
}

For Codama-generated clients, use fetchMaybe* variants to handle missing accounts gracefully.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning18d5 checks · Risk SAFE
  • Gen Agent Trust Hub19d

    This skill is a legitimate and comprehensive developer resource for Solana blockchain development. It identifies and mitigates common security risks through explicit instructions on handling untrusted on-chain data and enforces transaction safety via user-review guardrails. All external dependencies and tool installations originate from trusted, official Solana ecosystem providers.

  • Socket18d

    No alerts

  • Snyk19d

    Risk: LOW · No issues

  • Runlayer8mo

    3/15 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at c9da262. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 3 weeks ago
compatibility
Requires Node.js 20.18+, Rust toolchain, Solana CLI, Anchor CLI
metadata
{
  "author": "Solana Foundation",
  "version": "2.8.0"
}

README badge

README badge for solana-foundation/solana-dev-skill