AGENT SKILL

solana-dev-kit-web3-interop

How to handle legacy web3.js code — web3.js v3 (Kit internals, 3.0.0 since Oct 2026) is the migration target; defer migration mechanics to the official migration skill.

License 许可
MIT
所属仓库
themusebook/skills
最近更新
2026-11-02
Stars
★ 0
Forks
1

01 前言 Front Matter

name
solana-dev-kit-web3-interop
license
MIT
metadata
{ "author": "Solana Foundation", "source": "https://github.com/solana-foundation/solana-dev-skill", "version": "2.7.0", "category": "Tooling" }
description
How to handle legacy web3.js code — web3.js v3 (Kit internals, 3.0.0 since Oct 2026) is the migration target; defer migration mechanics to the official migration skill.

03 SKILL.md 正文

Kit ↔ web3.js Interop

Solana Foundation skill — mirrored in the Musebook skills hub. This entry reproduces, verbatim, the kit-web3-interop.md reference of the foundation-maintained solana-dev skill (v2.7.0, MIT) from https://github.com/solana-foundation/solana-dev-skill. It is one of the 16 topic references the solana-dev router discloses progressively; for the full skill (router + all references + nested guides), install the upstream original: npx skills add https://github.com/solana-foundation/solana-dev-skill — also mirrored in this hub as the solana-dev entry. Maintained by the Solana Foundation; Musebook does not author or maintain this content. Relative links in the body point at the upstream skill's file layout and resolve in the full install.

Kit ↔ web3.js Interop

The landscape (2026)

@solana/web3.js v3 is a rebuild of the classic class-based API (Connection, Keypair, Transaction) on top of @solana/kit internals, co-developed by Blueshift and the Solana Foundation.

Status: stable. @solana/web3.js 3.0.0 shipped on 2026-10-01 (3.1.1 as of Oct 19) together with a new @solana/wallet-adapter 3.0 package. 3.1.x depends on @solana/kit ^8.5.0 (3.0.x on ^8.4.0). 3.x is now the latest dist-tag, so npm i @solana/web3.js installs it; a codebase that has to stay on 1.x pins @solana/web3.js@1. The v3 work now lives on the repo's main branch (the v3.x branch is gone; 1.x continues on maintenance/v1.x). Treat v3 as the migration target for v1 codebases, not a default recommendation for new work.

The 3.0.0 release notes list the breaking changes from 1.x. The ones that bite most: Keypair.generate() / fromSecretKey() / fromSeed() and Transaction.serialize() are async, Connection's implicit default commitment is now confirmed (was finalized), many Connection results are bigint and Uint8Array instead of number and Buffer, and getRecentBlockhash / FeeCalculator / the Account class are gone.

Decision routing

  1. Greenfield code → use @solana/kit + plugins directly. Don't add web3.js at all. See kit/overview.md.
  2. Migrating a v1 codebase → use the official migration skill. It is maintained alongside the source in the solana-web3.js repo and kept current with each release, so prefer it over hand-migrating from memory:
    npx skills add https://github.com/solana-foundation/solana-web3.js/tree/main/skills/web3js-v1-to-v3-migration
    
    (Or install from the repo and select it: npx skills add solana-foundation/solana-web3.js -s web3js-v1-to-v3-migration.) A companion guide in the same repo covers @solana/spl-token → @solana-program/token.
  3. Found @solana/web3-compat in a codebase → it is superseded (an interim shim running the v1 API on Kit 5). Do not introduce it in new work; plan a migration to v3 or Kit.
  4. A dependency expects v1 objects (Connection, sync Keypair) → upgrade the dependency or isolate it in an adapter module. Do not downgrade your app to v1, and do not let legacy class types leak across the app.

Why the boundary is cheap in v3

Because v3 is built on Kit, the seams are shared types rather than conversion shims:

  • PublicKey is a deprecated alias of v3's Address class.
  • A v3 Keypair structurally satisfies Kit's KeyPairSigner — it can be passed directly to Kit APIs, Kit plugins, and Codama-generated clients.

The migration skill covers the rest (async signing, bigint RPC numerics, removed APIs, commitment defaults).

References

04 同仓库更多 Skills

themusebook
themusebook/skills

youtube-clipper

YouTube 视频智能剪辑工具。下载视频和字幕,AI 分析生成精细章节(几分钟级别), 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频,并生成总结文案。 使用场景:当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词:视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video

★ 0
themusebook
themusebook/skills

viem-integration

Integrate EVM blockchains using viem. Use when user says "read blockchain data", "send transaction", "interact with smart contract", "connect to Ethereum", "use viem", "use wagmi", "wallet integration", "viem setup", or mentions blockchain/EVM development with TypeScript.

★ 0
themusebook
themusebook/skills

v4-security-foundations

Security-first Uniswap v4 hook development. Use when user mentions "v4 hooks", "hook security", "PoolManager", "beforeSwap", "afterSwap", or asks about V4 hook best practices, vulnerabilities, or audit requirements.

★ 0
themusebook
themusebook/skills

v4-sdk-integration

App-layer SDK guide for building swap and liquidity experiences directly with the Uniswap v4 SDK. Use when user asks about "v4 sdk", "uniswap v4", "v4 swap", "v4 liquidity", "PoolManager", "V4Planner", "StateView", "PositionManager", "pool state", "v4 position", "uniswap sdk", or when building swap/liquidity UX directly with SDKs rather than via the Trading API.

★ 0
themusebook
themusebook/skills

v4-hook-generator

Generate Uniswap v4 hook contracts via OpenZeppelin MCP. Use when building custom swap logic, async swaps, hook-owned liquidity, custom curves, dynamic fees, MEV protection, limit orders, or oracle hooks.

★ 0
themusebook
themusebook/skills

testing

For testing with Light Protocol programs and clients on localnet, devnet, and mainnet validation.

★ 0