@did-btc1/method / IntermediateDidDocument
Class: IntermediateDidDocument
Defined in: packages/method/src/utils/did-document.ts:433
IntermediateDidDocument extends the Btc1DidDocument 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:434
Parameters
document
Returns
IntermediateDidDocument
Overrides
Properties
@context?
> optional
@context: (string
| JSONObject
)[] = BTC1_DID_DOCUMENT_CONTEXT
Defined in: packages/method/src/utils/did-document.ts:114
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?
> optional
assertionMethod: (string
| Btc1VerificationMethod
)[]
Defined in: packages/method/src/utils/did-document.ts:117
The assertion methods of the DID Document.
Inherited from
Btc1DidDocument
.assertionMethod
authentication?
> optional
authentication: (string
| Btc1VerificationMethod
)[]
Defined in: packages/method/src/utils/did-document.ts:116
The authentication methods of the DID Document.
Inherited from
Btc1DidDocument
.authentication
capabilityDelegation?
> optional
capabilityDelegation: (string
| Btc1VerificationMethod
)[]
Defined in: packages/method/src/utils/did-document.ts:119
The capability delegation methods of the DID Document.
Inherited from
Btc1DidDocument
.capabilityDelegation
capabilityInvocation?
> optional
capabilityInvocation: (string
| Btc1VerificationMethod
)[]
Defined in: packages/method/src/utils/did-document.ts:118
The capability invocation methods of the DID Document.
Inherited from
Btc1DidDocument
.capabilityInvocation
controller?
> optional
controller: string
[]
Defined in: packages/method/src/utils/did-document.ts:113
The controller of the DID Document.
Inherited from
id
> id: string
Defined in: packages/method/src/utils/did-document.ts:112
The identifier of the DID Document.
Inherited from
service
> service: BeaconService
[]
Defined in: packages/method/src/utils/did-document.ts:120
The services of the DID Document.
Inherited from
verificationMethod
> verificationMethod: Btc1VerificationMethod
[]
Defined in: packages/method/src/utils/did-document.ts:115
The verification methods of the DID Document.
Inherited from
Btc1DidDocument
.verificationMethod
Methods
json()
> json(): JSONObject
Defined in: packages/method/src/utils/did-document.ts:184
Convert the Btc1DidDocument to a JSON object.
Returns
JSONObject
The JSON representation of the Btc1DidDocument.
Inherited from
toBtc1DidDocument()
> toBtc1DidDocument(did
): Btc1DidDocument
Defined in: packages/method/src/utils/did-document.ts:460
Convert the IntermediateDidDocument to a Btc1DidDocument 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 Btc1DidDocument with the placeholder value replaced by the provided DID.
toIntermediate()
> toIntermediate(): IntermediateDidDocument
Defined in: packages/method/src/utils/did-document.ts:418
Convert the Btc1DidDocument to an IntermediateDidDocument.
Returns
IntermediateDidDocument
The IntermediateDidDocument representation of the Btc1DidDocument.
Inherited from
Btc1DidDocument
.toIntermediate
validateIntermediate()
> validateIntermediate(): void
Defined in: packages/method/src/utils/did-document.ts:391
Validate the IntermediateDidDocument.
Returns
void
True if the IntermediateDidDocument is valid.
Inherited from
Btc1DidDocument
.validateIntermediate
create()
> static
create(verificationMethod
, relationships
, service
): IntermediateDidDocument
Defined in: packages/method/src/utils/did-document.ts:446
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.
from()
> static
from(object
): Btc1DidDocument
Defined in: packages/method/src/utils/did-document.ts:471
Create a Btc1DidDocument from a JSON object.
Parameters
object
JSONObject
The JSON object to convert.
Returns
The created Btc1DidDocument.
fromExternalIdentifier()
> static
fromExternalIdentifier(data
): Btc1DidDocument
Defined in: packages/method/src/utils/did-document.ts:232
Create a Btc1DidDocument from "x1" btc1 identifier.
Parameters
data
The verification methods of the DID Document.
Returns
A new Btc1DidDocument.
Inherited from
Btc1DidDocument
.fromExternalIdentifier
fromKeyIdentifier()
> static
fromKeyIdentifier(id
, publicKeyMultibase
, service
): Btc1DidDocument
Defined in: packages/method/src/utils/did-document.ts:204
Create a minimal Btc1DidDocument from "k1" btc1 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 Btc1DidDocument with the placeholder ID.
Inherited from
Btc1DidDocument
.fromKeyIdentifier
isValid()
> static
isValid(didDocument
): boolean
Defined in: packages/method/src/utils/did-document.ts:256
Validates a Btc1DidDocument 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()
> static
sanitize(doc
): Btc1DidDocument
Defined in: packages/method/src/utils/did-document.ts:241
Sanitize the DID Document by removing undefined values
Parameters
doc
Returns
The sanitized DID Document
Inherited from
validate()
> static
validate(didDocument
): Btc1DidDocument
Defined in: packages/method/src/utils/did-document.ts:376
Validate the DID Document
Parameters
didDocument
Btc1DidDocument
| IntermediateDidDocument
Returns
Validated DID Document.
Throws
If the DID Document is invalid.