Recipient claims locked XLM by revealing a preimage whose SHA-256
matches the vault hash. Must be called strictly before deadline.
fn claim(
env: soroban_sdk::Env,
vault_id: u64,
preimage: soroban_sdk::Bytes,
) -> Result<(), soroban_sdk::Error>
Lock amount stroops of XLM into a new HTLC vault.
sender must authorize the transfer into this contracthash is SHA-256 of the secret preimage (32 bytes)deadline is a unix timestamp; refunds are allowed strictly after itfn create(
env: soroban_sdk::Env,
sender: soroban_sdk::Address,
recipient: soroban_sdk::Address,
hash: soroban_sdk::BytesN<32>,
deadline: u64,
amount: i128,
) -> Result
Sender refunds locked XLM after the deadline if the vault is unsettled.
fn refund(env: soroban_sdk::Env, vault_id: u64) -> Result<(), soroban_sdk::Error>
Wrapped-native XLM SAC address configured at initialize (read-only).
fn get_token(env: soroban_sdk::Env) -> Result
Read full vault state.
fn get_vault(
env: soroban_sdk::Env,
vault_id: u64,
) -> Result
One-time setup: bind the wrapped-native XLM SAC this contract will use.
Mainnet SAC: CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA
Not an admin/control plane — there is no further privileged entrypoint after this call. Required so the same WASM can target testnet or mainnet.
fn initialize(
env: soroban_sdk::Env,
token: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
All vault IDs created by sender (oldest → newest).
fn list_sender_vaults(
env: soroban_sdk::Env,
sender: soroban_sdk::Address,
) -> soroban_sdk::Vec
All vault IDs where recipient can claim (oldest → newest).
fn list_recipient_vaults(
env: soroban_sdk::Env,
recipient: soroban_sdk::Address,
) -> soroban_sdk::Vec