@hyperledger/anoncreds-shared 0.5.0-alpha-20261027094647 → 0.5.0-alpha-20261027201040

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 (92) hide show
  1. package/README.md +0 -17
  2. package/build/index.d.mts +613 -0
  3. package/build/index.mjs +665 -0
  4. package/build/index.mjs.map +1 -0
  5. package/package.json +15 -6
  6. package/build/Anoncreds.d.ts +0 -272
  7. package/build/Anoncreds.js +0 -5
  8. package/build/Anoncreds.js.map +0 -1
  9. package/build/AnoncredsObject.d.ts +0 -7
  10. package/build/AnoncredsObject.js +0 -15
  11. package/build/AnoncredsObject.js.map +0 -1
  12. package/build/ObjectHandle.d.ts +0 -7
  13. package/build/ObjectHandle.js +0 -21
  14. package/build/ObjectHandle.js.map +0 -1
  15. package/build/api/Credential.d.ts +0 -46
  16. package/build/api/Credential.js +0 -113
  17. package/build/api/Credential.js.map +0 -1
  18. package/build/api/CredentialDefinition.d.ts +0 -21
  19. package/build/api/CredentialDefinition.js +0 -45
  20. package/build/api/CredentialDefinition.js.map +0 -1
  21. package/build/api/CredentialDefinitionPrivate.d.ts +0 -5
  22. package/build/api/CredentialDefinitionPrivate.js +0 -12
  23. package/build/api/CredentialDefinitionPrivate.js.map +0 -1
  24. package/build/api/CredentialOffer.d.ts +0 -12
  25. package/build/api/CredentialOffer.js +0 -35
  26. package/build/api/CredentialOffer.js.map +0 -1
  27. package/build/api/CredentialRequest.d.ts +0 -20
  28. package/build/api/CredentialRequest.js +0 -46
  29. package/build/api/CredentialRequest.js.map +0 -1
  30. package/build/api/CredentialRequestMetadata.d.ts +0 -5
  31. package/build/api/CredentialRequestMetadata.js +0 -12
  32. package/build/api/CredentialRequestMetadata.js.map +0 -1
  33. package/build/api/CredentialRevocationConfig.d.ts +0 -19
  34. package/build/api/CredentialRevocationConfig.js +0 -25
  35. package/build/api/CredentialRevocationConfig.js.map +0 -1
  36. package/build/api/CredentialRevocationState.d.ts +0 -18
  37. package/build/api/CredentialRevocationState.js +0 -52
  38. package/build/api/CredentialRevocationState.js.map +0 -1
  39. package/build/api/KeyCorrectnessProof.d.ts +0 -5
  40. package/build/api/KeyCorrectnessProof.js +0 -12
  41. package/build/api/KeyCorrectnessProof.js.map +0 -1
  42. package/build/api/LinkSecret.d.ts +0 -3
  43. package/build/api/LinkSecret.js +0 -11
  44. package/build/api/LinkSecret.js.map +0 -1
  45. package/build/api/Nonce.d.ts +0 -3
  46. package/build/api/Nonce.js +0 -11
  47. package/build/api/Nonce.js.map +0 -1
  48. package/build/api/Presentation.d.ts +0 -53
  49. package/build/api/Presentation.js +0 -109
  50. package/build/api/Presentation.js.map +0 -1
  51. package/build/api/PresentationRequest.d.ts +0 -5
  52. package/build/api/PresentationRequest.js +0 -12
  53. package/build/api/PresentationRequest.js.map +0 -1
  54. package/build/api/RevocationRegistry.d.ts +0 -12
  55. package/build/api/RevocationRegistry.js +0 -12
  56. package/build/api/RevocationRegistry.js.map +0 -1
  57. package/build/api/RevocationRegistryDefinition.d.ts +0 -24
  58. package/build/api/RevocationRegistryDefinition.js +0 -56
  59. package/build/api/RevocationRegistryDefinition.js.map +0 -1
  60. package/build/api/RevocationRegistryDefinitionPrivate.d.ts +0 -5
  61. package/build/api/RevocationRegistryDefinitionPrivate.js +0 -12
  62. package/build/api/RevocationRegistryDefinitionPrivate.js.map +0 -1
  63. package/build/api/RevocationStatusList.d.ts +0 -31
  64. package/build/api/RevocationStatusList.js +0 -70
  65. package/build/api/RevocationStatusList.js.map +0 -1
  66. package/build/api/Schema.d.ts +0 -12
  67. package/build/api/Schema.js +0 -15
  68. package/build/api/Schema.js.map +0 -1
  69. package/build/api/W3cCredential.d.ts +0 -47
  70. package/build/api/W3cCredential.js +0 -136
  71. package/build/api/W3cCredential.js.map +0 -1
  72. package/build/api/W3cPresentation.d.ts +0 -36
  73. package/build/api/W3cPresentation.js +0 -108
  74. package/build/api/W3cPresentation.js.map +0 -1
  75. package/build/api/index.d.ts +0 -20
  76. package/build/api/index.js +0 -37
  77. package/build/api/index.js.map +0 -1
  78. package/build/api/utils.d.ts +0 -1
  79. package/build/api/utils.js +0 -6
  80. package/build/api/utils.js.map +0 -1
  81. package/build/error.d.ts +0 -14
  82. package/build/error.js +0 -22
  83. package/build/error.js.map +0 -1
  84. package/build/index.d.ts +0 -7
  85. package/build/index.js +0 -24
  86. package/build/index.js.map +0 -1
  87. package/build/register.d.ts +0 -16
  88. package/build/register.js +0 -41
  89. package/build/register.js.map +0 -1
  90. package/build/types.d.ts +0 -12
  91. package/build/types.js +0 -14
  92. package/build/types.js.map +0 -1
