All posts

Solana Kit — Code Snippets for @solana/kit

Solana Kit — Code Snippets for @solana/kit

The Problem

Solana's web3.js v2 — now called @solana/kit — is a massive departure from v1. The API changed significantly, the patterns are different, and the migration path is non-obvious. Developers needed a practical reference, not just docs.

What It Is

kit.metasal.xyz is a collection of practical code snippets for @solana/kit (the new @solana/web3.js v2). The tagline: "A place to quickly find that sneaky little snippet." It covers the patterns you actually need when building with the new Solana SDK.

The v1 to v2 Difference

The gap between v1 and v2 of Solana's web3.js is large. The v2 (kit) API is more composable and TypeScript-native, but the patterns look different from everything you learned before. This resource bridges that gap — it was inspired by Yihau's solana-web3-demo but updated for the current kit API.

npm install @solana/kit

What It Covers

Quick reference snippets for common tasks: connections, transactions, keypairs, account fetching, token operations, and more — all written for @solana/kit's API style.

Why I Built It

I kept getting stuck on simple things when migrating to @solana/kit. The official docs are comprehensive but don't always surface the quick answer I needed. kit.metasal.xyz is the resource I wish existed when I was making the transition.