Get the latest cached health score for a vehicle.
fn get_latest(env: soroban_sdk::Env, nft_token_id: u64) -> LatestHealthScore
fn initialize(env: soroban_sdk::Env, admin: soroban_sdk::Address)
Write a daily health score snapshot for a single vehicle. Admin-only. Called in batch from the Ambient Evaluator cron.
fn write_daily(
env: soroban_sdk::Env,
nft_token_id: u64,
master_score: u32,
legal_score: u32,
mechanical_score: u32,
driving_score: u32,
maintenance_score: u32,
)
Write an event-driven attestation (fires immediately on significant changes). Admin-only.
fn write_event(
env: soroban_sdk::Env,
nft_token_id: u64,
event_type: soroban_sdk::Symbol,
payload_hash: soroban_sdk::String,
score_at_event: u32,
)
Get the event-driven attestation log (up to 100 entries).
fn get_event_log(
env: soroban_sdk::Env,
nft_token_id: u64,
) -> soroban_sdk::Vec
Batch write daily snapshots for multiple vehicles in one transaction. Each entry is (nft_token_id, master, legal, mechanical, driving, maintenance).
fn batch_write_daily(
env: soroban_sdk::Env,
entries: soroban_sdk::Vec<(u64, u32, u32, u32, u32, u32)>,
)
Get the full daily attestation history (up to 365 entries).
fn get_daily_history(
env: soroban_sdk::Env,
nft_token_id: u64,
) -> soroban_sdk::Vec
Get the total number of attestations written across all vehicles.
fn total_attestations(env: soroban_sdk::Env) -> u64