- Add SubscriptionHandle struct to manage async subscription tasks
- Implement graceful shutdown mechanism with unsub_fn callback
- Export new module in common/mod.rs
- Support for proper resource cleanup in subscription management
Major changes:
- Refactor event parsing system: migrate scattered logs_* modules to unified event_parser architecture
- Add unified UnifiedEvent trait and EventParser trait for standardized event parsing interface
- Introduce GenericEventParser and EventParserFactory for plugin-style protocol extension
- Add match_event! macro to simplify event type matching and handling
- Add Raydium Launchpad (Bonk.fun) protocol support:
- Complete buy/sell trading functionality
- Pool state management and querying
- Event parsing and subscription
- Update trading system to support new protocol architecture
- Refactor constants organization, rename raydium to raydium_launchpad
- Update documentation and example code
Technical improvements:
- Unified event interface design for better code maintainability
- Factory pattern implementation for dynamic protocol loading
- Generic event parser to reduce code duplication
- Improved error handling and type safety
Breaking Changes:
- Remove old logs_* modules, use new event_parser system
- Protocol constants path change: raydium -> raydium_launchpad
- Event subscription API updated to unified interface
- Rename PumpFun class to SolanaTrade to better reflect its expanded functionality
- Rename copy_buy methods to buy for better API clarity
- Update ShredStream and Yellowstone gRPC subscription examples
- Add bonding_curve parameter to trading methods
- Improve documentation with updated code examples
- Update README files with new features and API changes
This commit introduces two main enhancements:
1. Adds an `auto_handle_wsol` parameter to `PumpSwap` buy/sell functions. When enabled, the SDK automatically manages the wrapping of SOL to WSOL and unwrapping back to SOL, simplifying client-side logic.
2. Enriches `PumpSwap` gRPC buy/sell events by parsing transaction instructions to include token mints and account addresses, providing more context for event consumers.
This commit refactors the `copy_buy_with_tip`, `sell_by_percent`, `sell_by_amount`, and their `with_tip` variants within the `PumpFun` struct.
The functions now accept parameter objects (`BuyWithTipParams`, `SellParams`, `SellWithTipParams`) instead of a list of individual arguments. This change improves code modularity, readability, and allows for dynamic dispatch to the correct protocol implementation (PumpFun or PumpSwap) based on the provided protocol parameters.
- Add unified TradeExecutor interface and protocol abstraction
- Refactor PumpFun/PumpSwap into adapter pattern
- Introduce TradeFactory for multi-protocol support
- Add parallel execution and unified parameter system
- Include Raydium protocol support and log parsing
- Simplify codebase structure and improve maintainability