Initialize a new escrow with deterministic address calculation This function should be called by a factory contract that deploys this escrow with a deterministic address based on the immutables hash
fn deploy(
env: soroban_sdk::Env,
order_hash: soroban_sdk::BytesN<32>,
hashlock: soroban_sdk::BytesN<32>,
maker: soroban_sdk::Address,
taker: soroban_sdk::Address,
token: soroban_sdk::Address,
amount: i128,
safety_deposit: i128,
timelocks: u64,
) -> soroban_sdk::Address
Get the hash of the current escrow's immutables This can be used by external contracts to verify the escrow address
fn get_immutables_hash(env: soroban_sdk::Env) -> soroban_sdk::BytesN<32>
Withdraw funds by revealing the secret
fn withdraw(
env: soroban_sdk::Env,
secret: soroban_sdk::BytesN<32>,
_unwrap_native: bool,
)
Cancel escrow and return funds
fn cancel(env: soroban_sdk::Env, caller: soroban_sdk::Address)
Public withdrawal after timelock expiry
fn public_withdraw(
env: soroban_sdk::Env,
secret: soroban_sdk::BytesN<32>,
caller: soroban_sdk::Address,
)
Get current escrow state
fn get_state(env: soroban_sdk::Env) -> State
Get escrow immutables
fn get_immutables(env: soroban_sdk::Env) -> Immutables