Skip to content

feat(swap): add Smart Transactions support to executeJupiterSwap (#199) #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

hasip-timurtas
Copy link
Contributor

@hasip-timurtas hasip-timurtas commented Jun 20, 2025

Add Smart Transactions support to Jupiter swaps

Fixes #199

Adds Smart Transactions support to executeJupiterSwap and merges Jupiter API improvements from #204.

Changes

  • Added useSmartTransaction parameter for enhanced reliability during network congestion
  • Merged Jupiter Lite API endpoints and improved error handling from Update Jupiter API endpoints and enhance error handling in RpcClient … #204
  • Restored complete priority level support: low, medium, high, veryHigh, unsafeMax
  • Smart Transactions automatically handle priority fees and compute units when enabled

Usage

const result = await helius.rpc.executeJupiterSwap({
  inputMint: 'So11111111111111111111111111111111111111112',
  outputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
  amount: 10000000,
  useSmartTransaction: true, // New parameter
  priorityLevel: 'veryHigh',
}, wallet);

Defaults to false for backward compatibility.

Benefits

  • Better success rates during network congestion
  • Improved performance with Jupiter Lite API endpoints
  • Enhanced error handling and validation
  • Full priority level control
  • Zero breaking changes (defaults to false)

Testing

  • ✅ All existing tests pass
  • ✅ TypeScript compilation successful
  • ✅ Lint and format checks pass

- Updated the Jupiter swap example to include support for Smart Transactions, improving reliability during network congestion.
- Added detailed documentation on Smart Transactions benefits and usage.
- Refactored code for better readability and consistency, including formatting adjustments in various files.
- Introduced new types for Jupiter swap requests and priority fee structures in the types definition.

This commit improves the overall user experience and provides clearer guidance on utilizing the new features.
- Deleted the `createCollectionWebhook` example file to streamline the examples directory.
- Updated the README to remove references to `createCollectionWebhook`, ensuring documentation reflects the current state of the codebase.
- Modified `tsconfig.json` to include and exclude specific directories for better TypeScript configuration.

This commit enhances clarity in the documentation and maintains an organized structure in the examples.
@hasip-timurtas
Copy link
Contributor Author

I merged main to my branch please review this PR. @guneysol @0xIchigo Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Smart Transactions support to executeJupiterSwap
1 participant