Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Assets/SequenceSDK/Marketplace/CurrencySwapTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public async Task GetSwapQuoteTest_FailedToFetchPrice()
}
catch (Exception e)
{
Assert.IsTrue(e.Message.Contains("Error fetching swap price"));
Assert.IsTrue(e.Message.Contains("Error fetching swap quote"));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ public async Task<SwapPrice> GetSwapPrice(Address buyCurrency, Address sellCurre
{
GetSwapPriceRequest args = new GetSwapPriceRequest(buyCurrency, sellCurrency, buyAmount, _chain,
slippagePercent);
string url = BaseUrl.AppendTrailingSlashIfNeeded() + "GetSwapPrice";
string url = BaseUrl.AppendTrailingSlashIfNeeded() + "GetSwapPermit2Price";
try
{
GetSwapPriceResponse response =
await _client.SendRequest<GetSwapPriceRequest, GetSwapPriceResponse>(url, args);
if (response.swapPrice == null)
if (response.swapPermit2Price == null)
{
throw new Exception("No swap path with sufficient liquidity found");
}
OnSwapPriceReturn?.Invoke(response.swapPrice);
return response.swapPrice;
OnSwapPriceReturn?.Invoke(response.swapPermit2Price);
return response.swapPermit2Price;
}
catch (Exception e)
{
Expand All @@ -64,13 +64,13 @@ public async Task<SwapPrice[]> GetSwapPrices(Address userWallet, Address buyCurr
{
GetSwapPricesRequest args = new GetSwapPricesRequest(userWallet, buyCurrency, buyAmount, _chain,
slippagePercentage);
string url = BaseUrl.AppendTrailingSlashIfNeeded() + "GetSwapPrices";
string url = BaseUrl.AppendTrailingSlashIfNeeded() + "GetSwapPermit2Prices";
try
{
GetSwapPricesResponse response =
await _client.SendRequest<GetSwapPricesRequest, GetSwapPricesResponse>(url, args);
OnSwapPricesReturn?.Invoke(response.swapPrices);
return response.swapPrices;
OnSwapPricesReturn?.Invoke(response.swapPermit2Prices);
return response.swapPermit2Prices;
}
catch (Exception e)
{
Expand Down Expand Up @@ -102,7 +102,7 @@ await AssertWeHaveSufficientBalance(userWallet, buyCurrency, sellCurrency, buyAm

GetSwapQuoteRequest args = new GetSwapQuoteRequest(userWallet, buyCurrency, sellCurrency, buyAmount, _chain,
slippagePercentage, includeApprove);
string url = BaseUrl.AppendTrailingSlashIfNeeded() + "GetSwapQuote";
string url = BaseUrl.AppendTrailingSlashIfNeeded() + "GetSwapQuoteV2";
try
{
GetSwapQuoteResponse response =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ namespace Sequence.Marketplace
[Serializable]
internal class GetSwapPriceResponse
{
public SwapPrice swapPrice;
public SwapPrice swapPermit2Price;

[Preserve]
public GetSwapPriceResponse(SwapPrice swapPrice)
public GetSwapPriceResponse(SwapPrice swapPermit2Price)
{
this.swapPrice = swapPrice;
this.swapPermit2Price = swapPermit2Price;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ namespace Sequence.Marketplace
[Serializable]
public class GetSwapPricesResponse
{
public SwapPrice[] swapPrices;
public SwapPrice[] swapPermit2Prices;

[Preserve]
public GetSwapPricesResponse(SwapPrice[] swapPrices)
public GetSwapPricesResponse(SwapPrice[] swapPermit2Prices)
{
this.swapPrices = swapPrices;
this.swapPermit2Prices = swapPermit2Prices;
}
}
}
2 changes: 1 addition & 1 deletion Packages/Sequence-Unity/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xyz.0xsequence.waas-unity",
"version": "4.0.2",
"version": "4.0.3",
"displayName": "Sequence Embedded Wallet SDK",
"description": "A Unity SDK for Sequence APIs",
"unity": "2021.3",
Expand Down