Socket
Book a DemoInstallSign in
Socket

@mahadao/arth-ethers

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mahadao/arth-ethers

ARTH SDK Ethers-based implementation

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source

@mahadao/arth-ethers

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

Quickstart

Install in your project:

npm install --save @mahadao/arth-base @mahadao/arth-ethers ethers@^5.0.0

Connecting to an Ethereum node and sending a transaction:

const { Wallet, providers } = require("ethers");
const { EthersARTH } = require("@mahadao/arth-ethers");

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

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

  console.log(`Successfully opened a ARTH Loan (${newTrove})!`);
}

More examples

See packages/examples in the repo.

ARTH's Dev UI itself contains many examples of @mahadao/arth-ethers use.

API Reference

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

Keywords

ARTH

FAQs

Package last updated on 05 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts