Price reminder and init approval

* Start price reminder grain

* Add config and init grain at startup

* Save init wallet when already init
This commit is contained in:
Oda
2025-09-13 02:29:14 +07:00
committed by GitHub
parent da50b30344
commit 56b4f14eb3
69 changed files with 2373 additions and 701 deletions

View File

@@ -147,5 +147,18 @@ namespace Managing.Api.Controllers
var user = await GetUser();
return Ok(_AccountService.DeleteAccount(user, name));
}
/// <summary>
/// Retrieves the approval status for all supported trading exchanges for the authenticated user.
/// Returns a list showing each exchange with its initialization status (true/false).
/// </summary>
/// <returns>A list of exchange approval statuses.</returns>
[HttpGet("exchange-approval-status")]
public async Task<ActionResult<List<ExchangeApprovalStatus>>> GetExchangeApprovalStatus()
{
var user = await GetUser();
var exchangeStatuses = await _AccountService.GetExchangeApprovalStatusAsync(user);
return Ok(exchangeStatuses);
}
}
}

View File

@@ -3,7 +3,6 @@ using Managing.Api.Models.Requests;
using Managing.Api.Models.Responses;
using Managing.Application.Abstractions.Grains;
using Managing.Application.Abstractions.Services;
using Managing.Application.Hubs;
using Managing.Application.ManageBot.Commands;
using Managing.Domain.Backtests;
using Managing.Domain.Bots;
@@ -16,7 +15,6 @@ using Managing.Domain.Trades;
using MediatR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using static Managing.Common.Enums;
namespace Managing.Api.Controllers;
@@ -35,7 +33,6 @@ public class DataController : ControllerBase
private readonly ICacheService _cacheService;
private readonly IStatisticService _statisticService;
private readonly IAgentService _agentService;
private readonly IHubContext<CandleHub> _hubContext;
private readonly IMediator _mediator;
private readonly ITradingService _tradingService;
private readonly IGrainFactory _grainFactory;
@@ -58,7 +55,6 @@ public class DataController : ControllerBase
ICacheService cacheService,
IStatisticService statisticService,
IAgentService agentService,
IHubContext<CandleHub> hubContext,
IMediator mediator,
ITradingService tradingService,
IGrainFactory grainFactory)
@@ -68,7 +64,6 @@ public class DataController : ControllerBase
_cacheService = cacheService;
_statisticService = statisticService;
_agentService = agentService;
_hubContext = hubContext;
_mediator = mediator;
_tradingService = tradingService;
_grainFactory = grainFactory;

View File

@@ -183,7 +183,7 @@ public class TradingController : BaseController
return Forbid("You don't have permission to initialize this wallet address. You can only initialize your own wallet addresses.");
}
var result = await _tradingService.InitPrivyWallet(publicAddress);
var result = await _tradingService.InitPrivyWallet(publicAddress, TradingExchanges.GmxV2);
return Ok(result);
}
catch (Exception ex)

View File

@@ -313,7 +313,6 @@ app.UseEndpoints(endpoints =>
endpoints.MapControllers();
endpoints.MapHub<BotHub>("/bothub");
endpoints.MapHub<BacktestHub>("/backtesthub");
endpoints.MapHub<CandleHub>("/candlehub");
endpoints.MapHealthChecks("/health", new HealthCheckOptions
{