Solana Kit Migration logo

Solana Kit Migration

Organization
sendaifun
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 transitions

Overview

Publishersendaifun
Repositoryskills
Skill namesolana-kit-migration
Stars
128
Forks
81
Bundled files
10
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 10 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by sendaifun on GitHub. Read the source before you install it.

Installation

Install the Solana Kit Migration AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/sendaifun/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/solana-kit-migration .claude/skills/solana-kit-migration
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Solana Kit Migration in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Solana Kit Migration on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Solana Kit Migration is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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:

LibraryStatusUse Case
@solana/web3.js (1.x)Maintenance modeLegacy projects, Anchor-dependent apps
@solana/kitActive developmentNew 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:

  1. Starting a new project without Anchor dependencies
  2. Bundle size matters - Kit is tree-shakeable (26% smaller bundles)
  3. Performance is critical - ~200ms faster confirmation latency, 10x faster crypto ops
  4. Using standard programs (System, Token, Associated Token)
  5. Building browser applications where bundle size impacts load time
  6. Type safety is important - Better TypeScript support catches errors at compile time
  7. Using modern JavaScript - Native BigInt, WebCrypto, AsyncIterators

Use @solana/web3.js (v1.x) When:

  1. Using Anchor - Anchor doesn't support Kit out of the box yet
  2. Existing large codebase - Migration cost outweighs benefits
  3. Dependencies require v1 - Check if your SDKs support Kit
  4. Rapid prototyping - v1's OOP style may be more familiar
  5. Documentation/examples - More community resources for v1

Use Both (Hybrid Approach) When:

  1. Gradual migration - Use @solana/compat for interoperability
  2. Mixed dependencies - Some libs require v1, some support Kit
  3. Feature-by-feature migration - Convert hot paths first

Quick Decision Flowchart

START
  ├─ New project? ─────────────────────────────────────────┐
  │     │                                                   │
  │     ├─ Using Anchor? ──► YES ──► Use @solana/web3.js   │
  │     │                                                   │
  │     └─ No Anchor? ──► Use @solana/kit                  │
  │                                                         │
  └─ Existing project? ────────────────────────────────────┤
        │                                                   │
        ├─ Performance issues? ──► Consider migration      │
        │                                                   │
        ├─ Bundle size issues? ──► Consider migration      │
        │                                                   │
        └─ Working fine? ──► Stay with current SDK         │

Instructions for Migration Analysis

When a user asks about migration, follow these steps:

Step 1: Analyze Current Codebase

Run the migration analysis script to detect:

  • Which SDK version is currently used
  • Anchor dependencies
  • Third-party SDK dependencies
  • Usage patterns that need migration
bash
# Use the analyze-migration.sh script in scripts/
./scripts/analyze-migration.sh /path/to/project

Step 2: Check Dependencies

Look for these blocking dependencies:

  • @coral-xyz/anchor or @project-serum/anchor - Wait for Anchor Kit support
  • SDKs that haven't migrated (check their package.json)

Step 3: Assess Migration Complexity

Count occurrences of these patterns that need changes:

  • new Connection(...)createSolanaRpc(...)
  • Keypair.fromSecretKey(...)createKeyPairSignerFromBytes(...)
  • new PublicKey(...)address(...)
  • new Transaction()createTransactionMessage(...)
  • Class-based patterns → Functional composition with pipe()

Step 4: Recommend Strategy

Based on findings, recommend:

  • Full Migration: If no blockers and < 50 migration points
  • Gradual Migration: If 50-200 migration points, use @solana/compat
  • Wait: If Anchor-dependent or critical SDKs don't support Kit
  • Hybrid: If only specific modules need Kit performance

API Migration Reference

See resources/api-mappings.md for complete mappings. Key conversions:

Connection → RPC

typescript
// v1
const connection = new Connection(url, 'confirmed');
const balance = await connection.getBalance(pubkey);

// Kit
const rpc = createSolanaRpc(url);
const { value: balance } = await rpc.getBalance(address).send();

Keypair → KeyPairSigner

typescript
// v1
const keypair = Keypair.fromSecretKey(secretKey);
console.log(keypair.publicKey.toBase58());

// Kit
const signer = await createKeyPairSignerFromBytes(secretKey);
console.log(signer.address);

Transaction Building

typescript
// v1
const tx = new Transaction().add(
  SystemProgram.transfer({
    fromPubkey: sender.publicKey,
    toPubkey: recipient,
    lamports: amount,
  })
);
tx.recentBlockhash = blockhash;
tx.feePayer = sender.publicKey;

// Kit
const tx = pipe(
  createTransactionMessage({ version: 0 }),
  tx => setTransactionMessageFeePayer(sender.address, tx),
  tx => setTransactionMessageLifetimeUsingBlockhash(blockhash, tx),
  tx => appendTransactionMessageInstruction(
    getTransferSolInstruction({
      source: sender,
      destination: address(recipient),
      amount: lamports(BigInt(amount)),
    }),
    tx
  ),
);

Edge Cases & Gotchas

1. BigInt Conversion

Kit uses native BigInt everywhere. Watch for:

typescript
// WRONG - will fail
const amount = 1000000000;

