Contract cf66980abfe5b2046a9e6ef64a42898daf91623078bd7e88f79bf65a2b19a7ae

← Back to Index 📥 Download WASM

Meta

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

Instances

  • CAEXQUJKHCA6T64QCLSQZOJDA5G3FMCVOPMOH7N44TZR7AGHBBG5OTEE
  • CAJ6SUUVGLCL6GV333YRR6V7FGM2NVHCCZXDOU7TVZIHIIHBVQWTF4SW

Interface

Wire admin, SEP-41 token, and authorized matcher address.

fn init(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    token: soroban_sdk::Address,
    matcher: soroban_sdk::Address,
)
fn deposit(env: soroban_sdk::Env, from: soroban_sdk::Address, amount: i128)
fn withdraw(env: soroban_sdk::Env, from: soroban_sdk::Address, amount: i128)
fn get_order(env: soroban_sdk::Env, order_id: u64) -> Order
fn get_token(env: soroban_sdk::Env) -> soroban_sdk::Address
fn get_balance(env: soroban_sdk::Env, user: soroban_sdk::Address) -> i128
fn get_matcher(env: soroban_sdk::Env) -> soroban_sdk::Address
fn order_count(env: soroban_sdk::Env) -> u64

Cancel an open order by revealing the preimage that matches the commitment hash.

fn cancel_order(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    order_id: u64,
    preimage: soroban_sdk::Bytes,
)

Matcher-submitted batch settlement. Transfers between escrow balances atomically.

fn settle_batch(env: soroban_sdk::Env, settlements: soroban_sdk::Vec)

Register an order with a SHA-256 commitment hash. Locks collateral from escrow.

fn register_order(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    commitment_hash: soroban_sdk::BytesN<32>,
    side: Side,
    locked_amount: i128,
    expiry_ledger: u32,
) -> u64

Imports

WebAssembly Text (WAT) ▶