Add single time swap + fetch balance cache in AgentGrain
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Managing.Application.Abstractions.Models;
|
||||
using Managing.Application.Bots.Models;
|
||||
using Orleans.Concurrency;
|
||||
|
||||
namespace Managing.Application.Abstractions.Grains
|
||||
@@ -39,5 +40,14 @@ namespace Managing.Application.Abstractions.Grains
|
||||
/// <param name="updateEvent">The update event from the stream</param>]
|
||||
[OneWay]
|
||||
Task OnAgentSummaryUpdateAsync(AgentSummaryUpdateEvent updateEvent);
|
||||
|
||||
/// <summary>
|
||||
/// Coordinates ETH balance checking and swapping for all bots under this agent.
|
||||
/// Uses cached balance data to reduce external API calls and ensures only one swap operation happens at a time.
|
||||
/// </summary>
|
||||
/// <param name="requestingBotId">The bot requesting the ETH balance check</param>
|
||||
/// <param name="accountName">The account name to check balances for</param>
|
||||
/// <returns>BalanceCheckResult indicating the status and reason for any failure</returns>
|
||||
Task<BalanceCheckResult> CheckAndEnsureEthBalanceAsync(Guid requestingBotId, string accountName);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user