@bkd27/web3-sdk
v0.0.5
Published
Web3 SDK. It can be used in Node.js and browser applications.
Downloads
13
Readme
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
- Run
npm i @bkd27/web3-sdk
in your terminal import {createDid} from '@bkd27/web3-sdk'
;const response = createDid( "API Key from Infura dashboard", "goerli")
;- 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