Refactor SpotBot and ExchangeService for balance retrieval

- Updated SpotBot to fetch token balance directly using the new GetBalance method in IExchangeService.
- Modified IExchangeService to include a method for retrieving balance by ticker.
- Enhanced ExchangeService to implement the new balance retrieval logic for both EVM and non-EVM exchanges.
- Updated TokenService to streamline contract address and decimal retrieval for various tokens.
- Adjusted TradesModal to reflect changes in position status handling.
This commit is contained in:
2025-12-08 23:37:10 +07:00
parent a2ed4edd32
commit 931af3d3af
9 changed files with 232 additions and 54 deletions

View File

@@ -1,4 +1,4 @@
using Managing.Domain.Accounts;
using Managing.Domain.Accounts;
using Managing.Domain.Candles;
using Managing.Domain.Statistics;
using Managing.Domain.Trades;
@@ -24,6 +24,7 @@ public interface IExchangeService
decimal? takeProfitPrice = null);
Task<decimal> GetBalance(Account account, bool isForPaperTrading = false);
Task<Balance?> GetBalance(Account account, Ticker ticker);
Task<List<Balance>> GetBalances(Account account, bool isForPaperTrading = false);
Task<decimal> GetPrice(Account account, Ticker ticker, DateTime date);
Task<decimal> GetCurrentPrice(Account account, Ticker ticker);