Releases: skynetcap/solanaj
v1.27.3 - Custom commitment for GPA
- Add overloaded version of
getProgamAccountsto support custom Commitment levels.processedcommitment remains default for the API.
Full Changelog: v1.27.2...v1.27.3
v1.27.2
🚀 SolanaJ 1.27.2
This release focuses on dependency reduction, type safety improvements, and enhanced byte manipulation utilities.
📦 Dependency Management
Removed Dependencies
- Removed Moshi - Replaced with Jackson for JSON processing
- Removed BorshJ - Minimal usage justified removal
- Removed Slf4J - Minimal usage justified removal
- Removed Guava - Minimal usage justified removal
Benefits: Faster builds, reduced dependency tree, lower risk of vulnerable dependencies, and smaller artifact size.
✨ New Features
ByteUtils Enhancements
- Added
readInt32()method for signed 32-bit integer reading - Added
readUint16()methods for unsigned 16-bit integer reading - Added
readUint128()method for 128-bit unsigned integer operations - Made
reverseBytes()method public for improved accessibility
Type Safety Improvements
- Enhanced
RpcApiwith genericcallWithGenericType()method to reduce unchecked warnings - Improved numeric type handling in
ProgramAccountclass - Better handling of lamports and rentEpoch with proper Number conversions
- Methods now properly convert Object types to their respective numeric types (double/long)
Validation Improvements
- Updated
BlockhashTestregex to allow valid blockhash lengths of 43 or 44 characters
🔧 Code Quality
- Fixed remaining linting errors across the codebase
- Added Lombok
@Getterannotations to configuration classes for improved encapsulation - Removed unnecessary
@SuppressWarningsannotations - Cleaned up unused imports and variables in tests
- Removed raw type usage for cleaner, more maintainable code
📚 Documentation
- Comprehensive README.md updates with new overview section
- Added key features section
- Enhanced installation instructions for both Maven and Gradle
- Revised examples for account management, SOL transfers, and SPL token operations
- Added advanced RPC query examples
- Introduced extended program support documentation
- Added architecture guidelines and community contribution information
🔄 Migration from 1.26.0
This release maintains backward compatibility. Simply update your dependency version:
Maven:
<dependency>
<groupId>com.mmorrell</groupId>
<artifactId>solanaj</artifactId>
<version>1.27.2</version>
</dependency>Gradle:
implementation 'com.mmorrell:solanaj:1.27.2'🙏 Contributors
Thank you to everyone who contributed to this release!
Full Changelog: v1.26.0...v1.27.2
v1.26.0 - 🚀 Base58 - Performance Optimization
✨ Overview
Improved Base58 utility class performance of at least 2x when decoding Base58, using this new class, compared to BitcoinJ's implementation. Tests included.
🎯 Key Features
⚡ High-Performance Encoding & Decoding
- Lookup Table Optimization 🔍: Fast character-to-index conversion using pre-computed lookup tables
- Memory Efficiency 💾: Minimized memory allocations by reusing buffers
- Smart Zero Handling 0️⃣: Optimized skip-leading-zeros algorithm for faster processing
🛠️ Core Methods
encode(byte[] input)
Encodes byte arrays to Base58 strings with optimized base conversion
- ✅ Null-safety checks
- ✅ Empty input handling
- ✅ Leading zero preservation
- ✅ ~1.37x buffer allocation (ceil(log(256)/log(58)))
decode(String input)
Decodes Base58 strings back to byte arrays
- ✅ Character validation with descriptive error messages
- ✅ Invalid character detection
- ✅ Original leading zero restoration
encodeNoCopy(byte[] input, int zeros) 🏎️
Performance-critical encoding path that avoids array copying
⚠️ Note: Modifies input array - use when input is disposable- 🎯 Perfect for high-throughput scenarios
🔧 Technical Improvements
Optimized Division Operations
-
divmod256to58()- Encoding optimization- Uses bit shifting (
<< 8) instead of multiplication by 256 - Specialized for base-256 to base-58 conversion
- Uses bit shifting (
-
divmod58to256()- Decoding optimization- Uses bit shifting (
>> 8) for division by 256 - Uses bit masking (
& 0xFF) for modulo 256 operations
- Uses bit shifting (
-
divmod()- Generic division algorithm- Handles arbitrary base conversions up to base 256
- Long division implementation accounting for input base
Full Changelog: v1.25.3...v1.26.0
v1.25.5
- WSS subscription fixes
Full Changelog: v1.25.3...v1.25.5
v1.25.3 - WebSocket unsubscribe + subscription futures
🚀 solanaj 1.25.3 — WebSocket unsubscribe + subscription futures
✨ Highlights
- Futures for subscription IDs: All WebSocket subscribe methods now return
CompletableFuture<Long>. - Unified unsubscribe: Use
Longsubscription ID to unsubscribe. - Usage example: Added to
SubscriptionWebSocketClientJavadoc. - Version bump:
1.25.3.
💥 Breaking Changes
unsubscribenow acceptsLong(wasString).getSubscriptionId(String account)now returnsLong.- Subscribe methods return
CompletableFuture<Long>(wasvoid).- Source-compatible if you ignore the return, but recompilation required.
🆕 New / Improved
- Subscription futures complete when the server confirms the subscription ID ✅
- Consistent API across:
accountSubscribe,signatureSubscribe,logsSubscribeblockSubscribe,programSubscribe,rootSubscribe,slotSubscribe,slotsUpdatesSubscribe,voteSubscribe
- More robust resubscription during reconnects.
📖 Docs
- Javadoc usage example in
SubscriptionWebSocketClientshowing:- Awaiting a subscription ID
- Unsubscribing using the ID
- Unsubscribe by account via
getSubscriptionId
🧪 Tests
- Removed legacy
testAccountUnsubscribealigned with the new API.
🔧 Migration Guide
- Replace
StringIDs withLong:client.unsubscribe(subscriptionIdLong);Long id = client.getSubscriptionId(accountPubkey);
- Optionally await subscription establishment:
SubscriptionWebSocketClient client = SubscriptionWebSocketClient.getInstance("wss://api.devnet.solana.com"); CompletableFuture<Long> sub = client.logsSubscribe("So11111111111111111111111111111111111111112", data -> { System.out.println("Log: " + data); }); Long subscriptionId = sub.get(10, TimeUnit.SECONDS); client.unsubscribe(subscriptionId);
- Recompile your project to pick up the method signature changes.
📦 Dependency
pom.xml:1.25.3
🙏 Thanks
- Thanks to everyone using and testing WebSocket flows—this makes real-time work smoother! 🎉
Full Changelog: v.1.25.2...v1.25.3
v.1.25.2
- 🔄 Full refactor of Websocket client
- ⚡ Now using OkHttp 5.2.1 (connections actually hold)
- 🎯 Better subscription management, including auto-resubscribe upon a reconnect
- ✅
processedcommitment for logsSubscribe
- 🔧 Replace Java-Websocket library (poorly maintained and unreliable) with OkHttp
- 🚀 Websocket streaming should be much more reliable
- 🗑️ Remove BitcoinJ-Core dependency (outdated vulnerable dependencies, library bloat, extra attack surface)
- 📦 Less dependencies is better (smaller binary size, faster builds)
- 🧹 Remove protobuf-javalite dependency (unused)
- ⬆️ Update dependencies: Bouncycastle, Guava, OkHttp
Full Changelog: v1.24.0...v1.25.1 + v1.25.1...v1.25.2
v1.24.0
getProgramAccountssupport forchangedSinceSlotvalue. (Used by Helius RPC)- Switch eddsa dependency to a patched fork version (old one had a low severity issue for years, new one is patched)
- Fix lombok compilation with JDK 23
- Various dependency updates
Full Changelog: v1.23.0...v1.24.0
v1.23.0
- GZIP request/response support
Full Changelog: v1.22.0...v1.23.0
v1.22.0
What's Changed
- Added ability to use before/until params in getSignaturesForAddress by @art-p in #100
- Fix data instruction for createLookupTable by @vietduc179 in #97
New Contributors
- @art-p made their first contribution in #100
- @vietduc179 made their first contribution in #97
Full Changelog: v1.21.0...v1.22.0
v1.21.0
What's Changed
- feat:durable-nonces by @jc0803kevin in #82
- Add support for directly sending signed raw transactions in the RpcApi class by @juzi-code in #85
- Multiple dependency updates
New Contributors
- @jc0803kevin made their first contribution in #82
- @juzi-code made their first contribution in #85
Full Changelog: v1.20.0...v1.21.0