using MediatR; using Web.Api.Common; namespace Web.Api.Endpoints.Crypto; internal sealed class CryptoOrderbook : IEndpoint { public void MapEndpoint(IEndpointRouteBuilder app) { app.MapGet("api/crypto/{symbol}/orderbook", async ( string symbol, ISender sender, CancellationToken ct ) => { return ApiResponse.Ok( await sender.Send(new Application.Features.Api.Crypto.Orderbook.Get.Query(symbol), ct) ); }) .WithTags("Crypto") .AllowAnonymous(); app.MapGet("api/crypto/{symbol}/orderbook/live", async ( string symbol, ISender sender, CancellationToken ct ) => { return ApiResponse.Ok( await sender.Send(new Application.Features.Api.Crypto.Orderbook.GetLive.Query(symbol), ct) ); }) .WithTags("Crypto") .AllowAnonymous(); } }