Forwards amount of token from from directly to receiver and
emits a Deposited event. Native XLM is deposited by passing the XLM
Stellar Asset Contract as token.
from must authorize this call and the nested token.transfer
(one signed auth tree). The token itself rejects negative amounts
and insufficient balances; no other validation is performed —
receiver legitimacy is enforced off-chain by the Layerswap backend.
fn deposit(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
id: soroban_sdk::BytesN<32>,
token: soroban_sdk::Address,
receiver: soroban_sdk::Address,
amount: i128,
)
Forwards from's entire allowance granted to this contract to
receiver and emits a Deposited event. Companion to deposit for
flows where the amount was fixed in an earlier token.approve(from, depository, amount, live_until_ledger) transaction.
from must authorize this call — the allowance alone must not let a
third party spend it with their own id/receiver. Do NOT use with
"infinite" approvals: transferring the full allowance fails on
insufficient balance. Use deposit instead.
fn deposit_allowance(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
id: soroban_sdk::BytesN<32>,
token: soroban_sdk::Address,
receiver: soroban_sdk::Address,
)