Contract 9081fb67960cc9ce9db59246d5f9b7c35c4af9fefaae36ca232d98b51c2d6c0c

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.95.0

Instances

  • CBV2NUHBVRHV7HOIM6QN3TGHIOYCWI5HJMUL64WEPRYYMUVMNSU622BZ

Interface

fn get_debt(env: soroban_sdk::Env, debt_id: soroban_sdk::BytesN<32>) -> DebtEntry

Read a specific mint entry for a user by sequence number.

fn get_mint(
    env: soroban_sdk::Env,
    user_hash: soroban_sdk::BytesN<32>,
    seq: u64,
) -> MintEntry

Buy a homer property — transfer ownership + funds

fn buy_homer(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    homer_id: soroban_sdk::BytesN<32>,
    buyer_hash: soroban_sdk::BytesN<32>,
    buyer_new_commitment: soroban_sdk::BytesN<32>,
    seller_new_commitment: soroban_sdk::BytesN<32>,
    conservation_proof: soroban_sdk::BytesN<32>,
    metadata_hash: soroban_sdk::BytesN<32>,
)
fn get_homer(env: soroban_sdk::Env, homer_id: soroban_sdk::BytesN<32>) -> HomerEntry

Read an escrow by ID.

fn get_escrow(env: soroban_sdk::Env, escrow_id: soroban_sdk::BytesN<32>) -> EscrowEntry

One-time initialization.

fn initialize(env: soroban_sdk::Env, admin: soroban_sdk::Address)

Anchor multiple 100-Eddie splits in a single contract call. Each element in the vectors represents one split. All vectors must have the same length.

fn mint_batch(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    user_hash: soroban_sdk::BytesN<32>,
    timestamps: soroban_sdk::Vec,
    split_indices: soroban_sdk::Vec,
    total_splits_vec: soroban_sdk::Vec,
    acceptance_windows: soroban_sdk::Vec,
    amounts: soroban_sdk::Vec,
    dbc_id_hashes: soroban_sdk::Vec>,
    source_usernames: soroban_sdk::Vec,
) -> u64

Admin: burn escrow — both stakes forfeited. "Everyone loses if it fails" — Skin in the Game enforcement.

fn burn_escrow(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    escrow_id: soroban_sdk::BytesN<32>,
    genesis_hash: soroban_sdk::BytesN<32>,
    new_creator_commitment: soroban_sdk::BytesN<32>,
    new_counterparty_commitment: soroban_sdk::BytesN<32>,
    new_genesis_commitment: soroban_sdk::BytesN<32>,
    burn_proof: soroban_sdk::BytesN<32>,
)

Create a debt record (typically from expired pay link or invoice)

fn create_debt(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    debt_id: soroban_sdk::BytesN<32>,
    debtor_hash: soroban_sdk::BytesN<32>,
    creditor_hash: soroban_sdk::BytesN<32>,
    amount_commitment: soroban_sdk::BytesN<32>,
    required_payment_window: u32,
    source_link_id: soroban_sdk::BytesN<32>,
    metadata_hash: soroban_sdk::BytesN<32>,
    conservation_proof: soroban_sdk::BytesN<32>,
)

Read an invoice by ID.

fn get_invoice(
    env: soroban_sdk::Env,
    invoice_id: soroban_sdk::BytesN<32>,
) -> InvoiceEntry
fn get_user_tx(
    env: soroban_sdk::Env,
    user_hash: soroban_sdk::BytesN<32>,
    seq: u64,
) -> soroban_sdk::BytesN<32>

Pay an invoice. Debtor signs. Updates both commitments.

fn pay_invoice(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    debtor_hash: soroban_sdk::BytesN<32>,
    invoice_id: soroban_sdk::BytesN<32>,
    new_debtor_commitment: soroban_sdk::BytesN<32>,
    new_creditor_commitment: soroban_sdk::BytesN<32>,
    payment_proof: soroban_sdk::BytesN<32>,
)

