Refactor SwapGmxTokens functionality into TradingService
- Moved SwapGmxTokensAsync method from AccountService to TradingService to centralize trading operations. - Updated AccountController and AgentGrain to utilize the new TradingService method for swapping GMX tokens. - Removed the old SwapGmxTokensAsync method from IAccountService and its implementation in AccountService.
This commit is contained in:
@@ -37,9 +37,6 @@ public interface IAccountService
|
||||
Task<IEnumerable<Account>> GetAccountsBalancesByUserAsync(User user, bool hideSecrets = true);
|
||||
Task<GmxClaimableSummary> GetGmxClaimableSummaryAsync(User user, string accountName);
|
||||
|
||||
Task<SwapInfos> SwapGmxTokensAsync(User user, string accountName, Ticker fromTicker, Ticker toTicker,
|
||||
double amount, string orderType = "market", double? triggerRatio = null, double allowedSlippage = 0.5);
|
||||
|
||||
Task<SwapInfos> SendTokenAsync(User user, string accountName, string recipientAddress, Ticker ticker,
|
||||
decimal amount, int? chainId = null);
|
||||
|
||||
|
||||
@@ -55,4 +55,6 @@ public interface ITradingService
|
||||
Task<IndicatorBase?> GetIndicatorByNameUserAsync(string name, User user);
|
||||
Task<Scenario?> GetScenarioByNameUserAsync(string scenarioName, User user);
|
||||
Task<IEnumerable<Position>> GetPositionByUserIdAsync(int userId);
|
||||
Task<SwapInfos> SwapGmxTokensAsync(User user, string accountName, Ticker fromTicker, Ticker toTicker,
|
||||
double amount, string orderType = "market", double? triggerRatio = null, double allowedSlippage = 0.5);
|
||||
}
|
||||
Reference in New Issue
Block a user