Borrowing SDK
The functionality that the SDK will offer to integrate the borrowing widget are such as:
  • Authentication
  • Get Validators needed for integrating the Borrowing Widget
  • Get Collateral needed for a specific loan request
  • Create a Credit Line
  • Get all Credit Line that the user has created
  • Create a Loan request
  • List all loan request that user has created
  • Get details for a specific loan request
  • Deposit collateral for specific loan request
  • Approve repayment if asset is not Ethereum
  • Repay specific loan request

Initialize Borrowing SDK

The basic initialization for integrating the Borrowing SDK will look like this:
When passing the environment env note that if you use prod the SDK will take the production configuration, and if you use beta the SDK will work on Ropsten testnet network.
import { NewBorrowingService } from '@smartcredit/client-sdk';
public newBorrowingService;
this.injectedProvider = (window as any).ethereum;
this.newBorrowingService = new NewBorrowingService({
web3Provider: new Web3(this.injectedProvider),
env: "prod" or "beta"
});
Copy link