Installation

What is the DetherJS library?

DetherJS allows you to easily interact with the Dether protocol running on Ethereum smart contracts.

With detherJS, you can:

  • own a zone,

  • bid on a zone already owned,

  • add your teller,

  • add your shop,

  • get tellers and shops information,

  • own a zone,

  • bid on an already-owned zone,

  • add your teller,

  • add your shop,

  • get tellers’ and shops’ information,

Installation

npm install detherjs

Usage

import DetherJS from "detherjs";
// You need a web3 provider
const INFURA_KEY = "INFURA_KEY";
const rpcURL = `https://kovan.infura.io/v3/${INFURA_KEY}`;
const detherJs = new DetherJS(false);
const exampleGetTeller = async () => {
// init detherJS with provider
await detherJs.init({ rpcURL });
// function getTeller te got a teller with a valid teller address on kovan
const teller = await detherJs.getTeller(
"0x907f3400F9f12EFCD160f387B5AF317B640fD6c2"
);
console.log(teller);
};
exampleGetTeller();