Class: IntermediateDidDocument ​
Defined in: packages/method/src/utils/did-document.ts:436
IntermediateDidDocument extends the DidDocument class for creating and managing intermediate DID documents. This class is used to create a minimal DID document with a placeholder ID. It is used in the process of creating a new DID document. IntermediateDidDocument
Extends ​
Constructors ​
Constructor ​
new IntermediateDidDocument(
document):IntermediateDidDocument
Defined in: packages/method/src/utils/did-document.ts:437
Parameters ​
document ​
Returns ​
IntermediateDidDocument
Overrides ​
Properties ​
@context? ​
optional@context: (string|JSONObject)[] =BTCR2_DID_DOCUMENT_CONTEXT
Defined in: packages/method/src/utils/did-document.ts:116
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'.
Inherited from ​
assertionMethod? ​
optionalassertionMethod: (string|DidVerificationMethod)[]
Defined in: packages/method/src/utils/did-document.ts:119
The assertion methods of the DID Document.
Inherited from ​
authentication? ​
optionalauthentication: (string|DidVerificationMethod)[]
Defined in: packages/method/src/utils/did-document.ts:118
The authentication methods of the DID Document.
Inherited from ​
capabilityDelegation? ​
optionalcapabilityDelegation: (string|DidVerificationMethod)[]
Defined in: packages/method/src/utils/did-document.ts:121
The capability delegation methods of the DID Document.
Inherited from ​
DidDocument.capabilityDelegation
capabilityInvocation? ​
optionalcapabilityInvocation: (string|DidVerificationMethod)[]
Defined in: packages/method/src/utils/did-document.ts:120
The capability invocation methods of the DID Document.
Inherited from ​
DidDocument.capabilityInvocation
controller? ​
optionalcontroller:string[]
Defined in: packages/method/src/utils/did-document.ts:115
The controller of the DID Document.
Inherited from ​
id ​
id:
string
Defined in: packages/method/src/utils/did-document.ts:114
The identifier of the DID Document.
Inherited from ​
service ​
service:
BeaconService[]
Defined in: packages/method/src/utils/did-document.ts:122
The services of the DID Document.
Inherited from ​
verificationMethod ​
verificationMethod:
DidVerificationMethod[]
Defined in: packages/method/src/utils/did-document.ts:117
The verification methods of the DID Document.
Inherited from ​
DidDocument.verificationMethod
Methods ​
json() ​
json():
JSONObject
Defined in: packages/method/src/utils/did-document.ts:186
Convert the DidDocument to a JSON object.
Returns ​
The JSON representation of the DidDocument.
Inherited from ​
toDidDocument() ​
toDidDocument(
did):DidDocument
Defined in: packages/method/src/utils/did-document.ts:446
Convert the IntermediateDidDocument to a DidDocument by replacing the placeholder value with the provided DID.
Parameters ​
did ​
string
The DID to replace the placeholder value in the document.
Returns ​
A new DidDocument with the placeholder value replaced by the provided DID.
toIntermediate() ​
toIntermediate():
IntermediateDidDocument
Defined in: packages/method/src/utils/did-document.ts:421
Convert the DidDocument to an IntermediateDidDocument.
Returns ​
IntermediateDidDocument
The IntermediateDidDocument representation of the DidDocument.
Inherited from ​
validateIntermediate() ​
validateIntermediate():
boolean
Defined in: packages/method/src/utils/did-document.ts:392
Validate the IntermediateDidDocument.
Returns ​
boolean
True if the IntermediateDidDocument is valid.
Inherited from ​
DidDocument.validateIntermediate
create() ​
staticcreate(verificationMethod,relationships,service):IntermediateDidDocument
Defined in: packages/method/src/utils/did-document.ts:470
Create a minimal IntermediateDidDocument with a placeholder ID.
Parameters ​
verificationMethod ​
The public key in multibase format.
relationships ​
The public key in multibase format.
service ​
The service to be included in the document.
Returns ​
IntermediateDidDocument
A new IntermediateDidDocument with the placeholder ID.
fromDidDocument() ​
staticfromDidDocument(didDocument):IntermediateDidDocument
Defined in: packages/method/src/utils/did-document.ts:458
Create an IntermediateDidDocument from a DidDocument by replacing the DID with a placeholder value.
Parameters ​
didDocument ​
The DidDocument to convert.
Returns ​
IntermediateDidDocument
The IntermediateDidDocument representation of the DidDocument.
fromExternalIdentifier() ​
staticfromExternalIdentifier(data):DidDocument
Defined in: packages/method/src/utils/did-document.ts:234
Create a DidDocument from "x1" btcr2 identifier.
Parameters ​
data ​
The verification methods of the DID Document.
Returns ​
A new DidDocument.
Inherited from ​
DidDocument.fromExternalIdentifier
fromJSON() ​
staticfromJSON(object):IntermediateDidDocument
Defined in: packages/method/src/utils/did-document.ts:518
Taken an object, convert it to an IntermediateDocuemnt and then to a DidDocument.
Parameters ​
object ​
The JSON object to convert.
Returns ​
IntermediateDidDocument
The created DidDocument.
fromKeyIdentifier() ​
staticfromKeyIdentifier(id,publicKeyMultibase,service):DidDocument
Defined in: packages/method/src/utils/did-document.ts:206
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 ​
A new DidDocument with the placeholder ID.
Inherited from ​
fromPublicKey() ​
staticfromPublicKey(publicKey,network):IntermediateDidDocument
Defined in: packages/method/src/utils/did-document.ts:484
Create a minimal IntermediateDidDocument from a public key.
Parameters ​
publicKey ​
The public key in bytes format.
network ​
string
Returns ​
IntermediateDidDocument
A new IntermediateDidDocument with the placeholder ID.
isValid() ​
staticisValid(didDocument):boolean
Defined in: packages/method/src/utils/did-document.ts:258
Validates a DidDocument by breaking it into modular validation methods.
Parameters ​
didDocument ​
The DID document to validate.
Returns ​
boolean
True if the DID document is valid.
Throws ​
If any validation check fails.
Inherited from ​
sanitize() ​
staticsanitize(doc):DidDocument
Defined in: packages/method/src/utils/did-document.ts:243
Sanitize the DID Document by removing undefined values
Parameters ​
doc ​
Returns ​
The sanitized DID Document
Inherited from ​
validate() ​
staticvalidate(didDocument):DidDocument
Defined in: packages/method/src/utils/did-document.ts:377
Validate the DID Document
Parameters ​
didDocument ​
DidDocument | IntermediateDidDocument
Returns ​
Validated DID Document.
Throws ​
If the DID Document is invalid.