package/README.md CHANGED
@@ -43,20 +43,3 @@ import '@hyperledger/anoncreds-nodejs'
43
43
  // register.native.ts
44
44
  import '@hyperledger/anoncreds-react-native'
45
45
  ```
46
-
47
- An alterative approach is to first try to require the Node.JS package, and otherwise require the React Native package:
48
-
49
- ```typescript
50
- try {
51
- require('@hyperledger/anoncreds-nodejs')
52
- } catch (error) {
53
- try {
54
- require('@hyperledger/anoncreds-react-native')
55
- } catch (error) {
56
- throw new Error('Could not load anoncreds bindings')
57
- }
58
- }
59
- ```
60
-
61
- How you approach it is up to you, as long as the native binding are called
62
- before any actions are performed on the anoncreds library.
@@ -0,0 +1,613 @@
1
+ export type AnoncredsErrorObject = {
2
+ code: number;
3
+ extra?: string;
4
+ message: string;
5
+ };
6
+ export declare class AnoncredsError extends Error {
7
+ readonly code: number;
8
+ readonly extra?: string;
9
+ constructor({ code, message, extra }: AnoncredsErrorObject);
10
+ static customError({ message }: {
11
+ message: string;
12
+ }): AnoncredsError;
13
+ }
14
+ export declare function handleInvalidNullResponse<T>(response: T): Exclude<T, null>;
15
+ export declare class ObjectHandle {
16
+ private readonly _handle;
17
+ constructor(handle: number);
18
+ get handle(): number;
19
+ typeName(): string;
20
+ clear(): void;
21
+ }
22
+ export type NativeCredentialEntry = {
23
+ credential: ObjectHandle;
24
+ timestamp?: number;
25
+ revocationState?: ObjectHandle;
26
+ };
27
+ export type NativeCredentialProve = {
28
+ entryIndex: number;
29
+ referent: string;
30
+ isPredicate: boolean;
31
+ reveal: boolean;
32
+ };
33
+ export type NativeNonRevokedIntervalOverride = {
34
+ revocationRegistryDefinitionId: string;
35
+ requestedFromTimestamp: number;
36
+ overrideRevocationStatusListTimestamp: number;
37
+ };
38
+ export type NativeRevocationEntry = {
39
+ revocationRegistryDefinitionEntryIndex: number;
40
+ entry: ObjectHandle;
41
+ timestamp: number;
42
+ };
43
+ export type NativeCredentialRevocationConfig = {
44
+ revocationRegistryDefinition: ObjectHandle;
45
+ revocationRegistryDefinitionPrivate: ObjectHandle;
46
+ revocationStatusList: ObjectHandle;
47
+ registryIndex: number;
48
+ };
49
+ export type Anoncreds = {
50
+ version(): string;
51
+ getCurrentError(): AnoncredsErrorObject;
52
+ setDefaultLogger(): void;
53
+ generateNonce(): string;
54
+ createSchema(options: {
55
+ name: string;
56
+ version: string;
57
+ issuerId: string;
58
+ attributeNames: string[];
59
+ }): ObjectHandle;
60
+ createCredentialDefinition(options: {
61
+ schemaId: string;
62
+ schema: ObjectHandle;
63
+ tag: string;
64
+ issuerId: string;
65
+ signatureType: string;
66
+ supportRevocation: boolean;
67
+ }): {
68
+ credentialDefinition: ObjectHandle;
69
+ credentialDefinitionPrivate: ObjectHandle;
70
+ keyCorrectnessProof: ObjectHandle;
71
+ };
72
+ createCredential(options: {
73
+ credentialDefinition: ObjectHandle;
74
+ credentialDefinitionPrivate: ObjectHandle;
75
+ credentialOffer: ObjectHandle;
76
+ credentialRequest: ObjectHandle;
77
+ attributeRawValues: Record<string, string>;
78
+ attributeEncodedValues?: Record<string, string>;
79
+ revocationConfiguration?: NativeCredentialRevocationConfig;
80
+ }): ObjectHandle;
81
+ encodeCredentialAttributes(options: {
82
+ attributeRawValues: string[];
83
+ }): string[];
84
+ processCredential(options: {
85
+ credential: ObjectHandle;
86
+ credentialRequestMetadata: ObjectHandle;
87
+ linkSecret: string;
88
+ credentialDefinition: ObjectHandle;
89
+ revocationRegistryDefinition?: ObjectHandle;
90
+ }): ObjectHandle;
91
+ createCredentialOffer(options: {
92
+ schemaId: string;
93
+ credentialDefinitionId: string;
94
+ keyCorrectnessProof: ObjectHandle;
95
+ }): ObjectHandle;
96
+ createCredentialRequest(options: {
97
+ entropy?: string;
98
+ proverDid?: string;
99
+ credentialDefinition: ObjectHandle;
100
+ linkSecret: string;
101
+ linkSecretId: string;
102
+ credentialOffer: ObjectHandle;
103
+ }): {
104
+ credentialRequest: ObjectHandle;
105
+ credentialRequestMetadata: ObjectHandle;
106
+ };
107
+ createLinkSecret(): string;
108
+ createPresentation(options: {
109
+ presentationRequest: ObjectHandle;
110
+ credentials: NativeCredentialEntry[];
111
+ credentialsProve: NativeCredentialProve[];
112
+ selfAttest: Record<string, string>;
113
+ linkSecret: string;
114
+ schemas: Record<string, ObjectHandle>;
115
+ credentialDefinitions: Record<string, ObjectHandle>;
116
+ }): ObjectHandle;
117
+ verifyPresentation(options: {
118
+ presentation: ObjectHandle;
119
+ presentationRequest: ObjectHandle;
120
+ schemas: ObjectHandle[];
121
+ schemaIds: string[];
122
+ credentialDefinitions: ObjectHandle[];
123
+ credentialDefinitionIds: string[];
124
+ revocationRegistryDefinitions?: ObjectHandle[];
125
+ revocationRegistryDefinitionIds?: string[];
126
+ revocationStatusLists?: ObjectHandle[];
127
+ nonRevokedIntervalOverrides?: NativeNonRevokedIntervalOverride[];
128
+ }): boolean;
129
+ createRevocationRegistryDefinition(options: {
130
+ credentialDefinition: ObjectHandle;
131
+ credentialDefinitionId: string;
132
+ issuerId: string;
133
+ tag: string;
134
+ revocationRegistryType: string;
135
+ maximumCredentialNumber: number;
136
+ tailsDirectoryPath?: string;
137
+ }): {
138
+ revocationRegistryDefinition: ObjectHandle;
139
+ revocationRegistryDefinitionPrivate: ObjectHandle;
140
+ };
141
+ createOrUpdateRevocationState(options: {
142
+ revocationRegistryDefinition: ObjectHandle;
143
+ revocationStatusList: ObjectHandle;
144
+ revocationRegistryIndex: number;
145
+ tailsPath: string;
146
+ oldRevocationState?: ObjectHandle;
147
+ oldRevocationStatusList?: ObjectHandle;
148
+ }): ObjectHandle;
149
+ createRevocationStatusList(options: {
150
+ credentialDefinition: ObjectHandle;
151
+ revocationRegistryDefinitionId: string;
152
+ revocationRegistryDefinition: ObjectHandle;
153
+ revocationRegistryDefinitionPrivate: ObjectHandle;
154
+ issuerId: string;
155
+ issuanceByDefault: boolean;
156
+ timestamp?: number;
157
+ }): ObjectHandle;
158
+ updateRevocationStatusListTimestampOnly(options: {
159
+ timestamp: number;
160
+ currentRevocationStatusList: ObjectHandle;
161
+ }): ObjectHandle;
162
+ updateRevocationStatusList(options: {
163
+ credentialDefinition: ObjectHandle;
164
+ revocationRegistryDefinition: ObjectHandle;
165
+ revocationRegistryDefinitionPrivate: ObjectHandle;
166
+ currentRevocationStatusList: ObjectHandle;
167
+ issued?: number[];
168
+ revoked?: number[];
169
+ timestamp?: number;
170
+ }): ObjectHandle;
171
+ credentialGetAttribute(options: {
172
+ objectHandle: ObjectHandle;
173
+ name: string;
174
+ }): string | null;
175
+ revocationRegistryDefinitionGetAttribute(options: {
176
+ objectHandle: ObjectHandle;
177
+ name: string;
178
+ }): string;
179
+ presentationRequestFromJson(options: {
180
+ json: string;
181
+ }): ObjectHandle;
182
+ revocationRegistryDefinitionFromJson(options: {
183
+ json: string;
184
+ }): ObjectHandle;
185
+ revocationRegistryFromJson(options: {
186
+ json: string;
187
+ }): ObjectHandle;
188
+ revocationStatusListFromJson(options: {
189
+ json: string;
190
+ }): ObjectHandle;
191
+ presentationFromJson(options: {
192
+ json: string;
193
+ }): ObjectHandle;
194
+ credentialOfferFromJson(options: {
195
+ json: string;
196
+ }): ObjectHandle;
197
+ schemaFromJson(options: {
198
+ json: string;
199
+ }): ObjectHandle;
200
+ credentialRequestFromJson(options: {
201
+ json: string;
202
+ }): ObjectHandle;
203
+ credentialRequestMetadataFromJson(options: {
204
+ json: string;
205
+ }): ObjectHandle;
206
+ credentialFromJson(options: {
207
+ json: string;
208
+ }): ObjectHandle;
209
+ revocationRegistryDefinitionPrivateFromJson(options: {
210
+ json: string;
211
+ }): ObjectHandle;
212
+ revocationStateFromJson(options: {
213
+ json: string;
214
+ }): ObjectHandle;
215
+ credentialDefinitionFromJson(options: {
216
+ json: string;
217
+ }): ObjectHandle;
218
+ credentialDefinitionPrivateFromJson(options: {
219
+ json: string;
220
+ }): ObjectHandle;
221
+ keyCorrectnessProofFromJson(options: {
222
+ json: string;
223
+ }): ObjectHandle;
224
+ getJson(options: {
225
+ objectHandle: ObjectHandle;
226
+ }): string;
227
+ getTypeName(options: {
228
+ objectHandle: ObjectHandle;
229
+ }): string;
230
+ objectFree(options: {
231
+ objectHandle: ObjectHandle;
232
+ }): void;
233
+ createW3cCredential(options: {
234
+ credentialDefinition: ObjectHandle;
235
+ credentialDefinitionPrivate: ObjectHandle;
236
+ credentialOffer: ObjectHandle;
237
+ credentialRequest: ObjectHandle;
238
+ attributeRawValues: Record<string, string>;
239
+ revocationConfiguration?: NativeCredentialRevocationConfig;
240
+ w3cVersion?: string;
241
+ }): ObjectHandle;
242
+ processW3cCredential(options: {
243
+ credential: ObjectHandle;
244
+ credentialRequestMetadata: ObjectHandle;
245
+ linkSecret: string;
246
+ credentialDefinition: ObjectHandle;
247
+ revocationRegistryDefinition?: ObjectHandle;
248
+ }): ObjectHandle;
249
+ createW3cPresentation(options: {
250
+ presentationRequest: ObjectHandle;
251
+ credentials: NativeCredentialEntry[];
252
+ credentialsProve: NativeCredentialProve[];
253
+ linkSecret: string;
254
+ schemas: Record<string, ObjectHandle>;
255
+ credentialDefinitions: Record<string, ObjectHandle>;
256
+ w3cVersion?: string;
257
+ }): ObjectHandle;
258
+ verifyW3cPresentation(options: {
259
+ presentation: ObjectHandle;
260
+ presentationRequest: ObjectHandle;
261
+ schemas: ObjectHandle[];
262
+ schemaIds: string[];
263
+ credentialDefinitions: ObjectHandle[];
264
+ credentialDefinitionIds: string[];
265
+ revocationRegistryDefinitions?: ObjectHandle[];
266
+ revocationRegistryDefinitionIds?: string[];
267
+ revocationStatusLists?: ObjectHandle[];
268
+ nonRevokedIntervalOverrides?: NativeNonRevokedIntervalOverride[];
269
+ }): boolean;
270
+ w3cPresentationFromJson(options: {
271
+ json: string;
272
+ }): ObjectHandle;
273
+ w3cCredentialFromJson(options: {
274
+ json: string;
275
+ }): ObjectHandle;
276
+ credentialToW3c(options: {
277
+ objectHandle: ObjectHandle;
278
+ issuerId: string;
279
+ w3cVersion?: string;
280
+ }): ObjectHandle;
281
+ credentialFromW3c(options: {
282
+ objectHandle: ObjectHandle;
283
+ }): ObjectHandle;
284
+ w3cCredentialGetIntegrityProofDetails(options: {
285
+ objectHandle: ObjectHandle;
286
+ }): ObjectHandle;
287
+ w3cCredentialProofGetAttribute(options: {
288
+ objectHandle: ObjectHandle;
289
+ name: string;
290
+ }): string | null;
291
+ };
292
+ interface ByteBufferOptions {
293
+ len: number;
294
+ data: Uint8Array;
295
+ }
296
+ export declare class ByteBuffer {
297
+ len: number;
298
+ data: Uint8Array;
299
+ constructor({ data, len }: ByteBufferOptions);
300
+ static fromUint8Array(data: Uint8Array): ByteBuffer;
301
+ }
302
+ export type JsonObject = Record<string, unknown>;
303
+ export declare class AnoncredsObject {
304
+ handle: ObjectHandle;
305
+ constructor(handle: number);
306
+ toJson(): JsonObject;
307
+ }
308
+ export declare class CredentialDefinitionPrivate extends AnoncredsObject {
309
+ static fromJson(json: JsonObject): CredentialDefinitionPrivate;
310
+ }
311
+ export declare class KeyCorrectnessProof extends AnoncredsObject {
312
+ static fromJson(json: JsonObject): KeyCorrectnessProof;
313
+ }
314
+ export type CreateSchemaOptions = {
315
+ name: string;
316
+ version: string;
317
+ issuerId: string;
318
+ attributeNames: string[];
319
+ };
320
+ export declare class Schema extends AnoncredsObject {
321
+ static create(options: CreateSchemaOptions): Schema;
322
+ static fromJson(json: JsonObject): Schema;
323
+ }
324
+ export type CreateCredentialDefinitionOptions = {
325
+ schemaId: string;
326
+ schema: Schema | JsonObject;
327
+ signatureType: string;
328
+ tag: string;
329
+ issuerId: string;
330
+ supportRevocation?: boolean;
331
+ };
332
+ export declare class CredentialDefinition extends AnoncredsObject {
333
+ static create(options: CreateCredentialDefinitionOptions): {
334
+ credentialDefinition: CredentialDefinition;
335
+ credentialDefinitionPrivate: CredentialDefinitionPrivate;
336
+ keyCorrectnessProof: KeyCorrectnessProof;
337
+ };
338
+ static fromJson(json: JsonObject): CredentialDefinition;
339
+ }
340
+ export type CreateCredentialOfferOptions = {
341
+ schemaId: string;
342
+ credentialDefinitionId: string;
343
+ keyCorrectnessProof: KeyCorrectnessProof | JsonObject;
344
+ };
345
+ export declare class CredentialOffer extends AnoncredsObject {
346
+ static create(options: CreateCredentialOfferOptions): CredentialOffer;
347
+ static fromJson(json: JsonObject): CredentialOffer;
348
+ }
349
+ export declare class CredentialRequestMetadata extends AnoncredsObject {
350
+ static fromJson(json: JsonObject): CredentialRequestMetadata;
351
+ }
352
+ export type CreateCredentialRequestOptions = {
353
+ entropy?: string;
354
+ proverDid?: string;
355
+ credentialDefinition: CredentialDefinition | JsonObject;
356
+ linkSecret: string;
357
+ linkSecretId: string;
358
+ credentialOffer: CredentialOffer | JsonObject;
359
+ };
360
+ export declare class CredentialRequest extends AnoncredsObject {
361
+ static create(options: CreateCredentialRequestOptions): {
362
+ credentialRequest: CredentialRequest;
363
+ credentialRequestMetadata: CredentialRequestMetadata;
364
+ };
365
+ static fromJson(json: JsonObject): CredentialRequest;
366
+ }
367
+ export declare class RevocationRegistryDefinitionPrivate extends AnoncredsObject {
368
+ static fromJson(json: JsonObject): RevocationRegistryDefinitionPrivate;
369
+ }
370
+ export type CreateRevocationRegistryDefinitionOptions = {
371
+ credentialDefinition: CredentialDefinition | JsonObject;
372
+ credentialDefinitionId: string;
373
+ tag: string;
374
+ issuerId: string;
375
+ revocationRegistryType: string;
376
+ maximumCredentialNumber: number;
377
+ tailsDirectoryPath?: string;
378
+ };
379
+ export declare class RevocationRegistryDefinition extends AnoncredsObject {
380
+ static create(options: CreateRevocationRegistryDefinitionOptions): {
381
+ revocationRegistryDefinition: RevocationRegistryDefinition;
382
+ revocationRegistryDefinitionPrivate: RevocationRegistryDefinitionPrivate;
383
+ };
384
+ static fromJson(json: JsonObject): RevocationRegistryDefinition;
385
+ getId(): string;
386
+ getMaximumCredentialNumber(): number;
387
+ getTailsHash(): string;
388
+ getTailsLocation(): string;
389
+ }
390
+ export type CreateRevocationStatusListOptions = {
391
+ credentialDefinition: CredentialDefinition | JsonObject;
392
+ revocationRegistryDefinitionId: string;
393
+ revocationRegistryDefinition: RevocationRegistryDefinition | JsonObject;
394
+ revocationRegistryDefinitionPrivate: RevocationRegistryDefinitionPrivate | JsonObject;
395
+ issuerId: string;
396
+ issuanceByDefault: boolean;
397
+ timestamp?: number;
398
+ };
399
+ export type UpdateRevocationStatusListTimestampOptions = {
400
+ timestamp: number;
401
+ };
402
+ export type UpdateRevocationStatusListOptions = {
403
+ credentialDefinition: CredentialDefinition | JsonObject;
404
+ revocationRegistryDefinition: RevocationRegistryDefinition | JsonObject;
405
+ revocationRegistryDefinitionPrivate: RevocationRegistryDefinitionPrivate | JsonObject;
406
+ issued?: number[];
407
+ revoked?: number[];
408
+ timestamp?: number;
409
+ };
410
+ export declare class RevocationStatusList extends AnoncredsObject {
411
+ static create(options: CreateRevocationStatusListOptions): RevocationStatusList;
412
+ static fromJson(json: JsonObject): RevocationStatusList;
413
+ updateTimestamp(options: UpdateRevocationStatusListTimestampOptions): void;
414
+ update(options: UpdateRevocationStatusListOptions): void;
415
+ }
416
+ export type CredentialRevocationConfigOptions = {
417
+ registryDefinition: RevocationRegistryDefinition;
418
+ registryDefinitionPrivate: RevocationRegistryDefinitionPrivate;
419
+ statusList: RevocationStatusList;
420
+ registryIndex: number;
421
+ };
422
+ export declare class CredentialRevocationConfig {
423
+ private readonly registryDefinition;
424
+ private readonly registryDefinitionPrivate;
425
+ private readonly statusList;
426
+ private readonly registryIndex;
427
+ constructor(options: CredentialRevocationConfigOptions);
428
+ get native(): NativeCredentialRevocationConfig;
429
+ }
430
+ export type CreateW3cCredentialOptions = {
431
+ credentialDefinition: CredentialDefinition | JsonObject;
432
+ credentialDefinitionPrivate: CredentialDefinitionPrivate | JsonObject;
433
+ credentialOffer: CredentialOffer | JsonObject;
434
+ credentialRequest: CredentialRequest | JsonObject;
435
+ attributeRawValues: Record<string, string>;
436
+ revocationConfiguration?: CredentialRevocationConfig;
437
+ w3cVersion?: string;
438
+ };
439
+ export type ProcessW3cCredentialOptions = {
440
+ credentialRequestMetadata: CredentialRequestMetadata | JsonObject;
441
+ linkSecret: string;
442
+ credentialDefinition: CredentialDefinition | JsonObject;
443
+ revocationRegistryDefinition?: RevocationRegistryDefinition | JsonObject;
444
+ };
445
+ export type W3cCredentialFromLegacyOptions = {
446
+ credential: Credential;
447
+ issuerId: string;
448
+ w3cVersion?: string;
449
+ };
450
+ export declare class W3cCredential extends AnoncredsObject {
451
+ static create(options: CreateW3cCredentialOptions): W3cCredential;
452
+ static fromJson(json: JsonObject): W3cCredential;
453
+ process(options: ProcessW3cCredentialOptions): this;
454
+ private getProofAttribute;
455
+ get schemaId(): string | null;
456
+ get credentialDefinitionId(): string | null;
457
+ get revocationRegistryId(): string | undefined;
458
+ get revocationRegistryIndex(): number | undefined;
459
+ get timestamp(): number | undefined;
460
+ toLegacy(): Credential;
461
+ static fromLegacy(options: W3cCredentialFromLegacyOptions): W3cCredential;
462
+ }
463
+ export type CreateCredentialOptions = {
464
+ credentialDefinition: CredentialDefinition | JsonObject;
465
+ credentialDefinitionPrivate: CredentialDefinitionPrivate | JsonObject;
466
+ credentialOffer: CredentialOffer | JsonObject;
467
+ credentialRequest: CredentialRequest | JsonObject;
468
+ attributeRawValues: Record<string, string>;
469
+ attributeEncodedValues?: Record<string, string>;
470
+ revocationConfiguration?: CredentialRevocationConfig;
471
+ };
472
+ export type ProcessCredentialOptions = {
473
+ credentialRequestMetadata: CredentialRequestMetadata | JsonObject;
474
+ linkSecret: string;
475
+ credentialDefinition: CredentialDefinition | JsonObject;
476
+ revocationRegistryDefinition?: RevocationRegistryDefinition | JsonObject;
477
+ };
478
+ export type CredentialToW3cOptions = {
479
+ issuerId: string;
480
+ w3cVersion?: string;
481
+ };
482
+ export type CredentialFromW3cOptions = {
483
+ credential: W3cCredential;
484
+ };
485
+ export declare class Credential extends AnoncredsObject {
486
+ static create(options: CreateCredentialOptions): Credential;
487
+ static fromJson(json: JsonObject): Credential;
488
+ process(options: ProcessCredentialOptions): this;
489
+ get schemaId(): string | null;
490
+ get credentialDefinitionId(): string | null;
491
+ get revocationRegistryId(): string | undefined;
492
+ get revocationRegistryIndex(): number | undefined;
493
+ toW3c(options: CredentialToW3cOptions): W3cCredential;
494
+ static fromW3c(options: CredentialFromW3cOptions): Credential;
495
+ }
496
+ export type CreateRevocationStateOptions = {
497
+ revocationRegistryDefinition: RevocationRegistryDefinition;
498
+ revocationStatusList: RevocationStatusList;
499
+ revocationRegistryIndex: number;
500
+ tailsPath: string;
501
+ oldRevocationStatusList?: RevocationStatusList;
502
+ oldRevocationState?: CredentialRevocationState;
503
+ };
504
+ export type UpdateRevocationStateOptions = Required<Pick<CreateRevocationStateOptions, 'oldRevocationStatusList' | 'oldRevocationState'>> & Omit<CreateRevocationStateOptions, 'oldRevocationStatusList' | 'oldRevocationState'>;
505
+ export declare class CredentialRevocationState extends AnoncredsObject {
506
+ static create(options: CreateRevocationStateOptions): CredentialRevocationState;
507
+ static fromJson(json: JsonObject): CredentialRevocationState;
508
+ update(options: UpdateRevocationStateOptions): void;
509
+ }
510
+ export declare class LinkSecret {
511
+ static create(): string;
512
+ }
513
+ export declare class Nonce {
514
+ static generate(): string;
515
+ }
516
+ export declare class PresentationRequest extends AnoncredsObject {
517
+ static fromJson(json: JsonObject): PresentationRequest;
518
+ }
519
+ export type UpdateRevocationRegistryOptions = {
520
+ revocationRegistryDefinition: RevocationRegistryDefinition;
521
+ issued: number[];
522
+ revoked: number[];
523
+ tailsDirectoryPath: string;
524
+ };
525
+ export declare class RevocationRegistry extends AnoncredsObject {
526
+ static fromJson(json: JsonObject): RevocationRegistry;
527
+ }
528
+ export type NonRevokedIntervalOverride = {
529
+ revocationRegistryDefinitionId: string;
530
+ requestedFromTimestamp: number;
531
+ overrideRevocationStatusListTimestamp: number;
532
+ };
533
+ export type CredentialEntry = {
534
+ credential: Credential | JsonObject;
535
+ timestamp?: number;
536
+ revocationState?: CredentialRevocationState | JsonObject;
537
+ };
538
+ export type CredentialProve = {
539
+ entryIndex: number;
540
+ referent: string;
541
+ isPredicate: boolean;
542
+ reveal: boolean;
543
+ };
544
+ export type RevocationEntry = {
545
+ revocationRegistryDefinitionEntryIndex: number;
546
+ entry: RevocationRegistry;
547
+ timestamp: number;
548
+ };
549
+ export type CreatePresentationOptions = {
550
+ presentationRequest: PresentationRequest | JsonObject;
551
+ credentials: CredentialEntry[];
552
+ credentialsProve: CredentialProve[];
553
+ selfAttest: Record<string, string>;
554
+ linkSecret: string;
555
+ schemas: Record<string, Schema | JsonObject>;
556
+ credentialDefinitions: Record<string, CredentialDefinition | JsonObject>;
557
+ };
558
+ export type VerifyPresentationOptions = {
559
+ presentationRequest: PresentationRequest | JsonObject;
560
+ schemas: Record<string, Schema | JsonObject>;
561
+ credentialDefinitions: Record<string, CredentialDefinition | JsonObject>;
562
+ revocationRegistryDefinitions?: Record<string, RevocationRegistryDefinition | JsonObject>;
563
+ revocationStatusLists?: (RevocationStatusList | JsonObject)[];
564
+ nonRevokedIntervalOverrides?: NonRevokedIntervalOverride[];
565
+ };
566
+ export declare class Presentation extends AnoncredsObject {
567
+ static create(options: CreatePresentationOptions): Presentation;
568
+ static fromJson(json: JsonObject): Presentation;
569
+ verify(options: VerifyPresentationOptions): boolean;
570
+ }
571
+ export type W3cCredentialEntry = {
572
+ credential: W3cCredential | JsonObject;
573
+ timestamp?: number;
574
+ revocationState?: CredentialRevocationState | JsonObject;
575
+ };
576
+ export type CreateW3cPresentationOptions = {
577
+ presentationRequest: PresentationRequest | JsonObject;
578
+ credentials: W3cCredentialEntry[];
579
+ credentialsProve: CredentialProve[];
580
+ linkSecret: string;
581
+ schemas: Record<string, Schema | JsonObject>;
582
+ credentialDefinitions: Record<string, CredentialDefinition | JsonObject>;
583
+ };
584
+ export type VerifyW3cPresentationOptions = {
585
+ presentationRequest: PresentationRequest | JsonObject;
586
+ schemas: Record<string, Schema | JsonObject>;
587
+ credentialDefinitions: Record<string, CredentialDefinition | JsonObject>;
588
+ revocationRegistryDefinitions?: Record<string, RevocationRegistryDefinition | JsonObject>;
589
+ revocationStatusLists?: (RevocationStatusList | JsonObject)[];
590
+ nonRevokedIntervalOverrides?: NonRevokedIntervalOverride[];
591
+ };
592
+ export declare class W3cPresentation extends AnoncredsObject {
593
+ static create(options: CreateW3cPresentationOptions): W3cPresentation;
594
+ static fromJson(json: JsonObject): W3cPresentation;
595
+ verify(options: VerifyW3cPresentationOptions): boolean;
596
+ }
597
+ /**
598
+ * @deprecated use `NativeAnoncreds`.instance` instead
599
+ */
600
+ export declare let anoncreds: Anoncreds;
601
+ export declare class NativeAnoncreds {
602
+ #private;
603
+ static get instance(): Anoncreds;
604
+ static register(nativeAnoncreds: Anoncreds): void;
605
+ }
606
+ /**
607
+ * @deprecated use `NativeAnoncreds.register` instead
608
+ */
609
+ export declare const registerAnoncreds: ({ lib }: {
610
+ lib: Anoncreds;
611
+ }) => void;
612
+ export {};
613
+ //# sourceMappingURL=index.d.mts.map