Contract 026b16f087063dea02c5974371952355095b6b468cbb3041f2a044d2c6997fb4

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdkver 26.1.0#175aa41306f383057a8cdfc84b68d931664fc34e
rsver 1.93.0

Instances

  • CAVYAHMKT5MQ2TMAKDXYQBV5WQFYFWRN4BHDHSKRWEJLDUZNLTQ7BRBW

Interface

Opens a rate-lock order. Escrows amount from customer and snapshots the customer's settlement conditions. Does NOT read or freeze the oracle rate — target_rate is the customer's condition, not today's price.

fn lock(
    env: soroban_sdk::Env,
    customer: soroban_sdk::Address,
    amount: i128,
    target_rate: i128,
    expiry: u64,
    recipient: soroban_sdk::Address,
    payout_ref: soroban_sdk::BytesN<32>,
) -> Result

Cancels an active order at any time before settlement, returning the escrow to the customer. Customer auth only.

fn cancel(env: soroban_sdk::Env, order_id: u64) -> Result<(), soroban_sdk::Error>

Settles an active order to its snapshotted recipient once the oracle rate meets the target. Admin/operator only. Never accepts a settle-time recipient — funds always go to order.recipient.

fn settle(env: soroban_sdk::Env, order_id: u64) -> Result<(), soroban_sdk::Error>
fn get_order(env: soroban_sdk::Env, order_id: u64) -> Result
fn get_config(env: soroban_sdk::Env) -> Result
fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    oracle: soroban_sdk::Address,
    token: soroban_sdk::Address,
    max_staleness: u64,
    max_duration: u64,
    min_amount: i128,
    max_amount: i128,
) -> Result<(), soroban_sdk::Error>
fn set_paused(env: soroban_sdk::Env, paused: bool) -> Result<(), soroban_sdk::Error>

Extends an order's persistent-storage TTL. Callable by anyone so orders can be kept alive through their lifetime without privileged access.

fn bump_order_ttl(
    env: soroban_sdk::Env,
    order_id: u64,
) -> Result<(), soroban_sdk::Error>

Refunds an expired, still-active order back to the customer. Callable by anyone (no auth) — the funds can only ever go to the snapshotted customer.

fn refund_expired(
    env: soroban_sdk::Env,
    order_id: u64,
) -> Result<(), soroban_sdk::Error>

Imports

WebAssembly Text (WAT) ▶