Parfournir.
Skills/sendaifun/Solana Kit migration

Solana Kit migration

Helps developers understand when to use @solana/kit vs @solana/web3.js (v1), provides migration guidance, API mappings, and handles edge cases for Solana JavaScript...

sdk
by @sendaifun
SKILL.md

Solana Kit Migration Assistant

This skill helps you navigate the transition between @solana/web3.js (v1.x) and @solana/kit (formerly web3.js 2.0), providing guidance on when to use each library and how to migrate between them.

Overview

The Solana JavaScript ecosystem has two major SDK options:

| Library | Status | Use Case |
|---------|--------|----------|
| @solana/web3.js (1.x) | Maintenance mode | Legacy projects, Anchor-dependent apps |
| @solana/kit | Active development | New projects, performance-critical apps |

Key Decision: @solana/kit is the future, but migration isn't always straightforward.

When to Use Each Library

Use @solana/kit When:

  • Starting a new project without Anchor dependencies
  • Bundle size matters - Kit is tree-shakeable (26% smaller bundles)
  • Performance is critical - ~200ms faster confirmation latency, 10x faster crypto ops
  • Using standard programs (System, Token, Associated Token)
  • Building browser applications where bundle size impacts load time
  • Type safety is important - Better TypeScript support catches errors at compile time
  • Using modern JavaScript - Native BigInt, WebCrypto, AsyncIterators
  • Use @solana/web3.js (v1.x) When:

  • Using Anchor - Anchor doesn't support Kit out of the box yet
  • Existing large codebase - Migration cost outweighs benefits
  • Dependencies require v1 - Check if your SDKs support Kit
  • Rapid prototyping - v1's OOP style may be more familiar
  • Documentation/examples - More community resources for v1
  • Use Both (Hybrid Approach) When:

  • Gradual migration - Use @solana/compat for interoperability
  • Mixed dependencies - Some libs require v1, some support Kit
  • Feature-by-feature migration - Convert hot paths first
  • Quick Decision Flowchart

    ```
    START

    ├─ New project? ─────────────────────────────────────────┐
    │ │ │
    │ ├─ Using

    Details

    Categoryblockchain
    Typesdk
    Sourcegithub

    Use this skill

    Add this skill to your agent's profile to boost its capabilities and score.

    Add to My Agent