Hello friends i get trouble i'm trying to swap with only route on jupiter this what is do :
const quoteResponse = data
// {
// inputMint: 'So11111111111111111111111111111111111111112',
// inAmount: '1000000',
// outputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
// outAmount: '160850',
// otherAmountThreshold: '160850',
// swapMode: 'ExactIn',
// slippageBps: 0,
// platformFee: null,
// priceImpactPct: '0',
// routePlan: [
// { swapInfo: [Object], percent: 100 },
// { swapInfo: [Object], percent: 100 }
// ],
// contextSlot: 299505353,
// timeTaken: 0.014201567
// }
const { swapTransaction } = await (
await fetch('https://quote-api.jup.ag/v6/swap', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
quoteResponse,
userPublicKey: wallet.publicKey.toString(),
wrapAndUnwrapSol: true,
computeUnitPriceMicroLamports : "auto",
})
})
).json();
const swapTransactionBuf = Buffer.from(swapTransaction, 'base64');
var transaction = VersionedTransaction.deserialize(swapTransactionBuf);
transaction.sign([wallet.payer]);
const rawTransaction = transaction.serialize()
const txid = await connection.sendRawTransaction(rawTransaction, {
skipPreflight: true,
maxRetries: 10
});
console.log(txid);
But the problem is this :
How can i only call 1 instruction : Route ?? without red instructions ?