Set (or update) the daily spending cap for an agent, in USDC stroops. Only the operator can call this. Passing 0 effectively blocks the agent.
fn set_cap(
env: soroban_sdk::Env,
operator: soroban_sdk::Address,
agent: soroban_sdk::Address,
cap_stroops: i128,
)
Attempt to spend amount_stroops from the agent's daily budget.
Returns the remaining allowance after the spend. Fails if over cap.
fn try_spend(
env: soroban_sdk::Env,
operator: soroban_sdk::Address,
agent: soroban_sdk::Address,
amount_stroops: i128,
) -> Result
Read-only: returns (spent_today, cap) for an agent. Used by dashboards. Returns (0, 0) if no budget is set.
fn get_budget(
env: soroban_sdk::Env,
operator: soroban_sdk::Address,
agent: soroban_sdk::Address,
) -> (i128, i128)