Public read — lenders verify here. Errors NotFound if the credential
has never been issued.
fn get(
env: soroban_sdk::Env,
credential_id: soroban_sdk::BytesN<32>,
) -> Result
fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address
Issue a new credential. Write-once: a second call with the same
credential_id errors AlreadyExists.
fn issue(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
credential_id: soroban_sdk::BytesN<32>,
borrower_hash: soroban_sdk::BytesN<32>,
intake_hash: soroban_sdk::BytesN<32>,
score: u32,
bucket: soroban_sdk::Symbol,
confidence_bps: u32,
evaluation_hash: soroban_sdk::BytesN<32>,
model: soroban_sdk::String,
) -> Result<(), soroban_sdk::Error>
Cheap probe — returns true if the credential exists.
fn exists(env: soroban_sdk::Env, credential_id: soroban_sdk::BytesN<32>) -> bool
fn issuer(env: soroban_sdk::Env) -> soroban_sdk::Address
List all milestones attached to a credential.
fn milestones(
env: soroban_sdk::Env,
credential_id: soroban_sdk::BytesN<32>,
) -> soroban_sdk::Vec
Rotate the issuer key. Admin-only.
fn set_issuer(
env: soroban_sdk::Env,
new_issuer: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Initialize the contract with an admin (key-rotation) and the issuer
address (sole signer permitted to call issue / append_milestone).
fn __constructor(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
issuer: soroban_sdk::Address,
)
Append a repayment / outcome milestone to an existing credential. Issuer-only. Future-ready: not called by the BE in MVP.
fn append_milestone(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
credential_id: soroban_sdk::BytesN<32>,
kind: soroban_sdk::Symbol,
note_hash: soroban_sdk::BytesN<32>,
) -> Result<(), soroban_sdk::Error>
Look up the bound borrower wallet address for a credential, or None
if the credential has not been bound to a wallet yet.
fn borrower_address(
env: soroban_sdk::Env,
credential_id: soroban_sdk::BytesN<32>,
) -> Option
Bind a borrower's Stellar wallet address to an existing credential. Issuer-only. The BE writes this after the borrower confirms ownership of their wallet from the FE. Idempotent: calling again with the same address is a no-op; calling with a different address overwrites (acceptable for MVP — borrowers can re-bind if they lose their seed).
fn set_borrower_address(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
credential_id: soroban_sdk::BytesN<32>,
borrower_address: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>