Class: DidDocument ​
Defined in: packages/method/dist/types/utils/did-document.d.ts:84
BTCR2 DID Document extends the DidDocument class adding helper methods and properties DidDocument
Implements ​
Implements ​
Constructors ​
Constructor ​
new DidDocument(
document):DidDocument
Defined in: packages/method/dist/types/utils/did-document.d.ts:95
Parameters ​
document ​
Returns ​
DidDocument
Properties ​
@context? ​
optional@context: (string|JsonObject)[]
Defined in: packages/method/dist/types/utils/did-document.d.ts:87
A JSON-LD context link, which provides a JSON-LD processor with the information necessary to interpret the DID document JSON. The default context URL is 'https://www.w3.org/ns/did/v1'.
Implementation of ​
assertionMethod? ​
optionalassertionMethod: (string|DidVerificationMethod)[]
Defined in: packages/method/dist/types/utils/did-document.d.ts:90
The assertion methods of the DID Document.
Implementation of ​
authentication? ​
optionalauthentication: (string|DidVerificationMethod)[]
Defined in: packages/method/dist/types/utils/did-document.d.ts:89
The authentication methods of the DID Document.
Implementation of ​
capabilityDelegation? ​
optionalcapabilityDelegation: (string|DidVerificationMethod)[]
Defined in: packages/method/dist/types/utils/did-document.d.ts:92
The capability delegation methods of the DID Document.
Implementation of ​
IDidDocument.capabilityDelegation
capabilityInvocation? ​
optionalcapabilityInvocation: (string|DidVerificationMethod)[]
Defined in: packages/method/dist/types/utils/did-document.d.ts:91
The capability invocation methods of the DID Document.
Implementation of ​
IDidDocument.capabilityInvocation
controller? ​
optionalcontroller:string[]
Defined in: packages/method/dist/types/utils/did-document.d.ts:86
The controller of the DID Document.
Implementation of ​
deactivated? ​
optionaldeactivated:boolean
Defined in: packages/method/dist/types/utils/did-document.d.ts:94
id ​
id:
string
Defined in: packages/method/dist/types/utils/did-document.d.ts:85
The identifier of the DID Document.
Implementation of ​
service ​
service:
BeaconService[]
Defined in: packages/method/dist/types/utils/did-document.d.ts:93
The services of the DID Document.
Implementation of ​
verificationMethod ​
verificationMethod:
DidVerificationMethod[]
Defined in: packages/method/dist/types/utils/did-document.d.ts:88
The verification methods of the DID Document.
Implementation of ​
IDidDocument.verificationMethod
Methods ​
json() ​
json():
DidDocument
Defined in: packages/method/dist/types/utils/did-document.d.ts:100
Convert the DidDocument to a JSON object.
Returns ​
DidDocument
The JSON representation of the DidDocument.
toIntermediate() ​
toIntermediate():
GenesisDocument
Defined in: packages/method/dist/types/utils/did-document.d.ts:182
Convert the DidDocument to an GenesisDocument.
Returns ​
The GenesisDocument representation of the DidDocument.
validateGenesis() ​
validateGenesis():
boolean
Defined in: packages/method/dist/types/utils/did-document.d.ts:177
Validate the GenesisDocument.
Returns ​
boolean
True if the GenesisDocument is valid.
fromExternalIdentifier() ​
staticfromExternalIdentifier(data):DidDocument
Defined in: packages/method/dist/types/utils/did-document.d.ts:113
Create a DidDocument from "x1" btcr2 identifier.
Parameters ​
data ​
The verification methods of the DID Document.
Returns ​
DidDocument
A new DidDocument.
fromKeyIdentifier() ​
staticfromKeyIdentifier(id,publicKeyMultibase,service):DidDocument
Defined in: packages/method/dist/types/utils/did-document.d.ts:107
Create a minimal DidDocument from "k1" btcr2 identifier.
Parameters ​
id ​
string
publicKeyMultibase ​
string
The public key in multibase format.
service ​
The beacon services to be included in the document.
Returns ​
DidDocument
A new DidDocument with the placeholder ID.
isValid() ​
staticisValid(didDocument):boolean
Defined in: packages/method/dist/types/utils/did-document.d.ts:125
Validates a DidDocument by breaking it into modular validation methods.
Parameters ​
didDocument ​
DidDocument
The DID document to validate.
Returns ​
boolean
True if the DID document is valid.
Throws ​
If any validation check fails.
sanitize() ​
staticsanitize(doc):DidDocument
Defined in: packages/method/dist/types/utils/did-document.d.ts:118
Sanitize the DID Document by removing undefined values
Parameters ​
doc ​
DidDocument
Returns ​
DidDocument
The sanitized DID Document
validate() ​
staticvalidate(didDocument):DidDocument
Defined in: packages/method/dist/types/utils/did-document.d.ts:172
Validate the DID Document
Parameters ​
didDocument ​
DidDocument | GenesisDocument
Returns ​
DidDocument
Validated DID Document.
Throws ​
If the DID Document is invalid.