From 5a8cb32a3dbf35bd4b2df6cb6ab6ecdb536fddf4 Mon Sep 17 00:00:00 2001 From: YY Date: Fri, 13 Dec 2024 12:49:43 +0800 Subject: [PATCH 1/2] change to new endpoints --- src/Solana.Unity.Dex/Jupiter/JupiterDex.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Solana.Unity.Dex/Jupiter/JupiterDex.cs b/src/Solana.Unity.Dex/Jupiter/JupiterDex.cs index 50b83eba..078fe5e0 100644 --- a/src/Solana.Unity.Dex/Jupiter/JupiterDex.cs +++ b/src/Solana.Unity.Dex/Jupiter/JupiterDex.cs @@ -35,7 +35,7 @@ public class JupiterDexAg: IDexAggregator /// Public constructor; Create the JupiterDexAg instance with the account to use for the aggregator. /// /// - public JupiterDexAg(string endpoint = "https://quote-api.jup.ag/v6") + public JupiterDexAg(string endpoint = "https://api.jup.ag/") { _endpoint = endpoint; _httpClient = new HttpClient(); @@ -56,7 +56,7 @@ public JupiterDexAg(string endpoint = "https://quote-api.jup.ag/v6") /// /// /// - public JupiterDexAg(PublicKey account, string endpoint = "https://quote-api.jup.ag/v6") + public JupiterDexAg(PublicKey account, string endpoint = "https://api.jup.ag/") { _account = account; _endpoint = endpoint; @@ -108,7 +108,7 @@ public async Task GetSwapQuote( var queryString = string.Join("&", queryParams.Select(kv => $"{kv.Key}={kv.Value}")); // Construct the request URL - var apiUrl = _endpoint + "/quote?" + queryString; + var apiUrl = _endpoint + "/quote/v1?" + queryString; using var httpReq = new HttpRequestMessage(HttpMethod.Get, apiUrl); @@ -141,7 +141,7 @@ public async Task Swap( userPublicKey ??= _account; // Construct the request URL - var apiUrl = _endpoint + "/swap"; + var apiUrl = _endpoint + "/swap/v1"; var req = new SwapRequest() { From f815200df7c7a230699fd3222e3d38035cc8c1b2 Mon Sep 17 00:00:00 2001 From: YY Date: Mon, 3 Feb 2025 22:04:12 +0800 Subject: [PATCH 2/2] Update JupiterDex.cs --- src/Solana.Unity.Dex/Jupiter/JupiterDex.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Solana.Unity.Dex/Jupiter/JupiterDex.cs b/src/Solana.Unity.Dex/Jupiter/JupiterDex.cs index 078fe5e0..996dd776 100644 --- a/src/Solana.Unity.Dex/Jupiter/JupiterDex.cs +++ b/src/Solana.Unity.Dex/Jupiter/JupiterDex.cs @@ -108,7 +108,7 @@ public async Task GetSwapQuote( var queryString = string.Join("&", queryParams.Select(kv => $"{kv.Key}={kv.Value}")); // Construct the request URL - var apiUrl = _endpoint + "/quote/v1?" + queryString; + var apiUrl = _endpoint + "/swap/v1/quote?" + queryString; using var httpReq = new HttpRequestMessage(HttpMethod.Get, apiUrl); @@ -141,7 +141,7 @@ public async Task Swap( userPublicKey ??= _account; // Construct the request URL - var apiUrl = _endpoint + "/swap/v1"; + var apiUrl = _endpoint + "/swap/v1/swap"; var req = new SwapRequest() { @@ -222,4 +222,4 @@ public async Task GetTokenByMint(string mint) IList tokens = await GetTokens(TokenListType.All); return tokens.First(t => string.Equals(t.Mint, mint, StringComparison.CurrentCultureIgnoreCase)); } -} \ No newline at end of file +}