// CORRECT
const amount = 1_000_000_000n;
// or
const amount = BigInt(1000000000);
// or use helper
const amount = lamports(1_000_000_000n);

2. Base58 Encoding Errors

Kit may require explicit encoding:

typescript
// If you see: "Encoded binary (base 58) data should be less than 128 bytes"
// Add encoding parameter:
await rpc.getAccountInfo(address, { encoding: 'base64' }).send();

3. Async Keypair Generation

Kit keypair creation is async (uses WebCrypto):

typescript
// v1 - synchronous
const keypair = Keypair.generate();

// Kit - MUST await
const keypair = await generateKeyPairSigner();

4. RPC Method Chaining

Kit RPC calls require .send():

typescript
// v1
const balance = await connection.getBalance(pubkey);

// Kit - don't forget .send()!
const { value: balance } = await rpc.getBalance(address).send();

5. PublicKey vs Address

These are different types and not interchangeable:

typescript
// Use @solana/compat for conversion
import { fromLegacyPublicKey, toLegacyPublicKey } from '@solana/compat';

const kitAddress = fromLegacyPublicKey(legacyPublicKey);
const legacyPubkey = toLegacyPublicKey(kitAddress);

6. Transaction Signing

Signing flow is different:

typescript
// v1
transaction.sign(keypair);
// or
const signed = await connection.sendTransaction(tx, [keypair]);

// Kit - use signer pattern
const signedTx = await signTransactionMessageWithSigners(txMessage);
const signature = await sendAndConfirmTransaction(signedTx);

7. Anchor Incompatibility

Anchor generates v1 types. If using Anchor:

typescript
// Keep @solana/web3.js for Anchor interactions
import { Connection, PublicKey } from '@solana/web3.js';
import { Program } from '@coral-xyz/anchor';

// Use Kit for non-Anchor parts if needed
// Bridge with @solana/compat

8. Subscription Handling

Kit uses AsyncIterators:

typescript
// v1
const subscriptionId = connection.onAccountChange(pubkey, callback);
connection.removeAccountChangeListener(subscriptionId);

// Kit - use AbortController
const abortController = new AbortController();
const notifications = await rpcSubscriptions
  .accountNotifications(address)
  .subscribe({ abortSignal: abortController.signal });

for await (const notification of notifications) {
  // handle notification
}
// To unsubscribe:
abortController.abort();

9. VersionedTransaction Migration

typescript
// v1
const versionedTx = new VersionedTransaction(messageV0);

// Kit - transactions are versioned by default
const tx = createTransactionMessage({ version: 0 });

10. Lookup Tables

Address Lookup Tables work differently:

typescript
// v1
const lookupTable = await connection.getAddressLookupTable(tableAddress);
const messageV0 = new TransactionMessage({...}).compileToV0Message([lookupTable.value]);

// Kit
// Lookup tables are handled in transaction compilation
// See resources/lookup-tables-example.md

Alternative: Consider Gill

If Kit feels too low-level, consider Gill:

  • Built on Kit primitives
  • Higher-level abstractions
  • Simpler API for common tasks
  • Full Kit compatibility
typescript
import { createSolanaClient, sendSol } from 'gill';

const client = createSolanaClient({ rpcUrl });
await sendSol(client, { from: signer, to: recipient, amount: lamports(1n) });

Guidelines

  • Always check Anchor compatibility before recommending Kit migration
  • Recommend @solana/compat for gradual migrations
  • Bundle size benefits matter most for browser applications
  • Performance benefits matter most for high-throughput backends
  • Don't migrate stable, working code without clear benefits
  • Test thoroughly - Kit has different error types and behaviors

Files in This Skill

solana-kit-migration/
├── SKILL.md                          # This file
├── scripts/
│   ├── analyze-migration.sh          # Codebase analysis script
│   └── detect-patterns.js            # Pattern detection utility
├── resources/
│   ├── api-mappings.md               # Complete API reference
│   ├── compatibility-matrix.md       # SDK compatibility info
│   └── package-comparison.md         # Feature comparison
├── examples/
│   ├── v1-to-kit/                    # Migration examples
│   │   ├── basic-transfer.md
│   │   ├── token-operations.md
│   │   └── subscription-handling.md
│   └── mixed-codebase/               # Hybrid approach examples
│       └── anchor-with-kit.md
└── docs/
    └── edge-cases.md                 # Detailed edge cases

Notes

  • Kit was released as @solana/web3.js@2.0.0 on December 16, 2024
  • It was later renamed to @solana/kit to avoid confusion
  • The 1.x line is in maintenance mode but still widely used
  • Migration tooling is evolving - check for updates regularly

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Solana Kit Migration AI skill do?

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 transitions

Why use Solana Kit Migration on TypingMind?

Because you install it once and use it with any model. Solana Kit Migration is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Solana Kit Migration in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/sendaifun/skills/tree/main/skills/solana-kit-migration. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Solana Kit Migration?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Solana Kit Migration?

As many as you like. As long as a model supports skills, you can use Solana Kit Migration with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Solana Kit Migration AI skill free?

Yes. It is published on GitHub by sendaifun under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