๐๏ธ Solana Kit Porter (v1 โ v2)
Automate your migration from the legacy @solana/web3.js (v1.x) to the modular, high-performance @solana/kit (v2.x).
The Solana SDK has undergone a massive architectural shift. Manual migration is tedious and error-prone. Solana Kit Porter handles the heavy lifting, refactoring your RPC calls, transaction building logic, and address handling in seconds.
โจ Features
- ๐ Smart RPC Chains: Converts
Connectionmethods into the new modular.send()functional chains. - ๐ Transaction Piping: Automatically refactors
new Transaction().add()into the modernpipe()andappendTransactionMessageInstructions()pattern. - ๐ Address Handling: Precise transformation of
new PublicKey(str)to the optimizedaddress(str)helper. - ๐ Keypair Modernization: Migrates legacy Keypair generation to the new
generateKeyPairSigner()andcreateKeyPairSignerFromBytes()APIs. - ๐ค AI-Powered Refinement: Uses context-aware AI to handle complex logic changes that deterministic rules might miss.
๐ ๏ธ Quick Start
Ensure you have the Codemod CLI installed. Then, run this command in your project root:
bash
๐งช Verified on Real Projects
We have successfully tested this codemod on:
-
solana-labs/dapp-scaffold -
solana-labs/solana-program-library(Client-side scripts) - Custom production dApps
๐ฆ What's Migrated?
| Feature | Legacy (v1) | Modern (v2) |
|---|---|---|
| Imports | @solana/web3.js | @solana/kit |
| RPC | new Connection(url) | createSolanaRpc(url) |
| Calls | connection.getBalance(pubkey) | connection.getBalance(pubkey).send() |
| Addresses | new PublicKey(str) | address(str) |
| Transactions | new Transaction().add(ix) | pipe(createTransaction(), ...) |
| Transfers | SystemProgram.transfer({...}) | getTransferInstruction({...}) |
๐ License
Distributed under the MIT License. See LICENSE for more information.
<p align="center"> Built with โค๏ธ for the <b>Boring AI Hackathon</b> </p>