3.0.3 • Published 5 years ago

lendroid v3.0.3

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

lendroid-js

A library to wrapper the lendroid Server and Lendroid Contract API's

installation

yarn add lendroid
// or
npm install --save lendroid

for the specific versions check on Releases

how to use

import { Lendroid } from 'lendroid'

const options = {
  provider: window.web3.currentProvider, // optional
  apiEndpoint: 'http://localhost:8080', // default
  apiLoanRequrests: 'http://localhost:5000', //default
  stateCallback: () => { }, // required: in React, Vue frontend, do run `this.forceUpdate()`
}

const LendroidJS = new Lendroid(options)

// properties
const { loading, orders, exchangeRates, contracts, web3Utils, metamask = {} } = LendroidJS
const { address, network } = metamask;
const { currentWETHExchangeRate, currentDAIExchangeRate } = exchangeRates
const offers = orders.orders
const myLendOffers = orders.myOrders.lend
const myBorrowOffers = orders.myOrders.borrow

// methods
const methods = {
  onCreateOrder: LendroidJS.onCreateOrder,
  onWrapETH: LendroidJS.onWrapETH,
  onAllowance: LendroidJS.onAllowance,
  onPostLoans: LendroidJS.onPostLoans,
  onFillLoan: LendroidJS.onFillLoan,
  onClosePosition: LendroidJS.onClosePosition,
  onTopUpPosition: LendroidJS.onTopUpPosition,
  onLiquidatePosition: LendroidJS.onLiquidatePosition,
  onFillOrderServer: LendroidJS.onFillOrderServer,
  onDeleteOrder: LendroidJS.onDeleteOrder,
  onCancelOrder: LendroidJS.onCancelOrder,
}

methods.onWrapETH(amount, operation === 'Wrap')

how to develop

  • First clone repository and install dependencies via Yarn(yarn) or NPM(npm install)

    via HTTPS - git clone https://github.com/lendroidproject/lendroid-js.git

    or SSH - git clone git@github.com:lendroidproject/lendroid-js.git

  • On UI, update package.json to use custom library as follow and install dependencies via Yarn(yarn) or NPM(npm install)

    "dependencies": {
      ...
      "lendroid": "../lendroid-js",
      ...
    }
  • To update library, go to lendroid-js and run tsc

  • Copy dist folder to <path-to-ui>/node_modules/lendroid/

    e.g: cp -rf ./dist ../reloanr-ui/node_modules/lendroid/

relations

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

2.5.1

5 years ago

2.5.0

5 years ago

2.4.7

5 years ago

2.4.6

5 years ago

2.4.5

5 years ago

2.4.4

5 years ago

2.4.3

5 years ago

2.4.2

5 years ago

2.4.1

5 years ago

2.4.0

5 years ago

2.3.1

5 years ago

2.3.0-beta.4

5 years ago

2.3.0-beta.3

5 years ago

2.3.0-beta.2

5 years ago

2.3.0-beta.1

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago