-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
What problem does this new feature solve?
The Solana adapter currently uses @solana/web3.js 1.x types (PublicKey class, Transaction/VersionedTransaction classes). Modern Solana libraries are migrating to @solana/kit (web3.js 2.x), which uses:
Address- branded string type from@solana/addressesTransaction & TransactionWithLifetime- functional transaction types from@solana/transactions
This creates type incompatibility when integrating AppKit with Effect-TS based Solana libraries or other modern tooling built on the 2.x SDK.
Specific pain points:
publicKey: PublicKeycannot be assigned topublicKey: Addresswithout manual conversionsignTransaction<T extends AnyTransaction>uses legacy types, incompatible with<T extends Transaction & TransactionWithLifetime>- No clean way to bridge between the two type systems
Describe the solution you'd like
Add support for @solana/kit types alongside the existing @solana/web3.js types. Options:
-
Dual exports: Provide both legacy and modern typed interfaces
// Existing export interface Provider { publicKey?: PublicKey; signTransaction<T extends AnyTransaction>(tx: T): Promise<T>; } // New export interface ModernProvider { publicKey: Address | null; signTransaction<T extends Transaction & TransactionWithLifetime>(tx: T): Promise<T>; }
-
Conversion utilities: Export helpers to convert between SDK generations
export function toModernAddress(pk: PublicKey): Address; export function toLegacyPublicKey(addr: Address): PublicKey;
-
Full migration to
@solana/kitwith backwards compatibility shims
The Solana ecosystem is gradually moving to 2.x - supporting it now would future-proof AppKit for this transition.