Debtor settles a debt (partial or full) — update remaining commitment

fn settle_debt(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    debt_id: soroban_sdk::BytesN<32>,
    new_remaining_commitment: soroban_sdk::BytesN<32>,
    debtor_new_commitment: soroban_sdk::BytesN<32>,
    creditor_new_commitment: soroban_sdk::BytesN<32>,
    debtor_hash: soroban_sdk::BytesN<32>,
    creditor_hash: soroban_sdk::BytesN<32>,
    is_full_payment: u32,
    conservation_proof: soroban_sdk::BytesN<32>,
)

Vote on an escrow agreement. Either party can vote. vote_value: 1 = approve, 2 = burn

fn vote_escrow(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    voter_hash: soroban_sdk::BytesN<32>,
    escrow_id: soroban_sdk::BytesN<32>,
    vote_value: u32,
)

Create a crowdfunding campaign

fn create_homer(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    homer_id: soroban_sdk::BytesN<32>,
    owner_hash: soroban_sdk::BytesN<32>,
    target_commitment: soroban_sdk::BytesN<32>,
    metadata_hash: soroban_sdk::BytesN<32>,
)

Mark a loan as defaulted

fn default_loan(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    loan_id: soroban_sdk::BytesN<32>,
)

Read a pay link by ID.

fn get_pay_link(
    env: soroban_sdk::Env,
    link_id: soroban_sdk::BytesN<32>,
) -> PayLinkEntry
fn get_transfer(
    env: soroban_sdk::Env,
    transfer_id: soroban_sdk::BytesN<32>,
) -> TransferEntry
fn get_user_key(
    env: soroban_sdk::Env,
    user_hash: soroban_sdk::BytesN<32>,
) -> soroban_sdk::Address

Pause or resume an escrow. Either party can toggle.

fn pause_escrow(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    voter_hash: soroban_sdk::BytesN<32>,
    escrow_id: soroban_sdk::BytesN<32>,
)

Verify a human — record attestation, update counts, transfer 100 to genesis

fn verify_human(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    verification_id: soroban_sdk::BytesN<32>,
    verified_hash: soroban_sdk::BytesN<32>,
    verifier_hash: soroban_sdk::BytesN<32>,
    verification_type: u32,
    verifier_new_commitment: soroban_sdk::BytesN<32>,
    genesis_hash: soroban_sdk::BytesN<32>,
    genesis_new_commitment: soroban_sdk::BytesN<32>,
    conservation_proof: soroban_sdk::BytesN<32>,
    metadata_hash: soroban_sdk::BytesN<32>,
)

Cancel a pending escrow. Only before activation (no stakes locked).

fn cancel_escrow(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    caller_hash: soroban_sdk::BytesN<32>,
    escrow_id: soroban_sdk::BytesN<32>,
)

Create an escrow agreement. Creator signs. Status = pending. No funds are locked yet (deferred payment model).

fn create_escrow(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    creator_hash: soroban_sdk::BytesN<32>,
    counterparty_hash: soroban_sdk::BytesN<32>,
    creator_stake_commitment: soroban_sdk::BytesN<32>,
    counterparty_stake_commitment: soroban_sdk::BytesN<32>,
    deadline: u64,
    punishment_ratio_bps: u32,
    task_hash: soroban_sdk::BytesN<32>,
    metadata_hash: soroban_sdk::BytesN<32>,
    escrow_id: soroban_sdk::BytesN<32>,
)
fn get_blackhole(
    env: soroban_sdk::Env,
    user_hash: soroban_sdk::BytesN<32>,
    seq: u64,
) -> BlackholeEntry
fn get_user_loan(
    env: soroban_sdk::Env,
    user_hash: soroban_sdk::BytesN<32>,
    seq: u64,
) -> soroban_sdk::BytesN<32>
fn has_paid_tier(env: soroban_sdk::Env, user_hash: soroban_sdk::BytesN<32>) -> u32
fn register_user(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    user_hash: soroban_sdk::BytesN<32>,
    user_address: soroban_sdk::Address,
)

