@credo-ts/cheqd 0.6.1-pr-2091-20241119140918 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/build/CheqdApi.d.mts +45 -0
  2. package/build/CheqdApi.d.mts.map +1 -0
  3. package/build/CheqdApi.mjs +26 -0
  4. package/build/CheqdApi.mjs.map +1 -0
  5. package/build/CheqdModule.d.mts +15 -0
  6. package/build/CheqdModule.d.mts.map +1 -0
  7. package/build/CheqdModule.mjs +25 -0
  8. package/build/CheqdModule.mjs.map +1 -0
  9. package/build/CheqdModuleConfig.d.mts +21 -0
  10. package/build/CheqdModuleConfig.d.mts.map +1 -0
  11. package/build/CheqdModuleConfig.mjs +14 -0
  12. package/build/CheqdModuleConfig.mjs.map +1 -0
  13. package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs +10 -0
  14. package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs +7 -0
  15. package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs +9 -0
  16. package/build/anoncreds/index.d.mts +1 -0
  17. package/build/anoncreds/index.mjs +1 -0
  18. package/build/anoncreds/services/CheqdAnonCredsRegistry.d.mts +32 -0
  19. package/build/anoncreds/services/CheqdAnonCredsRegistry.d.mts.map +1 -0
  20. package/build/anoncreds/services/CheqdAnonCredsRegistry.mjs +349 -0
  21. package/build/anoncreds/services/CheqdAnonCredsRegistry.mjs.map +1 -0
  22. package/build/anoncreds/utils/identifiers.mjs +56 -0
  23. package/build/anoncreds/utils/identifiers.mjs.map +1 -0
  24. package/build/anoncreds/utils/transform.mjs +104 -0
  25. package/build/anoncreds/utils/transform.mjs.map +1 -0
  26. package/build/dids/CheqdDidRegistrar.d.mts +102 -0
  27. package/build/dids/CheqdDidRegistrar.d.mts.map +1 -0
  28. package/build/dids/CheqdDidRegistrar.mjs +446 -0
  29. package/build/dids/CheqdDidRegistrar.mjs.map +1 -0
  30. package/build/dids/CheqdDidResolver.d.mts +30 -0
  31. package/build/dids/CheqdDidResolver.d.mts.map +1 -0
  32. package/build/dids/CheqdDidResolver.mjs +135 -0
  33. package/build/dids/CheqdDidResolver.mjs.map +1 -0
  34. package/build/dids/didCheqdUtil.mjs +113 -0
  35. package/build/dids/didCheqdUtil.mjs.map +1 -0
  36. package/build/dids/index.d.mts +2 -0
  37. package/build/dids/index.mjs +2 -0
  38. package/build/index.d.mts +10 -0
  39. package/build/index.mjs +11 -0
  40. package/build/ledger/CheqdLedgerService.d.mts +35 -0
  41. package/build/ledger/CheqdLedgerService.d.mts.map +1 -0
  42. package/build/ledger/CheqdLedgerService.mjs +114 -0
  43. package/build/ledger/CheqdLedgerService.mjs.map +1 -0
  44. package/build/ledger/index.d.mts +1 -0
  45. package/build/ledger/index.mjs +1 -0
  46. package/package.json +22 -22
  47. package/build/CheqdApi.d.ts +0 -38
  48. package/build/CheqdApi.js +0 -34
  49. package/build/CheqdApi.js.map +0 -1
  50. package/build/CheqdModule.d.ts +0 -11
  51. package/build/CheqdModule.js +0 -33
  52. package/build/CheqdModule.js.map +0 -1
  53. package/build/CheqdModuleConfig.d.ts +0 -17
  54. package/build/CheqdModuleConfig.js +0 -14
  55. package/build/CheqdModuleConfig.js.map +0 -1
  56. package/build/anoncreds/index.d.ts +0 -1
  57. package/build/anoncreds/index.js +0 -6
  58. package/build/anoncreds/index.js.map +0 -1
  59. package/build/anoncreds/services/CheqdAnonCredsRegistry.d.ts +0 -19
  60. package/build/anoncreds/services/CheqdAnonCredsRegistry.js +0 -368
  61. package/build/anoncreds/services/CheqdAnonCredsRegistry.js.map +0 -1
  62. package/build/anoncreds/utils/identifiers.d.ts +0 -13
  63. package/build/anoncreds/utils/identifiers.js +0 -53
  64. package/build/anoncreds/utils/identifiers.js.map +0 -1
  65. package/build/anoncreds/utils/transform.d.ts +0 -43
  66. package/build/anoncreds/utils/transform.js +0 -170
  67. package/build/anoncreds/utils/transform.js.map +0 -1
  68. package/build/dids/CheqdDidRegistrar.d.ts +0 -86
  69. package/build/dids/CheqdDidRegistrar.js +0 -334
  70. package/build/dids/CheqdDidRegistrar.js.map +0 -1
  71. package/build/dids/CheqdDidResolver.d.ts +0 -25
  72. package/build/dids/CheqdDidResolver.js +0 -171
  73. package/build/dids/CheqdDidResolver.js.map +0 -1
  74. package/build/dids/didCheqdUtil.d.ts +0 -28
  75. package/build/dids/didCheqdUtil.js +0 -129
  76. package/build/dids/didCheqdUtil.js.map +0 -1
  77. package/build/dids/index.d.ts +0 -2
  78. package/build/dids/index.js +0 -8
  79. package/build/dids/index.js.map +0 -1
  80. package/build/index.d.ts +0 -5
  81. package/build/index.js +0 -17
  82. package/build/index.js.map +0 -1
  83. package/build/ledger/CheqdLedgerService.d.ts +0 -37
  84. package/build/ledger/CheqdLedgerService.js +0 -135
  85. package/build/ledger/CheqdLedgerService.js.map +0 -1
  86. package/build/ledger/index.d.ts +0 -1
  87. package/build/ledger/index.js +0 -6
  88. package/build/ledger/index.js.map +0 -1
