shieth
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Shieth

Shieth is a little web3 helper intended on being used as a shim library for handling common interactions with web3 and our web front-end projects.

How to use

Install using npm:

npm install --save shieth
# or in dev 
npm link shieth

Then import the badboy into your project:

import EthJS from 'shieth';

And then instantiate it in your project

const eth = new EthJS({
  artifacts: [require('../build/contracts/SomeToken.json')],
  addresses: {
    SomeToken: 'SOME_ADDRESS'
  },
  onDirty: eth => {
    this.setState({
      account: eth.accounts.defaultAccount
    });
  }
});

ethjs will keep your accounts, the state of the network and some other things in order after you call load() on the instance:

eth
  .load()
  .then(async eth => this.refreshState(eth))
  .catch(error => console.log('Error -->', error));

Check out shieth-test for an example implementation!

/shieth/

    Package Sidebar

    Install

    npm i shieth

    Weekly Downloads

    1

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    93.2 kB

    Total Files

    18

    Last publish

    Collaborators

    • auser