@kumodao/lib-ethers
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@kumodao/lib-ethers

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

Quickstart

Install in your project:

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

Connecting to an Ethereum node and sending a transaction:

const { Wallet, providers } = require("ethers");
const { EthersKumo} = require("kumodao/lib-ethers");


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

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

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

More examples

See packages/examples in the repo.

Kumo's Dev UI itself contains many examples of @kumodao/lib-ethers use.

API Reference

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

Package Sidebar

Install

npm i @kumodao/lib-ethers

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

1.25 MB

Total Files

143

Last publish

Collaborators

  • kumodao