Contract e0d60aed0865a37afda5b8989db02ebf2a77c86c1e76251d95eb4e6261ef2380

← Back to Index 📥 Download WASM

Meta

cliver 26.1.0#1228cff8022b804659750b94b315932b0e0f3f6a
rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.96.0

Instances

  • CCPZMNVDUDOHASFOOY4IP3ANOUA4QXPTL6A526INLHV5RKHQACPKR5NT

Interface

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

Imports

WebAssembly Text (WAT) ▶