@@ -0,0 +1,446 @@
1
+ import { ED25519_SUITE_CONTEXT_URL_2018, ED25519_SUITE_CONTEXT_URL_2020, parseCheqdDid } from "../anoncreds/utils/identifiers.mjs";
2
+ import { createMsgCreateDidDocPayloadToSign, createMsgDeactivateDidDocPayloadToSign, generateDidDoc, validateSpecCompliantPayload } from "./didCheqdUtil.mjs";
3
+ import { CheqdLedgerService } from "../ledger/CheqdLedgerService.mjs";
4
+ import "../ledger/index.mjs";
5
+ import { AgentContext, DID_V1_CONTEXT_URL, DidDocument, DidDocumentRole, DidRecord, DidRepository, JsonTransformer, Kms, SECURITY_JWS_CONTEXT_URL, TypedArrayEncoder, VerificationMethod, getKmsKeyIdForVerifiacationMethod, getPublicJwkFromVerificationMethod, utils } from "@credo-ts/core";
6
+ import { CheqdNetwork, MethodSpecificIdAlgo, VerificationMethods, createDidVerificationMethod } from "@cheqd/sdk";
7
+ import { MsgCreateResourcePayload } from "@cheqd/ts-proto/cheqd/resource/v2/index.js";
8
+
9
+ //#region src/dids/CheqdDidRegistrar.ts
10
+ var CheqdDidRegistrar = class {
11
+ constructor() {
12
+ this.supportedMethods = ["cheqd"];
13
+ this.contextMapping = {
14
+ Ed25519VerificationKey2018: ED25519_SUITE_CONTEXT_URL_2018,
15
+ Ed25519VerificationKey2020: ED25519_SUITE_CONTEXT_URL_2020,
16
+ JsonWebKey2020: SECURITY_JWS_CONTEXT_URL
17
+ };
18
+ }
19
+ collectAllContexts(didDocument) {
20
+ const contextSet = new Set(typeof didDocument.context === "string" ? [didDocument.context] : Array.isArray(didDocument.context) ? didDocument.context : []);
21
+ for (const rel of [
22
+ "authentication",
23
+ "assertionMethod",
24
+ "capabilityInvocation",
25
+ "capabilityDelegation",
26
+ "keyAgreement",
27
+ "verificationMethod"
28
+ ]) {
29
+ const entries = didDocument[rel];
30
+ if (entries) {
31
+ for (const entry of entries) if (typeof entry !== "string" && entry.type) {
32
+ const contextUrl = this.contextMapping[entry.type];
33
+ if (contextUrl) contextSet.add(contextUrl);
34
+ }
35
+ }
36
+ }
37
+ return contextSet;
38
+ }
39
+ async create(agentContext, options) {
40
+ const didRepository = agentContext.dependencyManager.resolve(DidRepository);
41
+ const cheqdLedgerService = agentContext.dependencyManager.resolve(CheqdLedgerService);
42
+ let didDocument;
43
+ const versionId = options.options?.versionId ?? utils.uuid();
44
+ let keys = [];
45
+ try {
46
+ if (options.didDocument) {
47
+ const isSpecCompliantPayload = validateSpecCompliantPayload(options.didDocument);
48
+ if (!isSpecCompliantPayload.valid) return {
49
+ didDocumentMetadata: {},
50
+ didRegistrationMetadata: {},
51
+ didState: {
52
+ state: "failed",
53
+ reason: `Invalid did document provided. ${isSpecCompliantPayload.error}`
54
+ }
55
+ };
56
+ didDocument = options.didDocument;
57
+ const authenticationIds = didDocument.authentication?.map((v) => typeof v === "string" ? v : v.id) ?? [];
58
+ const didDocumentRelativeKeyIds = options.options.keys.map((key) => key.didDocumentRelativeKeyId);
59
+ keys = options.options.keys;
60
+ for (const didDocumentKeyId of didDocumentRelativeKeyIds) didDocument.dereferenceKey(didDocumentKeyId);
61
+ if (!authenticationIds.every((id) => didDocumentRelativeKeyIds.includes(id.replace(didDocument.id, "")))) return {
62
+ didDocumentMetadata: {},
63
+ didRegistrationMetadata: {},
64
+ didState: {
65
+ state: "failed",
66
+ reason: `For all 'authentication' verification methods in the did document a 'key' entry in the options MUST be provided that link the did document key id with the kms key id`
67
+ }
68
+ };
69
+ if (!parseCheqdDid(options.didDocument.id)) return {
70
+ didDocumentMetadata: {},
71
+ didRegistrationMetadata: {},
72
+ didState: {
73
+ state: "failed",
74
+ reason: `Unable to parse cheqd did ${options.didDocument.id}`
75
+ }
76
+ };
77
+ } else if (options.options.createKey || options.options.keyId) {
78
+ const methodSpecificIdAlgo = options.options.methodSpecificIdAlgo;
79
+ const kms = agentContext.dependencyManager.resolve(Kms.KeyManagementApi);
80
+ let publicJwk;
81
+ if (options.options.createKey) {
82
+ const createKeyResult = await kms.createKey(options.options.createKey);
83
+ publicJwk = createKeyResult.publicJwk;
84
+ keys.push({
85
+ kmsKeyId: createKeyResult.keyId,
86
+ didDocumentRelativeKeyId: "#key-1"
87
+ });
88
+ } else {
89
+ const _publicJwk = await kms.getPublicKey({ keyId: options.options.keyId });
90
+ keys.push({
91
+ kmsKeyId: options.options.keyId,
92
+ didDocumentRelativeKeyId: "#key-1"
93
+ });
94
+ if (!_publicJwk) return {
95
+ didDocumentMetadata: {},
96
+ didRegistrationMetadata: {},
97
+ didState: {
98
+ state: "failed",
99
+ reason: `notFound: key with key id '${options.options.keyId}' not found`
100
+ }
101
+ };
102
+ if (_publicJwk.kty !== "OKP" || _publicJwk.crv !== "Ed25519") return {
103
+ didDocumentMetadata: {},
104
+ didRegistrationMetadata: {},
105
+ didState: {
106
+ state: "failed",
107
+ reason: `key with key id '${options.options.keyId}' uses unsupported ${Kms.getJwkHumanDescription(_publicJwk)} for did:cheqd`
108
+ }
109
+ };
110
+ publicJwk = {
111
+ ..._publicJwk,
112
+ crv: _publicJwk.crv
113
+ };
114
+ }
115
+ const verificationMethod = VerificationMethods.JWK;
116
+ const jwk = Kms.PublicJwk.fromPublicJwk(publicJwk);
117
+ didDocument = generateDidDoc({
118
+ verificationMethod,
119
+ verificationMethodId: "key-1",
120
+ methodSpecificIdAlgo: methodSpecificIdAlgo || MethodSpecificIdAlgo.Uuid,
121
+ network: options.options.network,
122
+ publicKey: TypedArrayEncoder.toHex(jwk.publicKey.publicKey)
123
+ });
124
+ } else return {
125
+ didDocumentMetadata: {},
126
+ didRegistrationMetadata: {},
127
+ didState: {
128
+ state: "failed",
129
+ reason: "Provide a didDocument or provide createKey or keyId in options"
130
+ }
131
+ };
132
+ const contextSet = this.collectAllContexts(didDocument);
133
+ didDocument.context = Array.from(contextSet.add(DID_V1_CONTEXT_URL));
134
+ const didDocumentJson = didDocument.toJSON();
135
+ const payloadToSign = await createMsgCreateDidDocPayloadToSign(didDocumentJson, versionId);
136
+ const authentication = didDocument.authentication?.map((authentication$1) => typeof authentication$1 === "string" ? didDocument.dereferenceVerificationMethod(authentication$1) : authentication$1);
137
+ if (!authentication || authentication.length === 0) return {
138
+ didDocumentMetadata: {},
139
+ didRegistrationMetadata: {},
140
+ didState: {
141
+ state: "failed",
142
+ reason: "No keys to sign with in 'authentication' of DID document"
143
+ }
144
+ };
145
+ const signInputs = await this.signPayload(agentContext, payloadToSign, authentication, keys);
146
+ const response = await cheqdLedgerService.create(didDocumentJson, signInputs, versionId);
147
+ if (response.code !== 0) throw new Error(`${response.rawLog}`);
148
+ const didRecord = new DidRecord({
149
+ did: didDocument.id,
150
+ role: DidDocumentRole.Created,
151
+ didDocument,
152
+ keys
153
+ });
154
+ await didRepository.save(agentContext, didRecord);
155
+ return {
156
+ didDocumentMetadata: {},
157
+ didRegistrationMetadata: {},
158
+ didState: {
159
+ state: "finished",
160
+ did: didDocument.id,
161
+ didDocument,
162
+ secret: options.secret
163
+ }
164
+ };
165
+ } catch (error) {
166
+ agentContext.config.logger.error("Error registering DID", error);
167
+ return {
168
+ didDocumentMetadata: {},
169
+ didRegistrationMetadata: {},
170
+ didState: {
171
+ state: "failed",
172
+ reason: `unknownError: ${error.message}`
173
+ }
174
+ };
175
+ }
176
+ }
177
+ async update(agentContext, options) {
178
+ const didRepository = agentContext.dependencyManager.resolve(DidRepository);
179
+ const cheqdLedgerService = agentContext.dependencyManager.resolve(CheqdLedgerService);
180
+ const versionId = options.options?.versionId || utils.uuid();
181
+ let didDocument;
182
+ let didRecord;
183
+ try {
184
+ if (options.didDocument) {
185
+ const isSpecCompliantPayload = validateSpecCompliantPayload(options.didDocument);
186
+ if (!isSpecCompliantPayload.valid) return {
187
+ didDocumentMetadata: {},
188
+ didRegistrationMetadata: {},
189
+ didState: {
190
+ state: "failed",
191
+ reason: `Invalid did document provided. ${isSpecCompliantPayload.error}`
192
+ }
193
+ };
194
+ didDocument = options.didDocument;
195
+ const resolvedDocument = await cheqdLedgerService.resolve(didDocument.id);
196
+ didRecord = await didRepository.findCreatedDid(agentContext, didDocument.id);
197
+ if (!resolvedDocument.didDocument || resolvedDocument.didDocumentMetadata.deactivated || !didRecord) return {
198
+ didDocumentMetadata: {},
199
+ didRegistrationMetadata: {},
200
+ didState: {
201
+ state: "failed",
202
+ reason: "Did not found"
203
+ }
204
+ };
205
+ const keys = didRecord.keys ?? [];
206
+ if (options.options?.createKey || options.options?.keyId) {
207
+ const kms = agentContext.dependencyManager.resolve(Kms.KeyManagementApi);
208
+ let createdKey;
209
+ let publicJwk;
210
+ if (options.options.createKey) {
211
+ const createKeyResult = await kms.createKey(options.options.createKey);
212
+ publicJwk = createKeyResult.publicJwk;
213
+ createdKey = {
214
+ didDocumentRelativeKeyId: `#${utils.uuid()}-1`,
215
+ kmsKeyId: createKeyResult.keyId
216
+ };
217
+ } else if (options.options.keyId) {
218
+ const _publicJwk = await kms.getPublicKey({ keyId: options.options.keyId });
219
+ createdKey = {
220
+ didDocumentRelativeKeyId: `#${utils.uuid()}-1`,
221
+ kmsKeyId: options.options.keyId
222
+ };
223
+ if (!_publicJwk) return {
224
+ didDocumentMetadata: {},
225
+ didRegistrationMetadata: {},
226
+ didState: {
227
+ state: "failed",
228
+ reason: `notFound: key with key id '${options.options.keyId}' not found`
229
+ }
230
+ };
231
+ if (_publicJwk.kty !== "OKP" || _publicJwk.crv !== "Ed25519") return {
232
+ didDocumentMetadata: {},
233
+ didRegistrationMetadata: {},
234
+ didState: {
235
+ state: "failed",
236
+ reason: `key with key id '${options.options.keyId}' uses unsupported ${Kms.getJwkHumanDescription(_publicJwk)} for did:cheqd`
237
+ }
238
+ };
239
+ publicJwk = {
240
+ ..._publicJwk,
241
+ crv: _publicJwk.crv
242
+ };
243
+ } else return {
244
+ didDocumentMetadata: {},
245
+ didRegistrationMetadata: {},
246
+ didState: {
247
+ state: "failed",
248
+ reason: "Expect options.createKey or options.keyId"
249
+ }
250
+ };
251
+ const verificationMethod = VerificationMethods.JWK;
252
+ const jwk = Kms.PublicJwk.fromPublicJwk(publicJwk);
253
+ keys.push(createdKey);
254
+ didDocument.verificationMethod?.concat(JsonTransformer.fromJSON(createDidVerificationMethod([verificationMethod], [{
255
+ methodSpecificId: didDocument.id.split(":")[3],
256
+ didUrl: didDocument.id,
257
+ keyId: `${didDocument.id}${createdKey.didDocumentRelativeKeyId}`,
258
+ publicKey: TypedArrayEncoder.toHex(jwk.publicKey.publicKey)
259
+ }]), VerificationMethod));
260
+ }
261
+ } else return {
262
+ didDocumentMetadata: {},
263
+ didRegistrationMetadata: {},
264
+ didState: {
265
+ state: "failed",
266
+ reason: "Provide a valid didDocument"
267
+ }
268
+ };
269
+ didRecord.keys = didRecord.keys?.filter(({ didDocumentRelativeKeyId }) => {
270
+ try {
271
+ didDocument.dereferenceKey(didDocumentRelativeKeyId);
272
+ return true;
273
+ } catch (_error) {
274
+ return false;
275
+ }
276
+ });
277
+ const payloadToSign = await createMsgCreateDidDocPayloadToSign(didDocument.toJSON(), versionId);
278
+ const authentication = didDocument.authentication?.map((authentication$1) => typeof authentication$1 === "string" ? didDocument.dereferenceVerificationMethod(authentication$1) : authentication$1);
279
+ if (!authentication || authentication.length === 0) return {
280
+ didDocumentMetadata: {},
281
+ didRegistrationMetadata: {},
282
+ didState: {
283
+ state: "failed",
284
+ reason: "No keys to sign with in 'authentication' of DID document"
285
+ }
286
+ };
287
+ const signInputs = await this.signPayload(agentContext, payloadToSign, authentication, didRecord.keys);
288
+ const response = await cheqdLedgerService.update(didDocument.toJSON(), signInputs, versionId);
289
+ if (response.code !== 0) throw new Error(`${response.rawLog}`);
290
+ const contextSet = this.collectAllContexts(options.didDocument || didDocument);
291
+ didDocument.context = Array.from(contextSet.add(DID_V1_CONTEXT_URL));
292
+ didRecord.didDocument = didDocument;
293
+ await didRepository.update(agentContext, didRecord);
294
+ return {
295
+ didDocumentMetadata: {},
296
+ didRegistrationMetadata: {},
297
+ didState: {
298
+ state: "finished",
299
+ did: didDocument.id,
300
+ didDocument,
301
+ secret: options.secret
302
+ }
303
+ };
304
+ } catch (error) {
305
+ agentContext.config.logger.error("Error updating DID", error);
306
+ return {
307
+ didDocumentMetadata: {},
308
+ didRegistrationMetadata: {},
309
+ didState: {
310
+ state: "failed",
311
+ reason: `unknownError: ${error.message}`
312
+ }
313
+ };
314
+ }
315
+ }
316
+ async deactivate(agentContext, options) {
317
+ const didRepository = agentContext.dependencyManager.resolve(DidRepository);
318
+ const cheqdLedgerService = agentContext.dependencyManager.resolve(CheqdLedgerService);
319
+ const did = options.did;
320
+ const versionId = options.options?.versionId || utils.uuid();
321
+ try {
322
+ const { didDocument, didDocumentMetadata } = await cheqdLedgerService.resolve(did);
323
+ const didRecord = await didRepository.findCreatedDid(agentContext, did);
324
+ if (!didDocument || didDocumentMetadata.deactivated || !didRecord) return {
325
+ didDocumentMetadata: {},
326
+ didRegistrationMetadata: {},
327
+ didState: {
328
+ state: "failed",
329
+ reason: "Did not found"
330
+ }
331
+ };
332
+ const payloadToSign = createMsgDeactivateDidDocPayloadToSign(didDocument, versionId);
333
+ const didDocumentInstance = DidDocument.fromJSON(didDocument);
334
+ const authentication = didDocumentInstance.authentication?.map((authentication$1) => typeof authentication$1 === "string" ? didDocumentInstance.dereferenceVerificationMethod(authentication$1) : authentication$1);
335
+ if (!authentication || authentication.length === 0) return {
336
+ didDocumentMetadata: {},
337
+ didRegistrationMetadata: {},
338
+ didState: {
339
+ state: "failed",
340
+ reason: "No keys to sign with in 'authentication' of DID document"
341
+ }
342
+ };
343
+ const signInputs = await this.signPayload(agentContext, payloadToSign, authentication, didRecord.keys);
344
+ const response = await cheqdLedgerService.deactivate(didDocument, signInputs, versionId);
345
+ if (response.code !== 0) throw new Error(`${response.rawLog}`);
346
+ await didRepository.update(agentContext, didRecord);
347
+ return {
348
+ didDocumentMetadata: {},
349
+ didRegistrationMetadata: {},
350
+ didState: {
351
+ state: "finished",
352
+ did: didDocument.id,
353
+ didDocument: JsonTransformer.fromJSON(didRecord.didDocument, DidDocument),
354
+ secret: options.secret
355
+ }
356
+ };
357
+ } catch (error) {
358
+ agentContext.config.logger.error("Error deactivating DID", error);
359
+ return {
360
+ didDocumentMetadata: {},
361
+ didRegistrationMetadata: {},
362
+ didState: {
363
+ state: "failed",
364
+ reason: `unknownError: ${error.message}`
365
+ }
366
+ };
367
+ }
368
+ }
369
+ async createResource(agentContext, did, resource) {
370
+ const didRepository = agentContext.dependencyManager.resolve(DidRepository);
371
+ const cheqdLedgerService = agentContext.dependencyManager.resolve(CheqdLedgerService);
372
+ const { didDocument, didDocumentMetadata } = await cheqdLedgerService.resolve(did);
373
+ const didRecord = await didRepository.findCreatedDid(agentContext, did);
374
+ if (!didDocument || didDocumentMetadata.deactivated || !didRecord) return {
375
+ resourceMetadata: {},
376
+ resourceRegistrationMetadata: {},
377
+ resourceState: {
378
+ state: "failed",
379
+ reason: `DID: ${did} not found`
380
+ }
381
+ };
382
+ try {
383
+ let data;
384
+ if (typeof resource.data === "string") data = TypedArrayEncoder.fromBase64(resource.data);
385
+ else if (typeof resource.data === "object") data = TypedArrayEncoder.fromString(JSON.stringify(resource.data));
386
+ else data = resource.data;
387
+ const resourcePayload = MsgCreateResourcePayload.fromPartial({
388
+ collectionId: did.split(":")[3],
389
+ id: resource.id,
390
+ resourceType: resource.resourceType,
391
+ name: resource.name,
392
+ version: resource.version,
393
+ alsoKnownAs: resource.alsoKnownAs,
394
+ data
395
+ });
396
+ const payloadToSign = MsgCreateResourcePayload.encode(resourcePayload).finish();
397
+ const didDocumentInstance = JsonTransformer.fromJSON(didDocument, DidDocument);
398
+ const signInputs = await this.signPayload(agentContext, payloadToSign, didDocumentInstance.verificationMethod, didRecord.keys);
399
+ const response = await cheqdLedgerService.createResource(did, resourcePayload, signInputs);
400
+ if (response.code !== 0) throw new Error(`${response.rawLog}`);
401
+ return {
402
+ resourceMetadata: {},
403
+ resourceRegistrationMetadata: {},
404
+ resourceState: {
405
+ state: "finished",
406
+ resourceId: resourcePayload.id,
407
+ resource: resourcePayload
408
+ }
409
+ };
410
+ } catch (error) {
411
+ return {
412
+ resourceMetadata: {},
413
+ resourceRegistrationMetadata: {},
414
+ resourceState: {
415
+ state: "failed",
416
+ reason: `unknownError: ${error.message}`
417
+ }
418
+ };
419
+ }
420
+ }
421
+ async signPayload(agentContext, payload, verificationMethod = [], keys) {
422
+ const kms = agentContext.dependencyManager.resolve(Kms.KeyManagementApi);
423
+ return await Promise.all(verificationMethod.map(async (method) => {
424
+ const publicJwk = getPublicJwkFromVerificationMethod(method);
425
+ const kmsKeyId = getKmsKeyIdForVerifiacationMethod(method, keys) ?? publicJwk.legacyKeyId;
426
+ const { signature } = await kms.sign({
427
+ data: payload,
428
+ algorithm: publicJwk.signatureAlgorithm,
429
+ keyId: kmsKeyId
430
+ });
431
+ const jwk = publicJwk.toJson();
432
+ if (jwk.kty === "EC") return {
433
+ verificationMethodId: method.id,
434
+ signature: Kms.rawEcSignatureToDer(signature, jwk.crv)
435
+ };
436
+ return {
437
+ verificationMethodId: method.id,
438
+ signature
439
+ };
440
+ }));
441
+ }
442
+ };
443
+
444
+ //#endregion
445
+ export { CheqdDidRegistrar };
446
+ //# sourceMappingURL=CheqdDidRegistrar.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheqdDidRegistrar.mjs","names":["didDocument: DidDocument","keys: DidDocumentKey[]","publicJwk: Kms.KmsJwkPublicOkp & { crv: 'Ed25519' }","authentication","didRecord: DidRecord | null","createdKey: DidDocumentKey","data: Uint8ArrayBuffer"],"sources":["../../src/dids/CheqdDidRegistrar.ts"],"sourcesContent":["import {\n CheqdNetwork,\n createDidVerificationMethod,\n type DIDDocument,\n type DidStdFee,\n MethodSpecificIdAlgo,\n VerificationMethods,\n} from '@cheqd/sdk'\nimport type { SignInfo } from '@cheqd/ts-proto/cheqd/did/v2'\nimport { MsgCreateResourcePayload } from '@cheqd/ts-proto/cheqd/resource/v2/index.js'\nimport {\n AgentContext,\n type AnyUint8Array,\n DID_V1_CONTEXT_URL,\n type DidCreateOptions,\n type DidCreateResult,\n type DidDeactivateResult,\n DidDocument,\n type DidDocumentKey,\n DidDocumentRole,\n DidRecord,\n type DidRegistrar,\n DidRepository,\n type DidUpdateOptions,\n type DidUpdateResult,\n getKmsKeyIdForVerifiacationMethod,\n getPublicJwkFromVerificationMethod,\n JsonTransformer,\n Kms,\n SECURITY_JWS_CONTEXT_URL,\n TypedArrayEncoder,\n type Uint8ArrayBuffer,\n utils,\n VerificationMethod,\n type XOR,\n} from '@credo-ts/core'\n\nimport {\n ED25519_SUITE_CONTEXT_URL_2018,\n ED25519_SUITE_CONTEXT_URL_2020,\n parseCheqdDid,\n} from '../anoncreds/utils/identifiers'\nimport { CheqdLedgerService } from '../ledger'\n\nimport {\n createMsgCreateDidDocPayloadToSign,\n createMsgDeactivateDidDocPayloadToSign,\n generateDidDoc,\n validateSpecCompliantPayload,\n} from './didCheqdUtil'\n\nexport class CheqdDidRegistrar implements DidRegistrar {\n public readonly supportedMethods = ['cheqd']\n private contextMapping = {\n Ed25519VerificationKey2018: ED25519_SUITE_CONTEXT_URL_2018,\n Ed25519VerificationKey2020: ED25519_SUITE_CONTEXT_URL_2020,\n JsonWebKey2020: SECURITY_JWS_CONTEXT_URL,\n }\n\n private collectAllContexts(didDocument: DidDocument): Set<string> {\n const contextSet = new Set<string>(\n typeof didDocument.context === 'string'\n ? [didDocument.context]\n : Array.isArray(didDocument.context)\n ? didDocument.context\n : []\n )\n // List of verification relationships to check for embedded verification methods\n // Note: these are the relationships defined in the DID Core spec\n const relationships = [\n 'authentication',\n 'assertionMethod',\n 'capabilityInvocation',\n 'capabilityDelegation',\n 'keyAgreement',\n 'verificationMethod',\n ] as const\n // Collect verification methods from relationships\n for (const rel of relationships) {\n const entries = didDocument[rel]\n if (entries) {\n for (const entry of entries) {\n if (typeof entry !== 'string' && entry.type) {\n const contextUrl = this.contextMapping[entry.type as keyof typeof this.contextMapping]\n if (contextUrl) {\n contextSet.add(contextUrl)\n }\n }\n }\n }\n }\n return contextSet\n }\n\n public async create(agentContext: AgentContext, options: CheqdDidCreateOptions): Promise<DidCreateResult> {\n const didRepository = agentContext.dependencyManager.resolve(DidRepository)\n const cheqdLedgerService = agentContext.dependencyManager.resolve(CheqdLedgerService)\n\n let didDocument: DidDocument\n const versionId = options.options?.versionId ?? utils.uuid()\n\n let keys: DidDocumentKey[] = []\n\n try {\n if (options.didDocument) {\n const isSpecCompliantPayload = validateSpecCompliantPayload(options.didDocument)\n if (!isSpecCompliantPayload.valid) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `Invalid did document provided. ${isSpecCompliantPayload.error}`,\n },\n }\n }\n\n didDocument = options.didDocument\n const authenticationIds = didDocument.authentication?.map((v) => (typeof v === 'string' ? v : v.id)) ?? []\n const didDocumentRelativeKeyIds = options.options.keys.map((key) => key.didDocumentRelativeKeyId)\n keys = options.options.keys\n\n // Ensure all keys are present in the did document\n for (const didDocumentKeyId of didDocumentRelativeKeyIds) {\n didDocument.dereferenceKey(didDocumentKeyId)\n }\n\n if (!authenticationIds.every((id) => didDocumentRelativeKeyIds.includes(id.replace(didDocument.id, '')))) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `For all 'authentication' verification methods in the did document a 'key' entry in the options MUST be provided that link the did document key id with the kms key id`,\n },\n }\n }\n\n const cheqdDid = parseCheqdDid(options.didDocument.id)\n\n if (!cheqdDid) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `Unable to parse cheqd did ${options.didDocument.id}`,\n },\n }\n }\n } else if (options.options.createKey || options.options.keyId) {\n const methodSpecificIdAlgo = options.options.methodSpecificIdAlgo\n const kms = agentContext.dependencyManager.resolve(Kms.KeyManagementApi)\n\n let publicJwk: Kms.KmsJwkPublicOkp & { crv: 'Ed25519' }\n if (options.options.createKey) {\n const createKeyResult = await kms.createKey(options.options.createKey)\n publicJwk = createKeyResult.publicJwk\n keys.push({\n kmsKeyId: createKeyResult.keyId,\n didDocumentRelativeKeyId: '#key-1',\n })\n } else {\n const _publicJwk = await kms.getPublicKey({\n keyId: options.options.keyId,\n })\n keys.push({\n kmsKeyId: options.options.keyId,\n didDocumentRelativeKeyId: '#key-1',\n })\n if (!_publicJwk) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `notFound: key with key id '${options.options.keyId}' not found`,\n },\n }\n }\n\n if (_publicJwk.kty !== 'OKP' || _publicJwk.crv !== 'Ed25519') {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `key with key id '${options.options.keyId}' uses unsupported ${Kms.getJwkHumanDescription(\n _publicJwk\n )} for did:cheqd`,\n },\n }\n }\n\n publicJwk = {\n ..._publicJwk,\n crv: _publicJwk.crv,\n }\n }\n\n // TODO: make this configureable\n const verificationMethod = VerificationMethods.JWK\n const jwk = Kms.PublicJwk.fromPublicJwk(publicJwk)\n\n didDocument = generateDidDoc({\n verificationMethod,\n verificationMethodId: 'key-1',\n methodSpecificIdAlgo: (methodSpecificIdAlgo as MethodSpecificIdAlgo) || MethodSpecificIdAlgo.Uuid,\n network: options.options.network as CheqdNetwork,\n publicKey: TypedArrayEncoder.toHex(jwk.publicKey.publicKey),\n })\n } else {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'Provide a didDocument or provide createKey or keyId in options',\n },\n }\n }\n\n // Collect all contexts from the didDic into a set\n const contextSet = this.collectAllContexts(didDocument)\n // Add Cheqd default context to the did document\n didDocument.context = Array.from(contextSet.add(DID_V1_CONTEXT_URL))\n\n const didDocumentJson = didDocument.toJSON() as DIDDocument\n const payloadToSign = await createMsgCreateDidDocPayloadToSign(didDocumentJson, versionId)\n\n const authentication = didDocument.authentication?.map((authentication) =>\n typeof authentication === 'string' ? didDocument.dereferenceVerificationMethod(authentication) : authentication\n )\n if (!authentication || authentication.length === 0) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: \"No keys to sign with in 'authentication' of DID document\",\n },\n }\n }\n\n const signInputs = await this.signPayload(agentContext, payloadToSign, authentication, keys)\n\n const response = await cheqdLedgerService.create(didDocumentJson, signInputs, versionId)\n if (response.code !== 0) {\n throw new Error(`${response.rawLog}`)\n }\n\n // Save the did so we know we created it and can issue with it\n const didRecord = new DidRecord({\n did: didDocument.id,\n role: DidDocumentRole.Created,\n didDocument,\n keys,\n })\n await didRepository.save(agentContext, didRecord)\n\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'finished',\n did: didDocument.id,\n didDocument,\n secret: options.secret,\n },\n }\n } catch (error) {\n agentContext.config.logger.error('Error registering DID', error)\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `unknownError: ${error.message}`,\n },\n }\n }\n }\n\n public async update(agentContext: AgentContext, options: CheqdDidUpdateOptions): Promise<DidUpdateResult> {\n const didRepository = agentContext.dependencyManager.resolve(DidRepository)\n const cheqdLedgerService = agentContext.dependencyManager.resolve(CheqdLedgerService)\n\n const versionId = options.options?.versionId || utils.uuid()\n let didDocument: DidDocument\n let didRecord: DidRecord | null\n\n try {\n if (options.didDocument) {\n const isSpecCompliantPayload = validateSpecCompliantPayload(options.didDocument)\n if (!isSpecCompliantPayload.valid) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `Invalid did document provided. ${isSpecCompliantPayload.error}`,\n },\n }\n }\n\n didDocument = options.didDocument\n const resolvedDocument = await cheqdLedgerService.resolve(didDocument.id)\n didRecord = await didRepository.findCreatedDid(agentContext, didDocument.id)\n if (!resolvedDocument.didDocument || resolvedDocument.didDocumentMetadata.deactivated || !didRecord) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'Did not found',\n },\n }\n }\n\n const keys = didRecord.keys ?? []\n if (options.options?.createKey || options.options?.keyId) {\n const kms = agentContext.dependencyManager.resolve(Kms.KeyManagementApi)\n let createdKey: DidDocumentKey\n\n let publicJwk: Kms.KmsJwkPublicOkp & { crv: 'Ed25519' }\n if (options.options.createKey) {\n const createKeyResult = await kms.createKey(options.options.createKey)\n publicJwk = createKeyResult.publicJwk\n\n createdKey = {\n didDocumentRelativeKeyId: `#${utils.uuid()}-1`,\n kmsKeyId: createKeyResult.keyId,\n }\n } else if (options.options.keyId) {\n const _publicJwk = await kms.getPublicKey({\n keyId: options.options.keyId,\n })\n createdKey = {\n didDocumentRelativeKeyId: `#${utils.uuid()}-1`,\n kmsKeyId: options.options.keyId,\n }\n if (!_publicJwk) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `notFound: key with key id '${options.options.keyId}' not found`,\n },\n }\n }\n\n if (_publicJwk.kty !== 'OKP' || _publicJwk.crv !== 'Ed25519') {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `key with key id '${options.options.keyId}' uses unsupported ${Kms.getJwkHumanDescription(\n _publicJwk\n )} for did:cheqd`,\n },\n }\n }\n\n publicJwk = {\n ..._publicJwk,\n crv: _publicJwk.crv,\n }\n } else {\n // This will never happen, but to make TS happy\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'Expect options.createKey or options.keyId',\n },\n }\n }\n\n // TODO: make this configureable\n const verificationMethod = VerificationMethods.JWK\n const jwk = Kms.PublicJwk.fromPublicJwk(publicJwk)\n\n keys.push(createdKey)\n didDocument.verificationMethod?.concat(\n JsonTransformer.fromJSON(\n createDidVerificationMethod(\n [verificationMethod],\n [\n {\n methodSpecificId: didDocument.id.split(':')[3],\n didUrl: didDocument.id,\n keyId: `${didDocument.id}${createdKey.didDocumentRelativeKeyId}` as `${string}#${string}-${number}`,\n publicKey: TypedArrayEncoder.toHex(jwk.publicKey.publicKey),\n },\n ]\n ),\n VerificationMethod\n )\n )\n }\n } else {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'Provide a valid didDocument',\n },\n }\n }\n\n // Filter out all keys that are not present in the did document anymore\n didRecord.keys = didRecord.keys?.filter(({ didDocumentRelativeKeyId }) => {\n try {\n didDocument.dereferenceKey(didDocumentRelativeKeyId)\n return true\n } catch (_error) {\n return false\n }\n })\n\n // TODO: we don't know which keys are managed by Credo. Should we\n // create a keys array for all keys within the did document set to the legacy key id\n // TODO: we need some sort of migration plan, otherwise we will have to support\n // legacy key ids forever\n // const authenticationIds = didDocument.authentication?.map(a => typeof a === 'string' ? a : a.id) ?? []\n // const didDocumentKeyIds = didRecord.keys?.map(({didDocumentRelativeKeyId}) => didDocumentRelativeKeyId)\n // if (!authenticationIds.every((id) => didDocumentKeyIds?.includes(id))) {\n // return {\n // didDocumentMetadata: {},\n // didRegistrationMetadata: {},\n // didState: {\n // state: \"failed\",\n // reason: `For all 'authentication' verification methods in the did document a 'key' entry in the options MUST be provided that link the did document key id with the kms key id`,\n // },\n // };\n // }\n\n const payloadToSign = await createMsgCreateDidDocPayloadToSign(didDocument.toJSON() as DIDDocument, versionId)\n\n const authentication = didDocument.authentication?.map((authentication) =>\n typeof authentication === 'string' ? didDocument.dereferenceVerificationMethod(authentication) : authentication\n )\n if (!authentication || authentication.length === 0) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: \"No keys to sign with in 'authentication' of DID document\",\n },\n }\n }\n const signInputs = await this.signPayload(\n agentContext,\n payloadToSign,\n // TOOD: we should also sign with the authentication entries that are removed (so we should diff)\n authentication,\n didRecord.keys\n )\n\n const response = await cheqdLedgerService.update(didDocument.toJSON() as DIDDocument, signInputs, versionId)\n if (response.code !== 0) {\n throw new Error(`${response.rawLog}`)\n }\n // Collect all contexts, override existing context if provided\n const contextSet = this.collectAllContexts(options.didDocument || didDocument)\n // Add Cheqd default context to the did document\n didDocument.context = Array.from(contextSet.add(DID_V1_CONTEXT_URL))\n // Save the did so we know we created it and can issue with it\n didRecord.didDocument = didDocument\n await didRepository.update(agentContext, didRecord)\n\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'finished',\n did: didDocument.id,\n didDocument,\n secret: options.secret,\n },\n }\n } catch (error) {\n agentContext.config.logger.error('Error updating DID', error)\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `unknownError: ${error.message}`,\n },\n }\n }\n }\n\n public async deactivate(\n agentContext: AgentContext,\n options: CheqdDidDeactivateOptions\n ): Promise<DidDeactivateResult> {\n const didRepository = agentContext.dependencyManager.resolve(DidRepository)\n const cheqdLedgerService = agentContext.dependencyManager.resolve(CheqdLedgerService)\n\n const did = options.did\n const versionId = options.options?.versionId || utils.uuid()\n\n try {\n const { didDocument, didDocumentMetadata } = await cheqdLedgerService.resolve(did)\n\n const didRecord = await didRepository.findCreatedDid(agentContext, did)\n if (!didDocument || didDocumentMetadata.deactivated || !didRecord) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: 'Did not found',\n },\n }\n }\n const payloadToSign = createMsgDeactivateDidDocPayloadToSign(didDocument, versionId)\n const didDocumentInstance = DidDocument.fromJSON(didDocument)\n\n const authentication = didDocumentInstance.authentication?.map((authentication) =>\n typeof authentication === 'string'\n ? didDocumentInstance.dereferenceVerificationMethod(authentication)\n : authentication\n )\n if (!authentication || authentication.length === 0) {\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: \"No keys to sign with in 'authentication' of DID document\",\n },\n }\n }\n const signInputs = await this.signPayload(agentContext, payloadToSign, authentication, didRecord.keys)\n const response = await cheqdLedgerService.deactivate(didDocument, signInputs, versionId)\n if (response.code !== 0) {\n throw new Error(`${response.rawLog}`)\n }\n\n await didRepository.update(agentContext, didRecord)\n\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'finished',\n did: didDocument.id,\n didDocument: JsonTransformer.fromJSON(didRecord.didDocument, DidDocument),\n secret: options.secret,\n },\n }\n } catch (error) {\n agentContext.config.logger.error('Error deactivating DID', error)\n return {\n didDocumentMetadata: {},\n didRegistrationMetadata: {},\n didState: {\n state: 'failed',\n reason: `unknownError: ${error.message}`,\n },\n }\n }\n }\n\n public async createResource(agentContext: AgentContext, did: string, resource: CheqdCreateResourceOptions) {\n const didRepository = agentContext.dependencyManager.resolve(DidRepository)\n const cheqdLedgerService = agentContext.dependencyManager.resolve(CheqdLedgerService)\n const { didDocument, didDocumentMetadata } = await cheqdLedgerService.resolve(did)\n const didRecord = await didRepository.findCreatedDid(agentContext, did)\n if (!didDocument || didDocumentMetadata.deactivated || !didRecord) {\n return {\n resourceMetadata: {},\n resourceRegistrationMetadata: {},\n resourceState: {\n state: 'failed',\n reason: `DID: ${did} not found`,\n },\n }\n }\n\n try {\n let data: Uint8ArrayBuffer\n if (typeof resource.data === 'string') {\n data = TypedArrayEncoder.fromBase64(resource.data)\n } else if (typeof resource.data === 'object') {\n data = TypedArrayEncoder.fromString(JSON.stringify(resource.data))\n } else {\n data = resource.data\n }\n\n const resourcePayload = MsgCreateResourcePayload.fromPartial({\n collectionId: did.split(':')[3],\n id: resource.id,\n resourceType: resource.resourceType,\n name: resource.name,\n version: resource.version,\n alsoKnownAs: resource.alsoKnownAs,\n data,\n })\n const payloadToSign = MsgCreateResourcePayload.encode(resourcePayload).finish()\n\n const didDocumentInstance = JsonTransformer.fromJSON(didDocument, DidDocument)\n const signInputs = await this.signPayload(\n agentContext,\n payloadToSign,\n didDocumentInstance.verificationMethod,\n didRecord.keys\n )\n const response = await cheqdLedgerService.createResource(did, resourcePayload, signInputs)\n if (response.code !== 0) {\n throw new Error(`${response.rawLog}`)\n }\n\n return {\n resourceMetadata: {},\n resourceRegistrationMetadata: {},\n resourceState: {\n state: 'finished',\n resourceId: resourcePayload.id,\n resource: resourcePayload,\n },\n }\n } catch (error) {\n return {\n resourceMetadata: {},\n resourceRegistrationMetadata: {},\n resourceState: {\n state: 'failed',\n reason: `unknownError: ${error.message}`,\n },\n }\n }\n }\n\n private async signPayload(\n agentContext: AgentContext,\n payload: AnyUint8Array,\n verificationMethod: VerificationMethod[] = [],\n keys?: DidDocumentKey[]\n ) {\n const kms = agentContext.dependencyManager.resolve(Kms.KeyManagementApi)\n return await Promise.all(\n verificationMethod.map(async (method) => {\n const publicJwk = getPublicJwkFromVerificationMethod(method)\n const kmsKeyId = getKmsKeyIdForVerifiacationMethod(method, keys) ?? publicJwk.legacyKeyId\n\n const { signature } = await kms.sign({\n data: payload,\n algorithm: publicJwk.signatureAlgorithm,\n keyId: kmsKeyId,\n })\n\n // EC signatures need to be sent as DER encoded for Cheqd\n const jwk = publicJwk.toJson()\n if (jwk.kty === 'EC') {\n return {\n verificationMethodId: method.id,\n signature: Kms.rawEcSignatureToDer(signature, jwk.crv),\n }\n }\n\n return {\n verificationMethodId: method.id,\n signature,\n } satisfies SignInfo\n })\n )\n }\n}\n\ntype KmsCreateKeyOptionsOkpEd25519 = Kms.KmsCreateKeyOptions<Kms.KmsCreateKeyTypeOkp & { crv: 'Ed25519' }>\n\nexport interface CheqdDidCreateWithoutDidDocumentOptions extends DidCreateOptions {\n method: 'cheqd'\n did?: never\n didDocument?: never\n secret?: never\n\n options: {\n network: `${CheqdNetwork}`\n fee?: DidStdFee\n versionId?: string\n methodSpecificIdAlgo?: `${MethodSpecificIdAlgo}`\n } & XOR<{ createKey: KmsCreateKeyOptionsOkpEd25519 }, { keyId: string }>\n}\n\nexport interface CheqdDidCreateFromDidDocumentOptions extends DidCreateOptions {\n method: 'cheqd'\n did?: undefined\n didDocument: DidDocument\n options: {\n /**\n * The linking between the did document keys and the kms keys. For cheqd dids ALL authentication entries MUST sign the request\n * and thus it is required to a mapping for all keys.\n */\n keys: DidDocumentKey[]\n fee?: DidStdFee\n versionId?: string\n }\n}\n\nexport type CheqdDidCreateOptions = CheqdDidCreateFromDidDocumentOptions | CheqdDidCreateWithoutDidDocumentOptions\n\nexport interface CheqdDidUpdateOptions extends DidUpdateOptions {\n did: string\n didDocument: DidDocument\n secret?: never\n\n options?: {\n /**\n * The linking between the did document keys and the kms keys. The existing keys will be filtered based on the keys not present\n * in the did document anymore, and this new list will be merged into it.\n */\n keys?: DidDocumentKey[]\n\n fee?: DidStdFee\n versionId?: string\n } & XOR<{ createKey?: KmsCreateKeyOptionsOkpEd25519 }, { keyId?: string }>\n}\n\nexport interface CheqdDidDeactivateOptions extends DidCreateOptions {\n method: 'cheqd'\n did: string\n options: {\n fee?: DidStdFee\n versionId?: string\n }\n}\n\nexport interface CheqdCreateResourceOptions extends Pick<MsgCreateResourcePayload, 'id' | 'name' | 'resourceType'> {\n data: string | Uint8Array | object\n collectionId?: MsgCreateResourcePayload['collectionId']\n version?: MsgCreateResourcePayload['version']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A8B,EAAE;IAChC,eAAe;KACb,OAAO;KACP,QAAQ,iBAAiB,MAAM;KAChC;IACF;;;CAIL,MAAc,YACZ,cACA,SACA,qBAA2C,EAAE,EAC7C,MACA;EACA,MAAM,MAAM,aAAa,kBAAkB,QAAQ,IAAI,iBAAiB;AACxE,SAAO,MAAM,QAAQ,IACnB,mBAAmB,IAAI,OAAO,WAAW;GACvC,MAAM,YAAY,mCAAmC,OAAO;GAC5D,MAAM,WAAW,kCAAkC,QAAQ,KAAK,IAAI,UAAU;GAE9E,MAAM,EAAE,cAAc,MAAM,IAAI,KAAK;IACnC,MAAM;IACN,WAAW,UAAU;IACrB,OAAO;IACR,CAAC;GAGF,MAAM,MAAM,UAAU,QAAQ;AAC9B,OAAI,IAAI,QAAQ,KACd,QAAO;IACL,sBAAsB,OAAO;IAC7B,WAAW,IAAI,oBAAoB,WAAW,IAAI,IAAI;IACvD;AAGH,UAAO;IACL,sBAAsB,OAAO;IAC7B;IACD;IACD,CACH"}
@@ -0,0 +1,30 @@
1
+ import { AgentContext, DidResolutionResult, DidResolver, ParsedDid } from "@credo-ts/core";
2
+ import { Metadata } from "@cheqd/ts-proto/cheqd/resource/v2";
3
+
4
+ //#region src/dids/CheqdDidResolver.d.ts
5
+ declare class CheqdDidResolver implements DidResolver {
6
+ readonly supportedMethods: string[];
7
+ readonly allowsCaching = true;
8
+ readonly allowsLocalDidRecord = true;
9
+ resolve(agentContext: AgentContext, did: string, parsed: ParsedDid): Promise<DidResolutionResult>;
10
+ resolveResource(agentContext: AgentContext, did: string): Promise<{
11
+ error: string;
12
+ message: string;
13
+ resource?: undefined;
14
+ resourceMetadata?: undefined;
15
+ resourceResolutionMetadata?: undefined;
16
+ } | {
17
+ resource: any;
18
+ resourceMetadata: Metadata;
19
+ resourceResolutionMetadata: {};
20
+ error?: undefined;
21
+ message?: undefined;
22
+ }>;
23
+ private resolveAllDidDocVersions;
24
+ private dereferenceCollectionResources;
25
+ private dereferenceResourceMetadata;
26
+ private resolveDidDoc;
27
+ }
28
+ //#endregion
29
+ export { CheqdDidResolver };
30
+ //# sourceMappingURL=CheqdDidResolver.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheqdDidResolver.d.mts","names":[],"sources":["../../src/dids/CheqdDidResolver.ts"],"sourcesContent":[],"mappings":";;;;cAkBa,gBAAA,YAA4B;;EAA5B,SAAA,aAAiB,GAAA,IAAA;EAKO,SAAA,oBAAA,GAAA,IAAA;EAAmC,OAAA,CAAA,YAAA,EAAnC,YAAmC,EAAA,GAAA,EAAA,MAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EAAY,OAAZ,CAAoB,mBAApB,CAAA;EAAoB,eAAA,CAAA,YAAA,EA4C/C,YA5C+C,EAAA,GAAA,EAAA,MAAA,CAAA,EA4CtB,OA5CsB,CAAA;IAAR,KAAA,EAAA,MAAA;IA4CvC,OAAA,EAAA,MAAA;;IAAyB,gBAAA,CAAA,EAAA,SAAA;IAjD7B,0BAAA,CAAA,EAAA,SAAA;EAAW,CAAA,GAAA"}