feat(pumpswap): Auto-wrap SOL and enrich gRPC events
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 is contained in:
@@ -267,6 +267,7 @@ impl PumpFun {
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
true,
|
||||
).await
|
||||
} else {
|
||||
Err(anyhow::anyhow!("Unsupported trade platform: {}", trade_platform))
|
||||
@@ -350,6 +351,7 @@ impl PumpFun {
|
||||
protocol_params.pool_quote_token_account.clone(),
|
||||
protocol_params.user_base_token_account.clone(),
|
||||
protocol_params.user_quote_token_account.clone(),
|
||||
protocol_params.auto_handle_wsol,
|
||||
).await
|
||||
} else {
|
||||
return Err(anyhow::anyhow!("Invalid protocol params for PumpFun"));
|
||||
@@ -403,6 +405,7 @@ impl PumpFun {
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
true,
|
||||
).await
|
||||
} else {
|
||||
Err(anyhow::anyhow!("Unsupported trade platform: {}", trade_platform))
|
||||
|
||||
Reference in New Issue
Block a user