Atomically pull withdraw_amount of token out of the Rain collateral (via
coordinator) back into the wallet, verify it arrived exactly, then send
transfer_amount from the wallet to recipient.
caller is the collateral owner (the user's wallet) and the withdrawal recipient.
token is both the withdrawn asset and the transferred token; it must report
[EXPECTED_DECIMALS] decimals. All amounts are token SMALLEST UNITS.
Reverts (nothing moves) if a guard fails, if the wallet's balance does not increase by
exactly withdraw_amount, if the Coordinator rejects, or if the wallet cannot cover
transfer_amount.
fn withdraw_and_transfer(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
coordinator: soroban_sdk::Address,
collateral: soroban_sdk::Address,
token: soroban_sdk::Address,
recipient: soroban_sdk::Address,
withdraw_amount: i128,
transfer_amount: i128,
auth: WithdrawAuth,
) -> Result<(), soroban_sdk::Error>