Self-register: any address registers itself AND sets its initial commitment. One transaction does both — no admin, no separate set_commitment call.

fn self_register(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    user_hash: soroban_sdk::BytesN<32>,
    commitment_hash: soroban_sdk::BytesN<32>,
)

Admin: settle escrow after both parties approve. Releases funds to receiver via commitment updates.

fn settle_escrow(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    escrow_id: soroban_sdk::BytesN<32>,
    new_creator_commitment: soroban_sdk::BytesN<32>,
    new_counterparty_commitment: soroban_sdk::BytesN<32>,
    settlement_proof: soroban_sdk::BytesN<32>,
)

Cancel an invoice. Only creditor can cancel.

fn cancel_invoice(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    creditor_hash: soroban_sdk::BytesN<32>,
    invoice_id: soroban_sdk::BytesN<32>,
)

Claim a pay link. Recipient signs. Updates both commitments.

fn claim_pay_link(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    recipient_hash: soroban_sdk::BytesN<32>,
    link_id: soroban_sdk::BytesN<32>,
    new_creator_commitment: soroban_sdk::BytesN<32>,
    new_recipient_commitment: soroban_sdk::BytesN<32>,
    conservation_proof: soroban_sdk::BytesN<32>,
)

Create an invoice. Creditor signs.

fn create_invoice(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    creditor_hash: soroban_sdk::BytesN<32>,
    debtor_hash: soroban_sdk::BytesN<32>,
    amount_commitment: soroban_sdk::BytesN<32>,
    acceptance_window: u32,
    metadata_hash: soroban_sdk::BytesN<32>,
    invoice_id: soroban_sdk::BytesN<32>,
)

Admin: expire an invoice. Records liability hash.

fn expire_invoice(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    invoice_id: soroban_sdk::BytesN<32>,
    liability_proof: soroban_sdk::BytesN<32>,
)

Read a commitment hash.

fn get_commitment(
    env: soroban_sdk::Env,
    user_hash: soroban_sdk::BytesN<32>,
) -> soroban_sdk::BytesN<32>

Get a user's cooperation score

fn get_coop_score(
    env: soroban_sdk::Env,
    user_hash: soroban_sdk::BytesN<32>,
) -> CoopEntry
fn get_debt_count(env: soroban_sdk::Env) -> u64

Get the total number of mints for a user.

fn get_mint_count(env: soroban_sdk::Env, user_hash: soroban_sdk::BytesN<32>) -> u64

Admin: store a commitment hash for a user. commitment_hash = SHA-256 of the compressed Ristretto point.

fn set_commitment(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    user_hash: soroban_sdk::BytesN<32>,
    commitment_hash: soroban_sdk::BytesN<32>,
)

Transfer multiple minted splits from sender to receiver in one call. Sequences must be sorted descending to avoid index shifting issues. Returns the number of splits transferred.

fn transfer_batch(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    from_hash: soroban_sdk::BytesN<32>,
    to_hash: soroban_sdk::BytesN<32>,
    seqs: soroban_sdk::Vec,
) -> u32

Transfer a specific minted split from sender to receiver. The caller must authenticate (self-sovereign, no admin). Returns the receiver's new sequence number for the transferred entry.

fn transfer_eddie(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    from_hash: soroban_sdk::BytesN<32>,
    to_hash: soroban_sdk::BytesN<32>,
    seq: u64,
) -> u64

Counterparty accepts and activates escrow. Both parties' commitments are updated (stakes locked atomically).

fn activate_escrow(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    counterparty_hash: soroban_sdk::BytesN<32>,
    escrow_id: soroban_sdk::BytesN<32>,
    new_creator_commitment: soroban_sdk::BytesN<32>,
    new_counterparty_commitment: soroban_sdk::BytesN<32>,
    conservation_proof: soroban_sdk::BytesN<32>,
)

