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

@@ -5,6 +5,7 @@ import type {
UserStrategyDetailsViewModel
} from '../../../generated/ManagingApi'
import {BotClient, DataClient} from '../../../generated/ManagingApi'
import {PositionStatus} from '../../../generated/ManagingApiTypes'
import useApiUrlStore from '../../../app/store/apiStore'
import Modal from '../Modal/Modal'
import Toast from '../Toast/Toast'
@@ -134,7 +135,7 @@ const TradesModal: React.FC<TradesModalProps> = ({
{position.ProfitAndLoss?.realized?.toFixed(2) || '0.00'} $
</td>
<td>
{position.status !== 'Finished' && (
{position.status === PositionStatus.Filled && (
<button
className="btn btn-xs btn-error"
onClick={() => closePosition(position)}