Contract 196c8249a203dcdc1fd4e7381472cb37a960adaf6d2f1c7a069b93f3bdea68a2

← Back to Index 📥 Download WASM

Meta

cliver 27.1.0#8e402ea28202950b272fbabc34caad4d2f64fe87
rssdkver 25.1.1#94c2a3b3a5ded6b9cf9cef0c207bf8804f3eb294
rsver 1.97.1

Instances

  • CBAF4BHE4IBUZCR2HUOI7D6NCQT34R3EJUC3SLDSRICUQYHAWKTVJT33

Interface

Swap on pool only if the classic leg already delivered.

  • user — the inventory account; must authorize (tx source).
  • expect_asset — SAC of the asset the classic leg should have delivered.
  • expect_min_balance — guard: balance(user, expect_asset) >= this.
  • pool — Aquarius pool.
  • token_in — asset the swap spends (the pool pulls it from user; not used in the call itself, kept in the ABI so the invocation args carry everything an offline auth builder needs).
  • in_idx/out_idx — token indices in the pool.
  • in_amount/out_min — swap amount / min out (the pool enforces out_min).

Returns the pool swap's amount out.

fn swap_if(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    expect_asset: soroban_sdk::Address,
    expect_min_balance: i128,
    pool: soroban_sdk::Address,
    token_in: soroban_sdk::Address,
    in_idx: u32,
    out_idx: u32,
    in_amount: u128,
    out_min: u128,
) -> u128

Imports

WebAssembly Text (WAT) ▶