diff --git a/README.md b/README.md index 21e3194..6b61b8e 100644 --- a/README.md +++ b/README.md @@ -25,17 +25,11 @@ npm install dsa-sdk For production, we recommend linking to a specific version number ([jsdeliver](https://www.jsdelivr.com/package/npm/dsa-sdk)). ## Usage -Now instantiate DSA. -```js -// in node.js -const dsa = require('dsa-sdk'); -const dsa = new DSA(); -``` - -DSA only works with web3 library so you also have to instantiate [Web3](https://github.com/ethereum/web3.js/#installation). +Currently, this SDK only works with [web3 library](https://github.com/ethereum/web3.js/#installation) ```js +// in browser if (window.ethereum) { window.web3 = new Web3(window.ethereum) } else if (window.web3) { @@ -43,6 +37,17 @@ if (window.ethereum) { } else { window.web3 = new Web3(customProvider) } + +// in node.js +const Web3 = require('web3') +const DSA = require('dsa-sdk'); +const web3 = new Web3(new Web3.providers.HttpProvider(ETH_NODE_URL)) +``` + +Now instantiate DSA. + +```js +const dsa = new DSA(web3); ``` ## Get Accounts