Creditline Contract
The core BNPL lending contract
Creditline Contract
The creditline contract is the core of the StepFi protocol. It handles loan creation, approval, and repayment.
Contract ID: CAQDHYG3TALPNXG466SZUMJEPOI7VYV732LPFF3GHE4ASPBCNMIQBS3X
create_loan()
Creates a new loan request in Pending status.
pub fn create_loan(
env: Env,
borrower: Address,
vendor: Address,
amount: i128,
installments: u32,
loan_type: LoanType,
) -> Loan
| Parameter | Type | Description |
|---|---|---|
| borrower | Address | Learner's Stellar wallet address |
| vendor | Address | Vendor's Stellar wallet address |
| amount | i128 | Loan amount in stroops |
| installments | u32 | Number of monthly payments |
| loan_type | LoanType | Standard or LearnerInstallment |
approve_loan()
Transitions a loan from Pending to Active. Admin only.
pub fn approve_loan(env: Env, loan_id: u64) -> Loan
repay_installment()
Processes a single installment payment.
pub fn repay_installment(
env: Env,
loan_id: u64,
installment_index: u32,
) -> Loan