Generate DID
8min
Once connected, you will be able to create a peaq DID by using the...
Function: create(address, name, seed)
Parameters & types:
name REQUIRED <string>: representing the DID name.
address <string>: representing the DID address.
seed <string>: representing the seed phrase.
callback <function>: for error handling.
Note:
If the user has already passed the seed at the time of creating the SDK instance, then it is not necessary to pass it again at the time of creating the DID and address also.
It then creates an instance of the Sdk class from the @peaq-network/sdk library, passing in the baseUrl and seed.
It then calls the sdk.did.create()method with the namewhich returns the generated peaq DID.
Finally, it disconnects from the peaq network using the disconnect() method and returns the DID.
Notes:
if you have no balance in your seed or accout, you can get from our faucet
response object
hash: The hash is a value obtained after the peaq DID is created on the chain, and it is derived from the peaq DID document. The peaq DID document includes the peaq DID name and user public address, among other information.