1.0.3 • Published 10 months ago

@liquidloans/lib-ethers-dev v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@liquidloans/lib-ethers

Ethers-based library for reading Liquid Loans protocol state and sending transactions.

Quickstart

Install in your project:

npm install --save @liquidloans/lib-base @liquidloans/lib-ethers ethers@^5.0.0

Connecting to an Ethereum node and sending a transaction:

const { Wallet, providers } = require("ethers");
const { EthersLiquidLoans } = require("@liquidloans/lib-ethers");

async function example() {
  const provider = new providers.JsonRpcProvider("http://localhost:8545");
  const wallet = new Wallet(process.env.PRIVATE_KEY).connect(provider);
  const liquidLoans = await EthersLiquidLoans.connect(wallet);

  const { newVault } = await liquidLoans.openVault({
    depositCollateral: 5, // PLS
    borrowUSDL: 2000
  });

  console.log(`Successfully opened a LiquidLoans Vault (${newVault})!`);
}

More examples

See packages/examples in the repo.

Liquid Loans's Dev UI itself contains many examples of @liquidloans/lib-ethers use.

API Reference

For now, it can be found in the public Liquid Loans repo.

1.0.3

10 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago