One-time initialisation. Must be called immediately after deployment.
fn initialize(env: soroban_sdk::Env, admin: soroban_sdk::Address)
Register a new bond on-chain. Phase 1: proof hashes stored as-is (no on-chain ZK verification).
fn create_bond(
env: soroban_sdk::Env,
bond_id: soroban_sdk::String,
bond_root: soroban_sdk::String,
creator_proof_hash: soroban_sdk::String,
counterparty_pubkey: soroban_sdk::String,
pinata_link: soroban_sdk::String,
expiry_at: u64,
caller: soroban_sdk::Address,
) -> soroban_sdk::String
Counterparty co-signs: Pending → Live. No TTL change — the bond was already funded with ACTIVE_TTL at creation.
fn cosign_bond(
env: soroban_sdk::Env,
bond_id: soroban_sdk::String,
counterparty_proof_hash: soroban_sdk::String,
caller: soroban_sdk::Address,
)
Either party confirms settlement. Both must confirm to reach Settled. TTL is only reduced (to TERMINAL_TTL) when the bond fully settles.
fn settle_bond(
env: soroban_sdk::Env,
bond_id: soroban_sdk::String,
is_creator: bool,
caller: soroban_sdk::Address,
)
Anyone can call this after the expiry timestamp to expire a PENDING bond.
fn expire_bond(env: soroban_sdk::Env, bond_id: soroban_sdk::String)
Manually extend storage rent for active bonds. Only meaningful for Pending/Live bonds — Settled/Expired bonds won't need rent renewal beyond their short terminal window.
fn extend_bond_ttl(env: soroban_sdk::Env, bond_id: soroban_sdk::String)
Public read-only view — returns full bond state.
fn get_bond(env: soroban_sdk::Env, bond_id: soroban_sdk::String) -> BondData
fn bond_exists(env: soroban_sdk::Env, bond_id: soroban_sdk::String) -> bool