JavaScript
Serialized DID
Our SDK offers the ability to generate a serialized DID Document. On the blockchain itself we do not store the entire DID Document Object representation, rather we store the serialized document in hexadecimal. This is useful if you would like to manually send the document on-chain. To get a better understand about what is being stored please refer to the DID Document Custom Document Fields section.
generateDidDocument(address, customDocumentFields)
Parameter | Type | EVM | Substrate | Description |
---|---|---|---|---|
address | string | Required | Required | Used for the id and controller fields in the generated DID Document. |
chainType | ChainType | Required | Required | Defines the expected type of address to be passed. H160 for EVM and SS58 for Substrate. Defaults expect SS58 address. |
customDocumentFields | customDocumentFields | Optional | Optional | Used to set specific fields of the DID Document. If none is set, an empty document will be generated with id and controller set. |