@livcare/livcare-js v1.0.5
LiVCare-js
This library contains all the functions necessary to interact with LivCare smart contracts. The package gives developers access to methods for reading data and executing transactions on the LivCare contracts.
Installing
npm install --save @livcare/livcare-js
Sample Usage
import LivMananger from ' @livcare/livcare-js'
View Methods
Token list
Retrieves the list of available tokens with the current deposit and borrow yields
const reserves = await livManager.singleAsset.getTokenlist()
Get beneficiary
Returns the beneficiary address specified by the investor
const reserves = await livManager.singleAsset.getBeneficiary()
Transaction Methods
Approve
Approves to LivManager contract to use the specified amount of sender funds in the specified token. @param tokenAddress @param amount
const reserves = await livManager.singleAsset.approve(tokenAddress, amount)
Deposit
Deposits into LivManager contract the specified amount of sender funds in the specified token. @param tokenAddress @param amount
await livManager.singleAsset.deposit(tokenAddress, amount)
Borrow
Borrow from LivManager contract the specified amount of tokens. @param tokenAddress @param amount
await livManager.singleAsset.borrow(tokenAddress, amount)
Repay
Repays to LivManager contract the specified amount of tokens in the specified token. @param tokenAddress @param amount
await livManager.singleAsset.repay(tokenAddress, amount)
Set Beneficiary
Sets the address of the beneficiary that will be able to withdrawn investor funds. @param tokenAddress @param amount
await livManager.singleAsset.setBeneficiary(beneficiaryAddress)
Test
npm run test
Build
npm run build