You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: catch slippage and on-chain tx errors in trade functions (#15)
* fix: catch slippage and on-chain errors from send_tx in trade functions
Implements B-06 (Slippage rejection is dead code).
- Add TransactionFailedError in protocol/client.py that parses on-chain
error codes from Solana transaction failures
- Add slippage error code constants for both pump.fun bonding curve
(6002, 6003, 6042) and PumpSwap AMM (6004, 6040)
- Wrap send_tx calls in buy_token, sell_token, buy_pumpswap, sell_pumpswap
with structured error handling returning {"error": "slippage"} or
{"error": "tx_error"}
- The existing dead code in commands/trade.py (exit code 3 for slippage)
is now live
- Add 15 new unit tests covering all error paths
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: stop gitignoring idl/ so protocol definitions stay versioned
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments