Skip to content

Commit

Permalink
feat(JUP): jup exactOut add failback exactIn
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKozAllB committed Jul 18, 2024
1 parent 0eaff99 commit bbedaa7
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/services/bridge/sol/jupiter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,11 @@ export class JupiterService {

let transactionResponse: any;
try {
const APPLICATION_JSON = "application/json";
transactionResponse = await axios.post(
`${this.jupiterUrl}/swap`,
JSON.stringify({
quoteResponse: quoteResponse.data,
userPublicKey: userAddress,
wrapAndUnwrapSol: true,
}),
{
headers: {
"Content-Type": APPLICATION_JSON,
},
}
);
transactionResponse = await axios.post(`${this.jupiterUrl}/swap`, {
quoteResponse: quoteResponse.data,
userPublicKey: userAddress,
wrapAndUnwrapSol: true,
});
} catch (err) {
if (err instanceof AxiosError && err.response && err.response.data && err.response.data.error) {
throw new JupiterError(err.response.data.error);
Expand Down

0 comments on commit bbedaa7

Please sign in to comment.