-
Notifications
You must be signed in to change notification settings - Fork 200
Description
jupiterClient from SDK internally uses 2 endpoints: /quote to retrieve swap route and /swap to retrieve transaction data.
Recently jupiter have updated their API and now this functionality is provided by different endpoints: /quote and /transaction.
While SDK allows to specify custom URL for jupiter swap api, at the moment it is impossible to use actual endpoint "https://api.jup.ag/swap/v6"
I would suggest to implement new optional configuration object JupiterURLs with 'quote' and 'transaction' fields. If this fields exists - then use them for requests.
This is much more elegant solution, comparent to current code with hardcoded default routes and api version:
const apiVersionParam =
this.url === 'https://quote-api.jup.ag' ? '/v6' : '';
const quote = await (
await fetch(`${this.url}${apiVersionParam}/quote?${params.toString()}`)
).json();
This change would allow users to use current version of JUP API now and in the future.