Contract 032ff0d178b88e5465c8932f47e35987096fe1f85df7136a6bf8e54fc8fd9bc8

← Back to Index 📥 Download WASM

Meta

cliver 26.0.0#60f7458e7ecffddf2f2d91dc6d0d2db4fab03ecc
rssdkver 26.0.0#e1bf74ba6c3ddb591593f5eb5dfb85458ff714c1
rsver 1.93.0

Instances

  • CCJEPGU7SIKECKAODQBIFMCZEE34K2MQJJ4MXFTZOZLNNGUBD6CWZKAS

Interface

Fetch a single credit entry by its ID.

fn get_credit(env: soroban_sdk::Env, credit_id: u64) -> CreditEntry

Record a new credit (utang) extended by a store to a customer.

The store_owner must sign the transaction. Returns the auto-generated credit_id for this entry.

TODO: add customer wallet support in future version (needed for USDC settlement)

fn create_credit(
    env: soroban_sdk::Env,
    store_owner: soroban_sdk::Address,
    store_id: soroban_sdk::String,
    customer_id: soroban_sdk::String,
    amount: i128,
    due_date: u64,
) -> u64

Record a payment proof against an existing credit.

The original store_owner who created the credit must sign. This is a ledger-only operation — it tracks the payment on-chain without moving any tokens.

Returns true when the credit is fully settled, false otherwise.

TODO: add USDC transfer_from once customer wallet approval flow exists

fn record_payment(env: soroban_sdk::Env, credit_id: u64, amount: i128) -> bool

Get the total outstanding balance for a customer across all their credits.

Returns 0 if the customer has no credits on record.

fn get_customer_balance(
    env: soroban_sdk::Env,
    customer_id: soroban_sdk::String,
) -> i128

Imports

WebAssembly Text (WAT) ▶