shieth
v1.0.0
Published
Shishito ethereum utilities
Downloads
3
Readme
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!