Matter-antimatter annihilation — creditor forgives debt, value returns to genesis

fn annihilate_debt(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    debt_id: soroban_sdk::BytesN<32>,
    genesis_hash: soroban_sdk::BytesN<32>,
    genesis_new_commitment: soroban_sdk::BytesN<32>,
    creditor_hash: soroban_sdk::BytesN<32>,
    creditor_new_commitment: soroban_sdk::BytesN<32>,
    conservation_proof: soroban_sdk::BytesN<32>,
)

Cancel a pay link. Only creator can cancel. Returns custody.

fn cancel_pay_link(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    creator_hash: soroban_sdk::BytesN<32>,
    link_id: soroban_sdk::BytesN<32>,
    restored_commitment: soroban_sdk::BytesN<32>,
)

Create a pay link. Caller's commitment is updated to reflect custody lock.

fn create_pay_link(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    creator_hash: soroban_sdk::BytesN<32>,
    recipient_hash: soroban_sdk::BytesN<32>,
    amount_commitment: soroban_sdk::BytesN<32>,
    acceptance_window: u32,
    new_creator_commitment: soroban_sdk::BytesN<32>,
    custody_commitment: soroban_sdk::BytesN<32>,
    metadata_hash: soroban_sdk::BytesN<32>,
    link_id: soroban_sdk::BytesN<32>,
)

Create a transfer — update sender/recipient commitments and record transfer Note: metadata_hash omitted (10-param Soroban limit) — use transfer_id for off-chain metadata lookup

fn create_transfer(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    transfer_id: soroban_sdk::BytesN<32>,
    sender_hash: soroban_sdk::BytesN<32>,
    recipient_hash: soroban_sdk::BytesN<32>,
    amount_commitment: soroban_sdk::BytesN<32>,
    acceptance_window: u32,
    sender_new_commitment: soroban_sdk::BytesN<32>,
    recipient_new_commitment: soroban_sdk::BytesN<32>,
    is_reclaimable: u32,
    conservation_proof: soroban_sdk::BytesN<32>,
)

Admin: expire a pay link. For 1h/24h: return custody to creator. For 0h: record liability hash (funds go to Genesis).

fn expire_pay_link(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    link_id: soroban_sdk::BytesN<32>,
    new_creator_commitment: soroban_sdk::BytesN<32>,
    liability_proof: soroban_sdk::BytesN<32>,
)
fn get_entry_count(env: soroban_sdk::Env) -> u32

Get the last interaction between two users

fn get_interaction(
    env: soroban_sdk::Env,
    from_hash: soroban_sdk::BytesN<32>,
    to_hash: soroban_sdk::BytesN<32>,
) -> InteractionEntry
fn get_system_loan(
    env: soroban_sdk::Env,
    loan_id: soroban_sdk::BytesN<32>,
) -> SystemLoanEntry

Check if a user has paid their tier fee

fn get_tier_status(
    env: soroban_sdk::Env,
    user_hash: soroban_sdk::BytesN<32>,
) -> TierEntry
fn get_voice_offer(
    env: soroban_sdk::Env,
    offer_id: soroban_sdk::BytesN<32>,
) -> VoiceOfferEntry

List a Homer property for sale

fn list_homer_sale(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    homer_id: soroban_sdk::BytesN<32>,
    sale_commitment: soroban_sdk::BytesN<32>,
    metadata_hash: soroban_sdk::BytesN<32>,
)

Log a transaction on-chain (called by other modules or admin)

fn log_transaction(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    tx_id: soroban_sdk::BytesN<32>,
    sender_hash: soroban_sdk::BytesN<32>,
    recipient_hash: soroban_sdk::BytesN<32>,
    amount_commitment: soroban_sdk::BytesN<32>,
    tx_type: u32,
    acceptance_window: u32,
    metadata_hash: soroban_sdk::BytesN<32>,
)

Admin: atomically settle a matched BTE order. Updates both parties' commitments and marks order filled.

