# @livcare/livcare-js

> javascript library to connect with the smart contracts

Latest version **1.0.5** (published 2022-06-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @livcare/livcare-js
pnpm add @livcare/livcare-js
yarn add @livcare/livcare-js
bun add @livcare/livcare-js
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2022-06-22 |
| First published | 2022-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 2 |
| Unpacked size | 230.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ialberquilla |

## Links

- npm: https://www.npmjs.com/package/@livcare/livcare-js
- Repository: https://github.com/ialberquilla/livcare-js
- Homepage: https://github.com/ialberquilla/livcare-js#readme
- Issues: https://github.com/ialberquilla/livcare-js/issues
- npm.io page: https://npm.io/package/@livcare/livcare-js

## Dependencies (2)

- [ethers](https://npm.io/package/ethers.md) ^5.6.5
- [ethereum-multicall](https://npm.io/package/ethereum-multicall.md) ^2.12.0

## Recent versions

- 1.0.5 (latest) — 2022-06-22
- 1.0.4 — 2022-06-22
- 1.0.3 — 2022-06-19
- 1.0.2 — 2022-06-19
- 1.0.1 — 2022-05-24
- 1.0.0 — 2022-05-24

## README

# LiVCare-js

[![banner](./assets/images/logo.png)](https://livis.one/)

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.

- [LiVCare-js](#livcare-js)
  - [Installing](#installing)
  - [Sample Usage](#sample-usage)
- [View Methods](#view-methods)
  - [Token list](#token-list)
  - [Get beneficiary](#get-beneficiary)
- [Transaction Methods](#transaction-methods)
  - [Approve](#approve)
  - [Deposit](#deposit)
  - [Borrow](#borrow)
  - [Repay](#repay)
  - [Set Beneficiary](#set-beneficiary)
- [Test](#test)
- [Build](#build)


## Installing

```bash
npm install --save @livcare/livcare-js
```

## Sample Usage

```bash
import LivMananger from ' @livcare/livcare-js'
```

# View Methods

## Token list

Retrieves the list of available tokens with the current deposit and borrow yields

```bash
const reserves = await livManager.singleAsset.getTokenlist()
```

## Get beneficiary

Returns the beneficiary address specified by the investor

```bash
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


```bash
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


```bash
await livManager.singleAsset.deposit(tokenAddress, amount)
```

## Borrow

Borrow from LivManager contract the specified amount of tokens.
@param tokenAddress
@param amount

```bash
await livManager.singleAsset.borrow(tokenAddress, amount)
```

## Repay

Repays to LivManager contract the specified amount of tokens in the specified token.
@param tokenAddress
@param amount


```bash
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


```bash
await livManager.singleAsset.setBeneficiary(beneficiaryAddress)
```

# Test 

```bash
npm run test
```

# Build 

```bash
npm run build
```

---
_Source: https://npm.io/package/@livcare/livcare-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
