From 0dc391981d680ae7f1f03a58fab1170a756483d2 Mon Sep 17 00:00:00 2001 From: Martin Khachatryan <86410695+Martin9204@users.noreply.github.com> Date: Tue, 18 Nov 2025 18:26:10 +0400 Subject: [PATCH 1/2] Mapping solver source and destination addreses in SwapDto.cs. --- csharp/src/Infrastructure.Abstractions/Models/SwapDto.cs | 4 ++++ csharp/src/Infrastructure/Extensions/MapperExtensions.cs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/csharp/src/Infrastructure.Abstractions/Models/SwapDto.cs b/csharp/src/Infrastructure.Abstractions/Models/SwapDto.cs index 42e565ed..f02df9ba 100644 --- a/csharp/src/Infrastructure.Abstractions/Models/SwapDto.cs +++ b/csharp/src/Infrastructure.Abstractions/Models/SwapDto.cs @@ -31,6 +31,10 @@ public class SwapDto public BigInteger FeeAmount { get; set; } public IEnumerable Transactions { get; set; } = []; + + public string SourceWalletAddress { get; set; } = null!; + + public string DestinationWalletAddress { get; set; } = null!; } public class DetailedSwapDto : SwapDto diff --git a/csharp/src/Infrastructure/Extensions/MapperExtensions.cs b/csharp/src/Infrastructure/Extensions/MapperExtensions.cs index 66900211..e6315c94 100644 --- a/csharp/src/Infrastructure/Extensions/MapperExtensions.cs +++ b/csharp/src/Infrastructure/Extensions/MapperExtensions.cs @@ -28,6 +28,8 @@ public static SwapDto ToDto(this Swap swap) FeeAmount = BigInteger.Parse(swap.FeeAmount), Transactions = swap.Transactions.Select(t => t.ToDto()), DestinationAmount = BigInteger.Parse(swap.DestinationAmount), + SourceWalletAddress = swap.Route.SourceWallet.Address, + DestinationWalletAddress = swap.Route.DestinationWallet.Address, }; } From 0dabe1829b05bd1226e44c1d5e9e9358135d960b Mon Sep 17 00:00:00 2001 From: Martin Khachatryan <86410695+Martin9204@users.noreply.github.com> Date: Tue, 18 Nov 2025 18:40:37 +0400 Subject: [PATCH 2/2] Returning detailed swap dto instead of swap dto --- csharp/src/API/Endpoints/SolverV1Endpoints.cs | 4 ++-- csharp/src/Infrastructure.Abstractions/Models/SwapDto.cs | 4 ---- csharp/src/Infrastructure/Extensions/MapperExtensions.cs | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/csharp/src/API/Endpoints/SolverV1Endpoints.cs b/csharp/src/API/Endpoints/SolverV1Endpoints.cs index 27fc09a2..1ce09456 100644 --- a/csharp/src/API/Endpoints/SolverV1Endpoints.cs +++ b/csharp/src/API/Endpoints/SolverV1Endpoints.cs @@ -23,7 +23,7 @@ public static RouteGroupBuilder MapV1Endpoints(this RouteGroupBuilder group) .Produces>(); group.MapGet("/swaps/{commitId}", GetSwapAsync) - .Produces>(); + .Produces>(); group.MapPost("/transactions/build", BuildTransactionAsync) .Produces>(); @@ -121,7 +121,7 @@ private static async Task GetSwapAsync( }); } - return Results.Ok(new ApiResponse { Data = swap.ToDto() }); + return Results.Ok(new ApiResponse { Data = swap.ToDetailedDto() }); } private static async Task GetRoutesAsync( HttpContext httpContext, diff --git a/csharp/src/Infrastructure.Abstractions/Models/SwapDto.cs b/csharp/src/Infrastructure.Abstractions/Models/SwapDto.cs index f02df9ba..42e565ed 100644 --- a/csharp/src/Infrastructure.Abstractions/Models/SwapDto.cs +++ b/csharp/src/Infrastructure.Abstractions/Models/SwapDto.cs @@ -31,10 +31,6 @@ public class SwapDto public BigInteger FeeAmount { get; set; } public IEnumerable Transactions { get; set; } = []; - - public string SourceWalletAddress { get; set; } = null!; - - public string DestinationWalletAddress { get; set; } = null!; } public class DetailedSwapDto : SwapDto diff --git a/csharp/src/Infrastructure/Extensions/MapperExtensions.cs b/csharp/src/Infrastructure/Extensions/MapperExtensions.cs index e6315c94..66900211 100644 --- a/csharp/src/Infrastructure/Extensions/MapperExtensions.cs +++ b/csharp/src/Infrastructure/Extensions/MapperExtensions.cs @@ -28,8 +28,6 @@ public static SwapDto ToDto(this Swap swap) FeeAmount = BigInteger.Parse(swap.FeeAmount), Transactions = swap.Transactions.Select(t => t.ToDto()), DestinationAmount = BigInteger.Parse(swap.DestinationAmount), - SourceWalletAddress = swap.Route.SourceWallet.Address, - DestinationWalletAddress = swap.Route.DestinationWallet.Address, }; }