solanaj
solanaj copied to clipboard
Docking jup problem
// deserialize the transaction const swapTransactionBuf = Buffer.from(swapTransaction, 'base64'); var transaction = VersionedTransaction.deserialize(swapTransactionBuf); console.log(transaction);
// sign the transaction transaction.sign([wallet.payer]);
// Execute the transaction
const rawTransaction = transaction.serialize()
const txid = await connection.sendRawTransaction(rawTransaction, {
skipPreflight: true,
maxRetries: 2
});
await connection.confirmTransaction(txid);
console.log(https://solscan.io/tx/${txid}
);
https://station.jup.ag/docs/apis/swap-api
How to achieve it?
check this code and repo https://github.com/itsmelodewyk/java-jup-ag/blob/f0ee3d1bd95a3b0fa18e42ea18d94c96bab814c9/src/main/java/utils/VersionedTransaction.java#L42