fn settle_exchange(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    order_id: soroban_sdk::BytesN<32>,
    taker_hash: soroban_sdk::BytesN<32>,
    new_creator_commitment: soroban_sdk::BytesN<32>,
    new_taker_commitment: soroban_sdk::BytesN<32>,
    conservation_proof: soroban_sdk::BytesN<32>,
)

Contribute funds to a homer campaign — update commitments

fn contribute_homer(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    homer_id: soroban_sdk::BytesN<32>,
    contributor_hash: soroban_sdk::BytesN<32>,
    contribution_commitment: soroban_sdk::BytesN<32>,
    new_raised_commitment: soroban_sdk::BytesN<32>,
    contributor_new_commitment: soroban_sdk::BytesN<32>,
    owner_new_commitment: soroban_sdk::BytesN<32>,
    is_funded: u32,
    conservation_proof: soroban_sdk::BytesN<32>,
)

Create a new blackhole time slice

fn create_blackhole(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    user_hash: soroban_sdk::BytesN<32>,
    code_hash: soroban_sdk::BytesN<32>,
    metadata_hash: soroban_sdk::BytesN<32>,
)
fn get_custody_lock(
    env: soroban_sdk::Env,
    lock_id: soroban_sdk::BytesN<32>,
) -> CustodyEntry
fn get_user_custody(
    env: soroban_sdk::Env,
    user_hash: soroban_sdk::BytesN<32>,
    seq: u64,
) -> soroban_sdk::BytesN<32>

Reclaim a transfer within the 24h window — reverse commitments

fn reclaim_transfer(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    transfer_id: soroban_sdk::BytesN<32>,
    sender_hash: soroban_sdk::BytesN<32>,
    recipient_hash: soroban_sdk::BytesN<32>,
    sender_new_commitment: soroban_sdk::BytesN<32>,
    recipient_new_commitment: soroban_sdk::BytesN<32>,
    conservation_proof: soroban_sdk::BytesN<32>,
)

Finalize a transfer after reclaim window expires

fn finalize_transfer(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    transfer_id: soroban_sdk::BytesN<32>,
)
fn get_user_tx_count(env: soroban_sdk::Env, user_hash: soroban_sdk::BytesN<32>) -> u64

User-signed Pedersen transfer. The sender signs. Conservation proof is computed off-chain and stored on-chain.

The contract:

  1. Verifies the sender owns from_hash
  2. Updates commitment hashes for both users
  3. Stores the conservation_proof_hash (off-chain verifiable)
  4. Records a transfer log entry
fn pedersen_transfer(
    env: soroban_sdk::Env,
    sender: soroban_sdk::Address,
    from_hash: soroban_sdk::BytesN<32>,
    to_hash: soroban_sdk::BytesN<32>,
    new_from_commitment_hash: soroban_sdk::BytesN<32>,
    new_to_commitment_hash: soroban_sdk::BytesN<32>,
    conservation_proof: soroban_sdk::BytesN<32>,
    proof_hash: soroban_sdk::BytesN<32>,
)

Cancel an active voice offer — return locked funds

fn cancel_voice_offer(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    offer_id: soroban_sdk::BytesN<32>,
    creator_new_commitment: soroban_sdk::BytesN<32>,
    conservation_proof: soroban_sdk::BytesN<32>,
)

Create a system loan — borrower receives funds with interest obligation

fn create_system_loan(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    loan_id: soroban_sdk::BytesN<32>,
    borrower_hash: soroban_sdk::BytesN<32>,
    amount_commitment: soroban_sdk::BytesN<32>,
    interest_rate_bps: u32,
    borrower_new_commitment: soroban_sdk::BytesN<32>,
    conservation_proof: soroban_sdk::BytesN<32>,
    metadata_hash: soroban_sdk::BytesN<32>,
)

Create a voice offer on the marketplace

