1.0.5 • Published 2 years ago

@livcare/livcare-js v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

LiVCare-js

banner

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
1.0.2

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago