solanaj icon indicating copy to clipboard operation
solanaj copied to clipboard

Docking jup problem

Open xiaohua66888 opened this issue 9 months ago • 1 comments

// 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?

xiaohua66888 avatar May 08 '24 14:05 xiaohua66888

check this code and repo https://github.com/itsmelodewyk/java-jup-ag/blob/f0ee3d1bd95a3b0fa18e42ea18d94c96bab814c9/src/main/java/utils/VersionedTransaction.java#L42

Mykke24 avatar May 08 '24 14:05 Mykke24