Skip to main content

Swig TypeScript SDK v1.0 Release Notes

The v1.0 release of the Swig TypeScript SDK represents a complete architectural overhaul designed to improve developer experience, maintainability, and extensibility.

๐Ÿš€ Whatโ€™s New

Modular Architecture

  • @swig-wallet/lib: Core business logic and functionality
  • @swig-wallet/classic: High-level wrapper for Web3.js 1.x compatibility
  • @swig-wallet/kit: High-level wrapper for Web3.js 2.0 (Solana Kit) compatibility
  • @swig-wallet/coder: Low-level encoding/decoding utilities

Instruction-Based API

All functions now return TransactionInstruction[] for better composability:
// v1.0
const instructions = await getCreateSwigInstruction({...});
const transaction = new Transaction().add(...instructions);

Enhanced Type Safety

  • Better TypeScript support throughout the SDK
  • Clearer function signatures and return types
  • Improved error handling

๐Ÿ’ฅ Breaking Changes

Package Structure

  • Core functionality moved from @swig-wallet/classic to @swig-wallet/lib
  • @swig-wallet/classic now acts as a thin wrapper layer
  • All exports available through @swig-wallet/classic via re-exports

Function Signatures

Beta Versionv1.0 Version
createSwig()getCreateSwigInstruction()
addAuthorityInstruction()getAddAuthorityInstructions()
signInstruction()getSignInstructions()
removeAuthorityInstruction()getRemoveAuthorityInstructions()

Authority Creation

// Beta
const authority = Ed25519Authority.fromPublicKey(publicKey);

// v1.0
const authorityInfo = createEd25519AuthorityInfo(publicKey);

PDA Derivation

// Beta
const [swigAddress] = findSwigPda(id);

// v1.0
const swigAddress = findSwigPda(id);

Dependencies

  • Removed: @solana/spl-token
  • Added: @solana-program/token@^0.5.1
  • Added: @swig-wallet/lib (workspace dependency)
  • Added: bn.js@^5.2.2

๐Ÿ“ฆ Installation

npm install @swig-wallet/classic@^1.0.0 @solana-program/token@^0.5.1
Remove old dependencies:
npm uninstall @solana/spl-token

๐Ÿ”„ Migration Guide

See the complete Migration Guide for detailed instructions on upgrading from beta versions.

Quick 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
  • Use spread operator when adding instructions to transactions
  • Test all functionality with new API

๐Ÿ“š Updated Documentation

๐Ÿ› Bug Fixes

  • Improved error handling across all instruction builders
  • Better validation of input parameters
  • More consistent return types

๐Ÿ”ฎ Whatโ€™s Next

  • Enhanced session management
  • Additional authority types
  • Integration with Gill
  • Performance optimizations for both Web3.js versions

๐Ÿ“– Resources

๐Ÿ™ Acknowledgments

Thank you to all beta users who provided feedback that shaped this v1.0 release. The new architecture provides a solid foundation for future development while maintaining the powerful features that make Swig unique.
For questions or support, please open an issue on our GitHub repository.