npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

tempdetherweb3

v0.13.2

Published

Dether SDK to easily call smart contract with web3js

Downloads

67

Readme

dether.web3

Run example

  • Google Chrome
  • Metamask

TODO

  • Check if the user is logged

Build the package

yarn build

Creage new React app

cd examples
npx create-react-app test
cd ..

Copy lib directory to node_modules

mv lib detherweb3
mv detherweb3 examples/test/node_modules

Copy package json

cp package.json examples/test/node_modules/detherweb3
cd examples/test/node_modules/detherweb3
yarn
cd ../../../

Copy example.js to src

cp example.js test/src

Remove everything in src/index.js and paste this code

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';

import './example';

ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();

Run the app and watch the console on the browser

cd test/
yarn start

Update the Build

yarn build
cp -r lib/* examples/test/node_modules/detherweb3/

Usage

Instanciate

import DetherWeb3 from 'detherweb3';

try {
  const detherWeb3 = new DetherWeb3();
  await detherWeb3.init()
} catch (e) {
  console.log(e)
}

Methods

Get Balance

import DetherWeb3 from 'detherweb3';

try {
  const detherWeb3 = new DetherWeb3();
  await detherWeb3.init()

  const balances = await detherWeb3.getBalance();

  console.log(balances);
} catch (e) {
  console.log(e)
}

Is sms registered

import DetherWeb3 from 'detherweb3';

try {
  const detherWeb3 = new DetherWeb3();
  await detherWeb3.init()

  const isSmsReg = await detherWeb3.isSmsReg();

  console.log(isSmsReg);
} catch (e) {
  console.log(e)
}

Get zone price

import DetherWeb3 from 'detherweb3';

try {
  const detherWeb3 = new DetherWeb3();
  await detherWeb3.init()

  const zoneId = 'GI'

  const zonePrice = await detherWeb3.getZonePrice(zoneId);

  console.log(zonePrice);
} catch (e) {
  console.log(e)
}

Get transaction status

import DetherWeb3 from 'detherweb3';

try {
  const detherWeb3 = new DetherWeb3();
  await detherWeb3.init()

  const hash = '' // ethereum transaction hash

  const transactionStatus = await detherWeb3.getTransactionStatus(hash);

  console.log(transactionStatus);
} catch (e) {
  console.log(e)
}

Is zone open

import DetherWeb3 from 'detherweb3';

try {
  const detherWeb3 = new DetherWeb3();
  await detherWeb3.init()

  const zoneId = 'GI'

  const open = await detherWeb3.isZoneOpen(zoneId);

  console.log(open);
} catch (e) {
  console.log(e)
}

Get shop

import DetherWeb3 from 'detherweb3';

try {
  const detherWeb3 = new DetherWeb3();
  await detherWeb3.init()

  const shop = await detherWeb3.getShop();

  console.log(shop);
} catch (e) {
  console.log(e)
}

Delete shop

import DetherWeb3 from 'detherweb3';

try {
  const detherWeb3 = new DetherWeb3();
  await detherWeb3.init()

  const hash = await detherWeb3.deleteShop();

  console.log(hash);
} catch (e) {
  console.log(e)
}

Add shop

import DetherWeb3 from 'detherweb3';

try {
  const detherWeb3 = new DetherWeb3();
  await detherWeb3.init()

  const data = {
    lat: 1.23,
    lng: 12.324,
    countryId: 'GI',
    postalCode: '34584',
    cat: 'catch',
    name: 'name',
    description: 'desc',
    opening: '0000000',
  };

  const hash = await detherWeb3.addShop(data);

  console.log(hash);
} catch (e) {
  console.log(e)
}

Getters

Get ethereum address

const address = detherWeb3.ethAddress;

Get network id

const networkId = detherWeb3.network;

Is web3

const isWeb3 = detherWeb3.isWeb3;

Is connected

const isConnected = detherWeb3.isConnected;

Is initialized

const isInit = detherWeb3.isInit;

TODO

  • Add more test
  • Add tellers feature
  • Add DTH transfer feature