fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address
fn signer(env: soroban_sdk::Env) -> soroban_sdk::Address
Register an agent against its own address. Idempotency is enforced — an agent registers itself once.
fn register(
env: soroban_sdk::Env,
agent: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Current score data for an agent. Returns an Unrated/zero record if the
agent has no published score yet (so callers get a safe default).
fn get_score(env: soroban_sdk::Env, agent: soroban_sdk::Address) -> ScoreData
Rotate the trusted signer. Admin-only.
fn set_signer(env: soroban_sdk::Env, new_signer: soroban_sdk::Address)
Set the admin (can rotate the signer) and the trusted signer (publishes scores + repayment outcomes). Runs once at deploy.
fn __constructor(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
signer: soroban_sdk::Address,
)
fn is_registered(env: soroban_sdk::Env, agent: soroban_sdk::Address) -> bool
Publish a signed score for a registered agent. Only the trusted signer may call this; the tier is banded on-chain from the score.
fn publish_score(
env: soroban_sdk::Env,
agent: soroban_sdk::Address,
score: u32,
revenue: i128,
) -> Result<(), soroban_sdk::Error>
fn get_repayments(
env: soroban_sdk::Env,
agent: soroban_sdk::Address,
) -> RepaymentRecord
Record a repayment outcome (reported by the signer/engine after observing settlement). Feeds future re-scoring.
fn record_repayment(
env: soroban_sdk::Env,
agent: soroban_sdk::Address,
on_time: bool,
) -> Result<(), soroban_sdk::Error>