Overview of Changes
The v1.0 release represents an overhaul with some breaking changes.Key Changes
- Modular Architecture: Core logic moved to
@swig-wallet/lib - Instruction-Based API: Functions return
TransactionInstruction[]instead of single instructions - Simplified Package Structure:
@swig-wallet/classicnow acts as a thin wrapper - Updated Dependencies: Moved from
@solana/spl-tokento@solana-program/token
Package Changes
Before (Beta)
After (v1.0)
For Web3.js 1.x applications:
For Web3.js 2.0 applications:
After (v1.0)
Function Migrations
Creating a Swig
Before (Beta)
After (v1.0)
Swig Class Changes
The Swig class has been significantly refactored. All static methods have been removed and replaced with standalone functions.Static Method Removal
Before (Beta)
After (v1.0)
Instance Method Changes
The Swig instance methods remain largely the same, but some may have changed from synchronous to asynchronous:New Sub-Account Functions
The v1.0 release introduces several new sub-account management functions:Authority Creation Changes
Before (Beta)
After (v1.0)
Import Changes
The v1.0 release represents a complete restructuring of the package exports. Most functionality has been moved to@swig-wallet/lib and re-exported through the classic package.
Package Structure Changes
Before (Beta) - Direct Module Exports
After (v1.0) - Lib-Based Exports
Removed Direct Imports
These modules are no longer directly exported from@swig-wallet/classic:
- Authority classes:
Ed25519Authority,Secp256k1Authority, etc. - Role utilities: Direct role manipulation functions
- RPC helpers: Connection and RPC utilities
- Swig class: Static methods removed, instance available via lib
- Utils: Utility functions moved to lib
- Wallet: Wallet-related functionality moved to lib
Core Classes
Actionsclass is now imported from@swig-wallet/lib(re-exported by@swig-wallet/classic)Swigclass is now imported from@swig-wallet/lib(re-exported by@swig-wallet/classic)- Authority classes have been completely replaced with info creation functions
Function Naming
createSwig()→getCreateSwigInstruction()addAuthorityInstruction()→getAddAuthorityInstructions()signInstruction()→getSignInstructions()removeAuthorityInstruction()→getRemoveAuthorityInstructions()createSessionInstruction()→getCreateSessionInstructions()createSubAccountInstruction()→getCreateSubAccountInstructions()toggleSubAccountInstruction()→getToggleSubAccountInstructions()withdrawFromSubAccountInstruction()→getWithdrawFromSubAccountSubAccountInstructions()
Dependency Updates
For Web3.js 1.x applications:
For Web3.js 2.0 applications:
Migration Checklist
- Update package dependencies
- Replace single instruction functions with instruction array functions
- Update authority creation from classes to info functions
- Update PDA derivation calls
- Replace
Ed25519Authority.fromPublicKey()withcreateEd25519AuthorityInfo() - Replace
createSessionInstruction()withgetCreateSessionInstructions() - Replace sub-account functions:
createSubAccountInstruction(),toggleSubAccountInstruction(),withdrawFromSubAccountInstruction() - Replace Swig static methods:
Swig.create(),Swig.fetch(),Swig.fetchNullable() - Update function parameters from
(role, payer, ...)to(swig, roleId, ...) - Update transaction building to spread instruction arrays
- Remove direct imports of removed modules (authority, role, rpc, utils, wallet)
- Test all functionality with the new API
- Update error handling for new function signatures
Common Migration Issues
Issue: Functions returning arrays instead of single instructions
Solution: Use the spread operator when adding to transactions:Issue: Function parameter signatures changed
Solution: Update function calls to use new parameter structure:Issue: Import errors for removed classes
Solution: Replace with new function-based API:Issue: Swig static methods no longer available
Solution: Use the new standalone functions:Issue: Sub-account functions not found
Solution: Use the new instruction array functions:Getting Help
If you encounter issues during migration:- Check the API documentation
- Review the updated tutorials
- Examine the example code
- Open an issue on the GitHub repository

