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

0.2.6-early.access.1 • Public • Published

@sovryn-zero/lib-ethers

GitHub license GitHub stars Zero README

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

Quickstart

Install in your project:

npm install @sovryn-zero/lib-base @sovryn-zero/lib-ethers ethers@^5.0.0

To install early access releases (pre-releases) - use a specific version to install:

npm install @sovryn-zero/lib-ethers@1.0.0-early.access.0

The actual early access release version is here.

Connecting to an Ethereum node and sending a transaction:

const { Wallet, providers } = require("ethers");
const { EthersLiquity } = require("@sovryn-zero/lib-ethers");

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

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

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

More examples

See packages/examples in the repo.

API Reference

API Reference.

Package Sidebar

Install

npm i @sovryn-zero/lib-ethers

Weekly Downloads

31

Version

0.2.6-early.access.1

License

MIT

Unpacked Size

1.13 MB

Total Files

134

Last publish

Collaborators

  • victor-creed
  • soulbit
  • ororo_sovryn
  • cowsant
  • tjcloa