Sign Transaction
Using the Solanaweb3.js@1
library, you can sign the transaction as follows:
Set up dependencies and wallet for signing
Set up dependencies and wallet for signing
Set up dependencies for signingSet up Development Wallet
You can paste in your private key for testing but this is not recommended for production.
- Either use your private key in the project directly, you can do it via a
.env
file. - Or set up your private key in the Solana CLI.
Sign Transaction
Execute Order
By making a post request to the/execute
endpoint, Jupiter executes the swap transaction on behalf of you/your users through our own proprietary transaction sending infrastructure. This already includes handling of slippage, priority fees, transaction landing and more.
To make a post request to execute a swap order, you need to pass in the required parameters,:
signedTransaction
: The signed and serialized base64 encodedtransaction like aboverequestId
: The order response’s request ID from Get Order
Execute Order
Transaction Status Polling
After our transaction sending service has submitted your swap, we will actively poll for your transaction status as part of the/execute
endpoint. You will receive a response with the status of the swap.
- You can submit with the same
signedTransaction
andrequestId
for up to 2 minutes regardless of state, to poll for the transaction status. - The transaction will not double execute since it has the same signature.
- If connection got dropped, you can try again with the same
signedTransaction
andrequestId
to poll for the status of the swap. - If there is no status, the order likely expired (did not get processed onchain and failed), but reach out to us if cases like this happen.
Transaction Status Polling