feat: upgrade to v3.3.1 with enhanced error handling
Major changes: - Bump version from 3.3.0 to 3.3.1 - Update GasFeeStrategy API with min/max data size parameters - Enhance trade return values with Optional<anyhow::Error> in buy/sell/sell_percent methods - Fix PumpFun Mayhem mode fee recipient constant bug - Standardize gas fee strategy parameters across all examples - Update all examples to handle new triple return value (bool, Signature, Option<Error>)
This commit is contained in:
+3
-3
@@ -345,7 +345,7 @@ impl SolanaTrade {
|
||||
/// - Network or RPC errors occur
|
||||
/// - Insufficient SOL balance for the purchase
|
||||
/// - Required accounts cannot be created or accessed
|
||||
pub async fn buy(&self, params: TradeBuyParams) -> Result<(bool, Signature), anyhow::Error> {
|
||||
pub async fn buy(&self, params: TradeBuyParams) -> Result<(bool, Signature, Option<anyhow::Error>), anyhow::Error> {
|
||||
if params.slippage_basis_points.is_none() {
|
||||
println!(
|
||||
"slippage_basis_points is none, use default slippage basis points: {}",
|
||||
@@ -445,7 +445,7 @@ impl SolanaTrade {
|
||||
/// - Insufficient token balance for the sale
|
||||
/// - Token account doesn't exist or is not properly initialized
|
||||
/// - Required accounts cannot be created or accessed
|
||||
pub async fn sell(&self, params: TradeSellParams) -> Result<(bool, Signature), anyhow::Error> {
|
||||
pub async fn sell(&self, params: TradeSellParams) -> Result<(bool, Signature, Option<anyhow::Error>), anyhow::Error> {
|
||||
if params.slippage_basis_points.is_none() {
|
||||
println!(
|
||||
"slippage_basis_points is none, use default slippage basis points: {}",
|
||||
@@ -557,7 +557,7 @@ impl SolanaTrade {
|
||||
mut params: TradeSellParams,
|
||||
amount_token: u64,
|
||||
percent: u64,
|
||||
) -> Result<(bool, Signature), anyhow::Error> {
|
||||
) -> Result<(bool, Signature, Option<anyhow::Error>), anyhow::Error> {
|
||||
if percent == 0 || percent > 100 {
|
||||
return Err(anyhow::anyhow!("Percentage must be between 1 and 100"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user