fn create_voice_offer(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    offer_id: soroban_sdk::BytesN<32>,
    creator_hash: soroban_sdk::BytesN<32>,
    offer_commitment: soroban_sdk::BytesN<32>,
    request_commitment: soroban_sdk::BytesN<32>,
    offer_window: u32,
    request_window: u32,
    creator_new_commitment: soroban_sdk::BytesN<32>,
    conservation_proof: soroban_sdk::BytesN<32>,
    metadata_hash: soroban_sdk::BytesN<32>,
)

Execute a matched voice swap — atomically swap between two parties

fn execute_voice_swap(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    offer_id: soroban_sdk::BytesN<32>,
    taker_hash: soroban_sdk::BytesN<32>,
    creator_new_commitment: soroban_sdk::BytesN<32>,
    taker_new_commitment: soroban_sdk::BytesN<32>,
    conservation_proof: soroban_sdk::BytesN<32>,
)

Get cooperation ratio (positive / total) as basis points (0-10000)

fn get_coop_ratio_bps(env: soroban_sdk::Env, user_hash: soroban_sdk::BytesN<32>) -> u64

Read a BTE order by ID.

fn get_exchange_order(
    env: soroban_sdk::Env,
    order_id: soroban_sdk::BytesN<32>,
) -> ExchangeOrderEntry
fn get_transfer_count(env: soroban_sdk::Env) -> u64
fn get_transfer_proof(env: soroban_sdk::Env, seq: u64) -> soroban_sdk::BytesN<32>

Record a cooperation interaction between two users

fn record_interaction(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    from_hash: soroban_sdk::BytesN<32>,
    to_hash: soroban_sdk::BytesN<32>,
    interaction_type: u32,
    round: u64,
    score_update_from: soroban_sdk::BytesN<32>,
    score_update_to: soroban_sdk::BytesN<32>,
    metadata_hash: soroban_sdk::BytesN<32>,
)

Create a custody lock — funds held pending a condition

fn create_custody_lock(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    lock_id: soroban_sdk::BytesN<32>,
    user_hash: soroban_sdk::BytesN<32>,
    lock_type: u32,
    amount_commitment: soroban_sdk::BytesN<32>,
    release_condition_hash: soroban_sdk::BytesN<32>,
    user_new_commitment: soroban_sdk::BytesN<32>,
    conservation_proof: soroban_sdk::BytesN<32>,
    metadata_hash: soroban_sdk::BytesN<32>,
)
fn get_blackhole_count(
    env: soroban_sdk::Env,
    user_hash: soroban_sdk::BytesN<32>,
) -> u32
fn get_transaction_log(
    env: soroban_sdk::Env,
    tx_id: soroban_sdk::BytesN<32>,
) -> TxLogEntry
fn get_user_loan_count(
    env: soroban_sdk::Env,
    user_hash: soroban_sdk::BytesN<32>,
) -> u64

Record a tier fee payment — deducted when user crosses balance threshold

fn record_tier_payment(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    user_hash: soroban_sdk::BytesN<32>,
    threshold_commitment: soroban_sdk::BytesN<32>,
    fee_commitment: soroban_sdk::BytesN<32>,
    user_new_commitment: soroban_sdk::BytesN<32>,
    genesis_new_commitment: soroban_sdk::BytesN<32>,
    genesis_hash: soroban_sdk::BytesN<32>,
    conservation_proof: soroban_sdk::BytesN<32>,
    metadata_hash: soroban_sdk::BytesN<32>,
)

Update commitment: a registered user updates their own commitment hash.

fn self_set_commitment(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    user_hash: soroban_sdk::BytesN<32>,
    commitment_hash: soroban_sdk::BytesN<32>,
)

Deactivate a blackhole by providing code hash that matches stored hash

fn deactivate_blackhole(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    user_hash: soroban_sdk::BytesN<32>,
    seq: u64,
    provided_code_hash: soroban_sdk::BytesN<32>,
)

Release a custody lock — funds returned to user

