Contract 49b5dae591d04edf209cf68b27471647444b25c08b43880d4d409064cef83c66

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdkver 26.1.1#8ac18efb681a1c0b4b85a38c5a380300344e3f39
rsver 1.96.0

Instances

  • CDU25FU3IDGGKRQCNKVGKLY2DVD4HB6Z33H3AMXET6H6ETUOCHNO7PCB

Interface

fn stats(env: soroban_sdk::Env) -> (u32, u32)

List a vehicle that can be requested for a lease agreement.

fn add_car(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    vin: soroban_sdk::String,
    model: soroban_sdk::String,
    daily_rate: i128,
) -> Car
fn get_car(env: soroban_sdk::Env, car_id: u32) -> Car
fn get_lease(env: soroban_sdk::Env, lease_id: u32) -> Lease

Return a bounded page of cars. IDs are contiguous because cars are never deleted.

fn list_cars(env: soroban_sdk::Env, start_id: u32, limit: u32) -> soroban_sdk::Vec
fn list_leases(
    env: soroban_sdk::Env,
    start_id: u32,
    limit: u32,
) -> soroban_sdk::Vec

Request a lease. This records mutually reviewable terms; it does not move funds. The owner must explicitly approve before the agreement becomes approved.

fn request_lease(
    env: soroban_sdk::Env,
    lessee: soroban_sdk::Address,
    car_id: u32,
    start_time: u64,
    end_time: u64,
) -> Lease

The requester can cancel their own pending request.

fn cancel_request(
    env: soroban_sdk::Env,
    lessee: soroban_sdk::Address,
    lease_id: u32,
) -> Lease

Permissionless cleanup after a request or approved lease reaches its time boundary. Pending requests become expired at start_time; approved leases complete at end_time.

fn finalize_lease(env: soroban_sdk::Env, lease_id: u32) -> Lease

The owner can decline a pending request before it starts.

fn reject_request(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    lease_id: u32,
) -> Lease

The vehicle owner explicitly accepts the recorded lease terms.

fn approve_request(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    lease_id: u32,
) -> Lease
fn car_status_label(env: soroban_sdk::Env, status: u32) -> soroban_sdk::String
fn lease_status_label(env: soroban_sdk::Env, status: u32) -> soroban_sdk::String
fn current_lease_for_car(env: soroban_sdk::Env, car_id: u32) -> u32

Imports

WebAssembly Text (WAT) ▶