Add more of the vault's token. Does not alter unlock_timestamp.
The token address is looked up from the vault — callers cannot
pass in a different asset than the vault was created with.
fn deposit(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
vault_id: u64,
amount: i128,
) -> Result<(), soroban_sdk::Error>
Withdraw the full vault balance in the vault's own token to the owner.
Reverts with StillLocked if env.ledger().timestamp() < unlock_timestamp.
fn withdraw(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
vault_id: u64,
) -> Result
Read-only — fetch a vault by id.
fn get_vault(env: soroban_sdk::Env, vault_id: u64) -> Result
Read-only — list vault ids owned by owner.
fn list_owned(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
) -> soroban_sdk::Vec
Push the unlock timestamp further into the future by additional_seconds.
Reducing or zeroing the lock is impossible — there is no set_unlock.
fn extend_lock(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
vault_id: u64,
additional_seconds: u64,
) -> Result
Create a vault holding initial_deposit of token. The caller
must have pre-approved the vault contract to spend at least
initial_deposit of the token, OR the token must accept
require_auth from owner (the standard Stellar Asset Contract
path).
unlock_timestamp is recorded immutably; it can only ever be
PUSHED FORWARD via extend_lock.
fn create_vault(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
token: soroban_sdk::Address,
name: soroban_sdk::String,
initial_deposit: i128,
unlock_timestamp: u64,
) -> Result