Deposit Collateral for ERC20
SmartCredit.io Borrowing SDK - depositERC20Collateral() transfers ERC20 token collateral from a borrower's wallet to their credit line smart contract.
Last updated:
async depositERC20Collateral()
Depositing collateral for ERC20 loan you should use:
The ethAddress, contractAddress and amount information you will get after getting a successful response from Single Loan, while the walletAddress is the address of the user.
const response = await this.newBorrowingService.transferTokens(
loan.collateral.ethAddress,
loan.creditLine.contractAddress,
loan.collateralInfo.amount,
walletAddress
)