Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated jupiterClient endpoints #1257

Open
smartpunter opened this issue Oct 12, 2024 · 0 comments
Open

Outdated jupiterClient endpoints #1257

smartpunter opened this issue Oct 12, 2024 · 0 comments
Labels
help wanted Extra attention is needed sdk

Comments

@smartpunter
Copy link

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.

@crispheaney crispheaney added help wanted Extra attention is needed sdk labels Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed sdk
Projects
None yet
Development

No branches or pull requests

2 participants