0.0.5 • Published 1 year ago

@bkd27/web3-sdk v0.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Web3-Sdk

Web3 SDK. It can be used in Node.js and browser applications.

'createDid' function uses the ethr-did library to create a DID on the Ethereum blockchain, starting with the generation of a mnemonic for the private key. The private key is then derived from the mnemonic and used to connect to the Ethereum network using the Infura provider.

Get Started

  1. Run npm i @bkd27/web3-sdk in your terminal
  2. import {createDid} from '@bkd27/web3-sdk';
  3. const response = createDid( "API Key from Infura dashboard", "goerli");
  4. Sample response
{
mnemonic: 'cupboard vendor other tomato cotton stamp minimum woman half hint funny army',
did: 'did:ethr:mainnet:0x24cd1C547BddbA633f07AB81a3cBbF5c55A0c1E1',
privateKey: '0x1a6acf638f2fdb7bec5f1c226af8fa7bd35d991a673a3fa3cbcaf1d5a534eac8',
publicKey: '0x04abfa1b7c9bae2318449c693cd39f53f6077ad2d1565a190ac5d632f45fa13910811db1453b7a58ea0dc779e86225a869a4b090aa8062f7d75f1c51a551ba2869',
address: '0x24cd1C547BddbA633f07AB81a3cBbF5c55A0c1E1'
}

Testing

npm run test