solana_kit_jupiter 0.9.1
solana_kit_jupiter: ^0.9.1 copied to clipboard
Jupiter Exchange client for Solana Kit Dart — Swap API v2 (order/execute and raw build), Price v3, and Token v2 APIs.
solana_kit_jupiter #
Jupiter Exchange client for the Solana Kit Dart SDK: the Swap API v2 (quote, assembled transaction, execution, and raw build), Price API v3, and Token API v2, with Solana Kit transaction decoding.
What you get #
- Swap API v2 — request a quote plus an assembled v0 transaction (
/swap/v2/order), submit the signed transaction for managed execution (/swap/v2/execute), or fetch the raw instruction set for self-landing swaps (/swap/v2/build) - Price API v3 — USD prices for up to fifty mints per request
- Token API v2 — search, tag, category, and recent token metadata
- Transaction decode — turn the returned base64 wire transaction into a typed
Transactionfor inspection and signing - Injectable transport — pass a custom HTTP client through
JupiterConfigfor tests and middleware
Out of v1 scope: the Trigger API (limit orders and DCA), the Referral on-chain program, Lend, Prediction, Studio, and the Jupiter Terminal web widget (which cannot serve Dart or Flutter apps).
Auth #
All endpoints accept an optional x-api-key header. Without a key, Jupiter serves keyless traffic on https://api.jup.ag at a reduced rate limit; keys from the Jupiter developer portal unlock higher tiers on the same base URL.
Installation #
Install the package directly:
dependencies:
"solana_kit_jupiter": ^
If your app uses several Solana Kit packages together, you can also depend on the umbrella package instead:
dart pub add solana_kit
Inside this monorepo, Dart workspace resolution uses the local package automatically.
:::
Installation #
Install the package directly:
dependencies:
"solana_kit_jupiter": ^
If your app uses several Solana Kit packages together, you can also depend on the umbrella package instead:
dart pub add solana_kit
Inside this monorepo, Dart workspace resolution uses the local package automatically.
Documentation #
- Package page: https://pub.dev/packages/solana_kit_jupiter
- API reference: https://pub.dev/documentation/solana_kit_jupiter/latest/
- Workspace docs: https://openbudgetfun.github.io/solana_kit/
- Package catalog entry: https://openbudgetfun.github.io/solana_kit/reference/package-catalog#solana_kit_jupiter
- Source code: https://github.com/openbudgetfun/solana_kit/tree/main/packages/solana_kit_jupiter
For architecture notes, getting-started guides, and cross-package examples, start with the workspace docs site and then drill down into the package README and API reference.
Usage #
Swap through Jupiter's managed order flow #
/order returns a quote plus an assembled v0 transaction; sign it with Solana Kit signers and submit it through /execute.
import 'package:solana_kit_addresses/solana_kit_addresses.dart';
import 'package:solana_kit_jupiter/solana_kit_jupiter.dart';
Future<void> main() async {
const solAddress = Address('So11111111111111111111111111111111111111112');
const usdcAddress = Address(
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
);
final jupiter = createJupiterClient(JupiterConfig(apiKey: 'your-api-key'));
final order = await jupiter.swap.getOrder(
JupiterOrderRequest(
inputMint: solAddress,
outputMint: usdcAddress,
amount: BigInt.from(10000000), // 0.01 SOL
slippageBps: 50,
),
);
final transaction = decodeBase64SwapTransaction(order.encodedTransaction!);
// Inspect, sign the transaction with solana_kit_signers, then submit it.
print(transaction);
}
For self-landing swaps, use jupiter.swap.buildSwap(...) to fetch the raw instruction set instead of the assembled transaction.
Key APIs #
createJupiterClient,JupiterConfigJupiterSwapClient:getOrder,executeOrder,buildSwapdecodeBase64SwapTransactionJupiterPriceClient:getPricesJupiterTokenClient:search,tagged,category,recent- Models:
JupiterOrderRequest,JupiterOrderResponse,JupiterExecutionResponse,JupiterBuildResponse,JupiterPrice,JupiterTokenItem,JupiterException
Reference #
Built against the Jupiter Swap API v2, Price API v3, and Token API v2 as documented at https://developers.jup.ag, including the keyless-tier migration from the deprecated lite-api.jup.ag host.