Rename to init

This commit is contained in:
2025-09-14 00:46:08 +07:00
parent 8f68502d84
commit 0b1acbb8dc
5 changed files with 23 additions and 25 deletions

View File

@@ -153,11 +153,11 @@ namespace Managing.Api.Controllers
/// 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()
[HttpGet("exchanges-initialized-status")]
public async Task<ActionResult<List<ExchangeInitializedStatus>>> GetExchangeApprovalStatus()
{
var user = await GetUser();
var exchangeStatuses = await _AccountService.GetExchangeApprovalStatusAsync(user);
var exchangeStatuses = await _AccountService.GetExchangeInitializedStatusAsync(user);
return Ok(exchangeStatuses);
}
}

View File

@@ -35,5 +35,5 @@ public interface IAccountService
Task<SwapInfos> SendTokenAsync(User user, string accountName, string recipientAddress, Ticker ticker,
decimal amount, int? chainId = null);
Task<List<ExchangeApprovalStatus>> GetExchangeApprovalStatusAsync(User user);
Task<List<ExchangeInitializedStatus>> GetExchangeInitializedStatusAsync(User user);
}

View File

@@ -333,21 +333,21 @@ public class AccountService : IAccountService
}
}
public async Task<List<ExchangeApprovalStatus>> GetExchangeApprovalStatusAsync(User user)
public async Task<List<ExchangeInitializedStatus>> GetExchangeInitializedStatusAsync(User user)
{
var accounts = await GetAccountsByUserAsync(user, hideSecrets: true, getBalance: false);
var exchangeStatuses = new List<ExchangeApprovalStatus>();
var exchangeStatuses = new List<ExchangeInitializedStatus>();
foreach (var account in accounts)
{
exchangeStatuses.Add(new ExchangeApprovalStatus
exchangeStatuses.Add(new ExchangeInitializedStatus
{
Exchange = TradingExchanges.GmxV2,
IsInitialized = account.IsGmxInitialized
});
}
// Future: Add other exchanges here when supported
// e.g.:
// var hasEvmInitialized = accounts.Any(account =>
@@ -357,7 +357,7 @@ public class AccountService : IAccountService
// Exchange = TradingExchanges.Evm,
// IsApproved = hasEvmInitialized
// });
return exchangeStatuses;
}

View File

@@ -1,14 +0,0 @@
using Orleans;
using static Managing.Common.Enums;
namespace Managing.Domain.Accounts;
[GenerateSerializer]
public class ExchangeApprovalStatus
{
[Id(0)]
public TradingExchanges Exchange { get; set; }
[Id(1)]
public bool IsInitialized { get; set; }
}

View File

@@ -0,0 +1,12 @@
using Orleans;
using static Managing.Common.Enums;
namespace Managing.Domain.Accounts;
[GenerateSerializer]
public class ExchangeInitializedStatus
{
[Id(0)] public TradingExchanges Exchange { get; set; }
[Id(1)] public bool IsInitialized { get; set; }
}