fn release_custody_lock(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    lock_id: soroban_sdk::BytesN<32>,
    user_new_commitment: soroban_sdk::BytesN<32>,
    conservation_proof: soroban_sdk::BytesN<32>,
)

Transfer debt obligation to new debtor

fn transfer_debt_debtor(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    debt_id: soroban_sdk::BytesN<32>,
    new_debtor_hash: soroban_sdk::BytesN<32>,
    metadata_hash: soroban_sdk::BytesN<32>,
)

Cancel an open BTE order. Only the creator can cancel.

fn cancel_exchange_order(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    creator_hash: soroban_sdk::BytesN<32>,
    order_id: soroban_sdk::BytesN<32>,
    restored_commitment: soroban_sdk::BytesN<32>,
)

Create a BTE exchange order. Caller signs (self-sovereign). Returns the order_id (a hash derived from the sequence).

fn create_exchange_order(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    creator_hash: soroban_sdk::BytesN<32>,
    offer_commitment: soroban_sdk::BytesN<32>,
    request_commitment: soroban_sdk::BytesN<32>,
    offer_window: u32,
    request_window: u32,
    target_hash: soroban_sdk::BytesN<32>,
    new_creator_commitment: soroban_sdk::BytesN<32>,
    metadata_hash: soroban_sdk::BytesN<32>,
    order_id: soroban_sdk::BytesN<32>,
)

Get verification tier: 0=none, 1=bronze, 2=silver, 3=gold

fn get_verification_tier(
    env: soroban_sdk::Env,
    user_hash: soroban_sdk::BytesN<32>,
) -> u32

Record a loan repayment — update repaid commitment and optionally mark complete

fn record_loan_repayment(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    loan_id: soroban_sdk::BytesN<32>,
    new_repaid_commitment: soroban_sdk::BytesN<32>,
    borrower_new_commitment: soroban_sdk::BytesN<32>,
    is_full_repayment: u32,
    conservation_proof: soroban_sdk::BytesN<32>,
)
fn get_conservation_proof(env: soroban_sdk::Env, seq: u64) -> soroban_sdk::BytesN<32>
fn get_user_custody_count(
    env: soroban_sdk::Env,
    user_hash: soroban_sdk::BytesN<32>,
) -> u64

Transfer receivable to new creditor (after off-chain approval)

fn transfer_debt_creditor(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    debt_id: soroban_sdk::BytesN<32>,
    new_creditor_hash: soroban_sdk::BytesN<32>,
    metadata_hash: soroban_sdk::BytesN<32>,
)
fn get_receivable_transfer(
    env: soroban_sdk::Env,
    transfer_id: soroban_sdk::BytesN<32>,
) -> ReceivableTransferEntry
fn get_verification_counts(
    env: soroban_sdk::Env,
    user_hash: soroban_sdk::BytesN<32>,
) -> VerificationCounts

Creditor offers receivable claim to a new owner

fn create_receivable_transfer(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    transfer_id: soroban_sdk::BytesN<32>,
    debt_id: soroban_sdk::BytesN<32>,
    sender_hash: soroban_sdk::BytesN<32>,
    recipient_hash: soroban_sdk::BytesN<32>,
    amount_commitment: soroban_sdk::BytesN<32>,
    metadata_hash: soroban_sdk::BytesN<32>,
)

Admin expires receivable transfer after 1h

fn expire_receivable_transfer(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    transfer_id: soroban_sdk::BytesN<32>,
)

Recipient rejects receivable transfer offer

fn reject_receivable_transfer(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    transfer_id: soroban_sdk::BytesN<32>,
)

Recipient approves receivable transfer — pays seller, becomes new creditor

fn approve_receivable_transfer(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    transfer_id: soroban_sdk::BytesN<32>,
    buyer_new_commitment: soroban_sdk::BytesN<32>,
    seller_new_commitment: soroban_sdk::BytesN<32>,
    required_payment_window: u32,
    conservation_proof: soroban_sdk::BytesN<32>,
)

Imports

WebAssembly Text (WAT) ▶