Testnet demo. Test banks and test money only.

Contents and search

KredoFi docs

Contracts & API

Addresses, methods, views and events.

#Addresses

MainnetTestnet
KredoFi contractkredofi.nearkredofi.kency.testnet
USDC17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1 (native USDC)musdc.kency.testnet (test USDC)
ScoringOutLayer (outlayer.near), Intel TDXDev mode (our server)
Pinned scorer7048cc92a708564df3acdececd9a9880c3054f6d9ff0b4cebedd51ac268dc978ac8e2a9c732db84ccaee2854ed4f0b8394443b47e51dc7fcf8499005051ec0e9

Amounts are USDC with 6 decimals ($100 = 100000000), passed as strings. Times are nanoseconds.

#Borrower methods

MethodWhat it does
request_score(public_token, reply_pubkey)mainnet: ask for a score; attach at least 0.01 NEAR; must be signed by the borrower
borrow(amount)take a loan up to your limit; 1 yoctoNEAR
USDC ft_transfer_call with msg: "repay"repay the exact amount due

#Lender methods

MethodWhat it does
USDC ft_transfer_call with msg: "deposit"deposit and receive shares
withdraw(shares)burn shares for USDC; 1 yoctoNEAR

#Anyone

MethodWhat it does
mark_default(borrower)after the due date plus grace
request_identity_release(borrower)after a default, once; attach at least 0.01 NEAR

#Owner

set_scorer_version, set_loan_term_ns, set_grace_ns, set_min_hold_ns, set_score_ttl_ns, set_max_borrower_share_bps, withdraw_treasury, treasury_to_reserve, and ft_transfer_call with msg: "seed_reserve". Each needs 1 yoctoNEAR and emits an event.

#Views

get_config, get_pool, get_lender(account_id), get_borrower(account_id) (never returns the sealed name), get_limit(account_id), get_stats, is_release_allowed(account_id).

#Events

NEP-297 logs with standard kredofi, version 1.0.0:

score_issued, score_failed, loan_issued, loan_repaid, loan_defaulted, identity_released, lender_deposit, lender_withdraw, reserve_seeded, treasury_withdrawn, treasury_to_reserve, scorer_version_changed, param_changed.

The public ledger is built from these events and trusts only logs from receipts executed by the KredoFi contract itself.

#Web API (testnet demo)

Scoring on the demo needs proof that you control the account: POST /api/score/challenge returns a one-time nonce (5 minutes), the account signs a NEP-413 message naming the account and the browser's reply key, and /api/score checks the signature and that the key is a full-access key of the account.

The demo's server routes (/api/score, /api/relay, /api/demo, /api/faucet, /api/ledger, /api/intents/quote) exist to run the testnet demo; they are rate-limited and not a stable public API.