Contract f8ea005fdb1267af0a50e6a87dd47e3267dd4bcb252ab0093c40f2681a15215a

← Back to Index 📥 Download WASM

Meta

cliver 25.2.0#28484880988199233a7e8e87c97cb12dac323cb3
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.94.1

Instances

  • CCLM7COOL4SMIUXGL3S6MRK65PIV2SOWDIUBXDEZSFSEFSCB3ZGVJSZJ

Interface

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)

Imports

WebAssembly Text (WAT) ▶