lib-ethers-u
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

lib-ethers-u

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

Quickstart

Install in your project:

npm install --save lib-base-u lib-ethers-u ethers@^5.0.0

Connecting to an Ethereum node and sending a transaction:

const { Wallet, providers } = require("ethers");
const { EthersLiquity } = require("lib-ethers-u");

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

  const { newTrove } = await liquity.openTrove({
    depositCollateral: 5, // ETH
    borrowLUSD: 2000
  });

  console.log(`Successfully opened a Liquity Trove (${newTrove})!`);
}

More examples

See packages/examples in the repo.

API Reference

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

Package Sidebar

Install

npm i lib-ethers-u

Weekly Downloads

1

Version

0.0.5

License

MIT

Unpacked Size

1.61 MB

Total Files

161

Last publish

Collaborators

  • 0xgreatape