Skip to content

Releases: skynetcap/solanaj

v1.27.3 - Custom commitment for GPA

16 Oct 23:52

Choose a tag to compare

  • Add overloaded version of getProgamAccounts to support custom Commitment levels. processed commitment remains default for the API.

Full Changelog: v1.27.2...v1.27.3

v1.27.2

15 Oct 01:41

Choose a tag to compare

🚀 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 RpcApi with generic callWithGenericType() method to reduce unchecked warnings
  • Improved numeric type handling in ProgramAccount class
  • 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 BlockhashTest regex to allow valid blockhash lengths of 43 or 44 characters

🔧 Code Quality

  • Fixed remaining linting errors across the codebase
  • Added Lombok @Getter annotations to configuration classes for improved encapsulation
  • Removed unnecessary @SuppressWarnings annotations
  • 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

14 Oct 08:28

Choose a tag to compare

✨ 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

  1. divmod256to58() - Encoding optimization

    • Uses bit shifting (<< 8) instead of multiplication by 256
    • Specialized for base-256 to base-58 conversion
  2. divmod58to256() - Decoding optimization

    • Uses bit shifting (>> 8) for division by 256
    • Uses bit masking (& 0xFF) for modulo 256 operations
  3. 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

14 Oct 06:35

Choose a tag to compare

  • WSS subscription fixes

Full Changelog: v1.25.3...v1.25.5

v1.25.3 - WebSocket unsubscribe + subscription futures

14 Oct 05:51

Choose a tag to compare

🚀 solanaj 1.25.3 — WebSocket unsubscribe + subscription futures

✨ Highlights

  • Futures for subscription IDs: All WebSocket subscribe methods now return CompletableFuture<Long>.
  • Unified unsubscribe: Use Long subscription ID to unsubscribe.
  • Usage example: Added to SubscriptionWebSocketClient Javadoc.
  • Version bump: 1.25.3.

💥 Breaking Changes

  • unsubscribe now accepts Long (was String).
  • getSubscriptionId(String account) now returns Long.
  • Subscribe methods return CompletableFuture<Long> (was void).
    • 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, logsSubscribe
    • blockSubscribe, programSubscribe, rootSubscribe, slotSubscribe, slotsUpdatesSubscribe, voteSubscribe
  • More robust resubscription during reconnects.

📖 Docs

  • Javadoc usage example in SubscriptionWebSocketClient showing:
    • Awaiting a subscription ID
    • Unsubscribing using the ID
    • Unsubscribe by account via getSubscriptionId

🧪 Tests

  • Removed legacy testAccountUnsubscribe aligned with the new API.

🔧 Migration Guide

  • Replace String IDs with Long:
    • 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

13 Oct 05:04

Choose a tag to compare

  • 🔄 Full refactor of Websocket client
    • ⚡ Now using OkHttp 5.2.1 (connections actually hold)
    • 🎯 Better subscription management, including auto-resubscribe upon a reconnect
    • processed commitment 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

11 Sep 01:03

Choose a tag to compare

  • getProgramAccounts support for changedSinceSlot value. (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

15 Aug 00:33

Choose a tag to compare

  • GZIP request/response support

Full Changelog: v1.22.0...v1.23.0

v1.22.0

27 Jul 04:09

Choose a tag to compare

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

Full Changelog: v1.21.0...v1.22.0

v1.21.0

27 Jul 00:49

Choose a tag to compare

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

Full Changelog: v1.20.0...v1.21.0