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