Interface ISettlementPolicy
- Namespace
- NArk.Abstractions.Settlement
- Assembly
- NArk.Abstractions.dll
Decides whether a wallet should settle right now, and how much. The policy never moves funds — it yields SettlementPlans that the settlement engine routes to an ISettlementService.
This mirrors ISweepPolicy: register several policies to combine strategies
(a balance threshold, a scheduled payout, an expiry-driven sweep) and the engine
executes the union of what they yield, rather than picking one winner. A policy
may yield nothing, one plan, or several — settling a balance across two
destinations is just two yields.
Plans are executed in the order they are yielded, policy by policy, against a balance that shrinks as each one is committed; a plan that no longer fits the remaining balance is skipped.
public interface ISettlementPolicy
Methods
EvaluateAsync(SettlementContext, CancellationToken)
Yields the settlements this policy wants for the wallet, or nothing to stand down. Must not have side effects — it runs on every wallet activity tick.
IAsyncEnumerable<SettlementPlan> EvaluateAsync(SettlementContext context, CancellationToken cancellationToken = default)
Parameters
contextSettlementContextcancellationTokenCancellationToken