Owner check-in. Resets the inactivity countdown. Owner-only.
fn ping(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
vault_id: u64,
) -> Result
Add more of the vault's token. Does not alter unlock_timestamp.
For a Vesting vault, the top-up amount also raises
total_locked_amount so the extra funds vest on the same
linear schedule as the original deposit.
fn deposit(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
vault_id: u64,
amount: i128,
) -> Result<(), soroban_sdk::Error>
Withdraw the full vault balance. Behavior depends on kind:
unlock_timestamp.initiate_withdrawal'd
AND the cooling-off duration has elapsed since.withdraw_vested instead (partial, schedule-gated amounts).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.
fn extend_lock(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
vault_id: u64,
additional_seconds: u64,
) -> Result
Create a standard time-lock vault holding initial_deposit of
token, unlockable at unlock_timestamp.
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
Backup-address claim. Only succeeds once the owner has missed
the inactivity deadline. Only backup_address may call this.
fn backup_withdraw(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
vault_id: u64,
) -> Result
Withdraw up to the currently-vested, not-yet-withdrawn amount.
Reverts with AmountExceedsUnlocked if amount is more than
that. Can be called any number of times as more vests.
fn withdraw_vested(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
vault_id: u64,
amount: i128,
) -> Result
Cancel a pending withdrawal. Owner-only.
fn cancel_withdrawal(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
vault_id: u64,
) -> Result<(), soroban_sdk::Error>
Read-only — currently claimable amount (already vested, not yet
withdrawn). Zero before vesting_start_timestamp; the full
remaining balance once now >= vesting_end_timestamp.
fn get_unlocked_amount(
env: soroban_sdk::Env,
vault_id: u64,
) -> Result
Start the withdrawal countdown. Anyone with a signed transaction
from the owner can call this — that's the whole point: if an
attacker calls it, the REAL owner sees it pending and has the
full cooling_off_duration_seconds window to cancel_withdrawal.
fn initiate_withdrawal(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
vault_id: u64,
) -> Result
Create a linear-vesting vault. vesting_end_timestamp must be
strictly after vesting_start_timestamp (which may be in the
past — e.g. "start now").
fn create_vesting_vault(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
token: soroban_sdk::Address,
name: soroban_sdk::String,
initial_deposit: i128,
vesting_start_timestamp: u64,
vesting_end_timestamp: u64,
) -> Result
Create a Cooling-Off vault. There is no unlock_timestamp —
the vault is "unlocked" from the start in the base sense; every
withdrawal still has to go through initiate_withdrawal and
wait out cooling_off_duration_seconds.
fn create_cooling_off_vault(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
token: soroban_sdk::Address,
name: soroban_sdk::String,
initial_deposit: i128,
cooling_off_duration_seconds: u64,
) -> Result
Create a Dead Man's Switch vault. backup_address cannot equal
owner (would defeat the entire point).
fn create_dead_man_switch_vault(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
token: soroban_sdk::Address,
name: soroban_sdk::String,
initial_deposit: i128,
backup_address: soroban_sdk::Address,
inactivity_period_seconds: u64,
) -> Result