@cheqd/did-provider-cheqd 4.5.5-develop.1 → 4.6.0-develop.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 (30) hide show
  1. package/build/esm/agent/ICheqd.d.ts +291 -82
  2. package/build/esm/agent/ICheqd.d.ts.map +1 -1
  3. package/build/esm/agent/ICheqd.js +1567 -87
  4. package/build/esm/agent/ICheqd.js.map +1 -1
  5. package/build/esm/did-manager/cheqd-did-provider.d.ts +13 -2
  6. package/build/esm/did-manager/cheqd-did-provider.d.ts.map +1 -1
  7. package/build/esm/did-manager/cheqd-did-provider.js +10 -2
  8. package/build/esm/did-manager/cheqd-did-provider.js.map +1 -1
  9. package/build/esm/dkg-threshold/lit-protocol/v6.d.ts.map +1 -1
  10. package/build/esm/dkg-threshold/lit-protocol/v6.js +63 -33
  11. package/build/esm/dkg-threshold/lit-protocol/v6.js.map +1 -1
  12. package/build/esm/utils/helpers.d.ts +28 -7
  13. package/build/esm/utils/helpers.d.ts.map +1 -1
  14. package/build/esm/utils/helpers.js +120 -29
  15. package/build/esm/utils/helpers.js.map +1 -1
  16. package/build/tsconfig.esm.tsbuildinfo +1 -1
  17. package/build/tsconfig.types.tsbuildinfo +1 -1
  18. package/build/types/agent/ICheqd.d.ts +291 -82
  19. package/build/types/agent/ICheqd.d.ts.map +1 -1
  20. package/build/types/did-manager/cheqd-did-provider.d.ts +13 -2
  21. package/build/types/did-manager/cheqd-did-provider.d.ts.map +1 -1
  22. package/build/types/dkg-threshold/lit-protocol/v6.d.ts.map +1 -1
  23. package/build/types/utils/helpers.d.ts +28 -7
  24. package/build/types/utils/helpers.d.ts.map +1 -1
  25. package/package.json +6 -4
  26. package/src/agent/ICheqd.ts +2425 -372
  27. package/src/did-manager/cheqd-did-provider.ts +19 -4
  28. package/src/dkg-threshold/lit-protocol/v6.ts +65 -34
  29. package/src/utils/helpers.ts +172 -34
  30. package/tsconfig.json +2 -0
@@ -1,7 +1,8 @@
1
1
  import { CheqdNetwork, DIDDocument, DidStdFee, ISignInputs, MethodSpecificIdAlgo, VerificationMethods } from '@cheqd/sdk';
2
2
  import { Coin, DeliverTxResponse } from '@cosmjs/stargate';
3
- import { IAgentContext, IKeyManager, IAgentPlugin, IPluginMethodMap, IAgentPluginSchema, IIdentifier, VerifiableCredential, IVerifyCredentialArgs, IVerifyResult, VerifiablePresentation, IVerifyPresentationArgs, IError, ICreateVerifiableCredentialArgs, ICredentialIssuer, IDIDManager, IDataStore, IResolver, W3CVerifiableCredential, ICredentialVerifier } from '@veramo/core';
4
- import { CheqdDIDProvider, LinkedResource, TImportableEd25519Key, ResourcePayload, StatusList2021ResourcePayload, DefaultStatusList2021ResourceTypes, DefaultStatusList2021StatusPurposeTypes, DefaultStatusList2021Encoding, DefaultStatusList2021StatusPurposeType, TPublicKeyEd25519 } from '../did-manager/cheqd-did-provider.js';
3
+ import { IAgentContext, IKeyManager, IAgentPlugin, IPluginMethodMap, IAgentPluginSchema, IIdentifier, VerifiableCredential, IVerifyCredentialArgs, IVerifyResult, VerifiablePresentation, IVerifyPresentationArgs, IError, ICreateVerifiableCredentialArgs, ICredentialIssuer, IDIDManager, IDataStore, IResolver, W3CVerifiableCredential, ICredentialVerifier, CredentialStatusReference } from '@veramo/core';
4
+ import { CheqdDIDProvider, LinkedResource, TImportableEd25519Key, ResourcePayload, StatusList2021ResourcePayload, DefaultStatusListEncodings, DefaultStatusList2021ResourceTypes, DefaultStatusList2021StatusPurposeTypes, DefaultStatusListEncoding, DefaultStatusList2021StatusPurposeType, TPublicKeyEd25519, BitstringStatusListResourceType, BitstringStatusListPurposeType, BitstringStatusListResourcePayload } from '../did-manager/cheqd-did-provider.js';
5
+ import { Bitstring as DBBitstring } from '@digitalbazaar/bitstring';
5
6
  import { CosmosAccessControlCondition, CreateCapacityDelegationAuthSignatureResult, LitCompatibleCosmosChain, LitNetwork, MintCapacityCreditsResult } from '../dkg-threshold/lit-protocol/v6.js';
6
7
  import { AlternativeUri } from '@cheqd/ts-proto/cheqd/resource/v2/resource.js';
7
8
  export type IContext = IAgentContext<IDIDManager & IKeyManager & IDataStore & IResolver & ICredentialIssuer & ICredentialVerifier & ICheqd>;
@@ -160,6 +161,13 @@ export type VerificationResult = {
160
161
  suspended?: boolean;
161
162
  error?: IVerifyResult['error'];
162
163
  };
164
+ export interface BitstringValidationResult {
165
+ status: number;
166
+ purpose: string;
167
+ valid: boolean;
168
+ message?: string;
169
+ }
170
+ export type BitstringVerificationResult = VerificationResult & BitstringValidationResult;
163
171
  export type EncryptionResult = {
164
172
  symmetricEncryptionCiphertext: string;
165
173
  thresholdEncryptionCiphertext: string;
@@ -171,6 +179,28 @@ export type StatusCheckResult = {
171
179
  suspended?: boolean;
172
180
  error?: IError;
173
181
  };
182
+ export type BitstringUpdateResult = {
183
+ updated: boolean;
184
+ statusValue: BitstringStatusValue;
185
+ previousStatusValue?: BitstringStatusValue;
186
+ statusMessage?: string;
187
+ error?: IError;
188
+ statusList?: BitstringStatusList;
189
+ symmetricKey?: string;
190
+ published?: boolean;
191
+ resourceMetadata?: LinkedResourceMetadataResolutionResult;
192
+ };
193
+ export type BulkBitstringUpdateResult = {
194
+ updated: boolean[];
195
+ statusValues: BitstringStatusValue[];
196
+ previousStatusValues?: BitstringStatusValue[];
197
+ statusMessages?: string[];
198
+ error?: IError;
199
+ statusList?: BitstringStatusList;
200
+ symmetricKey?: string;
201
+ published?: boolean;
202
+ resourceMetadata?: LinkedResourceMetadataResolutionResult;
203
+ };
174
204
  export type RevocationResult = {
175
205
  revoked: boolean;
176
206
  error?: IError;
@@ -234,7 +264,7 @@ export type StatusList2021Revocation = {
234
264
  metadata: {
235
265
  type: typeof DefaultStatusList2021ResourceTypes.revocation;
236
266
  encrypted: boolean;
237
- encoding: DefaultStatusList2021Encoding;
267
+ encoding: DefaultStatusListEncoding;
238
268
  statusListHash?: string;
239
269
  paymentConditions?: PaymentCondition[];
240
270
  };
@@ -249,7 +279,7 @@ export type StatusList2021Suspension = {
249
279
  metadata: {
250
280
  type: typeof DefaultStatusList2021ResourceTypes.suspension;
251
281
  encrypted: boolean;
252
- encoding: DefaultStatusList2021Encoding;
282
+ encoding: DefaultStatusListEncoding;
253
283
  statusListHash?: string;
254
284
  paymentConditions?: PaymentCondition[];
255
285
  };
@@ -264,7 +294,7 @@ export type StatusList2021RevocationNonMigrated = {
264
294
  metadata: {
265
295
  type: typeof DefaultStatusList2021ResourceTypes.revocation;
266
296
  encrypted: boolean;
267
- encoding: DefaultStatusList2021Encoding;
297
+ encoding: DefaultStatusListEncoding;
268
298
  encryptedSymmetricKey?: string;
269
299
  paymentConditions?: PaymentCondition[];
270
300
  };
@@ -279,11 +309,51 @@ export type StatusList2021SuspensionNonMigrated = {
279
309
  metadata: {
280
310
  type: typeof DefaultStatusList2021ResourceTypes.suspension;
281
311
  encrypted: boolean;
282
- encoding: DefaultStatusList2021Encoding;
312
+ encoding: DefaultStatusListEncoding;
283
313
  encryptedSymmetricKey?: string;
284
314
  paymentConditions?: PaymentCondition[];
285
315
  };
286
316
  };
317
+ export interface BitstringStatusListEntry extends CredentialStatusReference {
318
+ id: string;
319
+ type: 'BitstringStatusListEntry';
320
+ statusPurpose: BitstringStatusListPurposeType;
321
+ statusListIndex: string;
322
+ statusListCredential: string;
323
+ statusSize?: number | 1;
324
+ statusMessage?: BitstringStatusMessage[];
325
+ statusReference?: string | string[];
326
+ }
327
+ export interface BitstringStatusMessage {
328
+ status: string;
329
+ message: string;
330
+ [key: string]: any;
331
+ }
332
+ export interface EncodedListMetadata {
333
+ encrypted: boolean;
334
+ encoding: DefaultStatusListEncoding;
335
+ length: number;
336
+ statusSize?: number;
337
+ statusMessages?: BitstringStatusMessage[];
338
+ statusListHash?: string;
339
+ symmetricLength?: number;
340
+ paymentConditions?: PaymentCondition[];
341
+ }
342
+ export type BitstringVerifiableCredential = VerifiableCredential & {
343
+ credentialStatus: BitstringStatusListEntry;
344
+ };
345
+ export type BitstringStatusListCredential = VerifiableCredential & {
346
+ credentialSubject: {
347
+ type: string;
348
+ statusPurpose: BitstringStatusListPurposeType;
349
+ encodedList: EncodedList;
350
+ ttl?: number;
351
+ };
352
+ };
353
+ export interface BitstringStatusList {
354
+ bitstringStatusListCredential: BitstringStatusListCredential;
355
+ metadata: EncodedListMetadata;
356
+ }
287
357
  export type AccessControlConditionType = (typeof AccessControlConditionTypes)[keyof typeof AccessControlConditionTypes];
288
358
  export type AccessControlConditionReturnValueComparator = (typeof AccessControlConditionReturnValueComparators)[keyof typeof AccessControlConditionReturnValueComparators];
289
359
  export type PaymentCondition = {
@@ -305,6 +375,14 @@ export type CreateStatusList2021Result = {
305
375
  encrypted?: boolean;
306
376
  symmetricKey?: string;
307
377
  };
378
+ export type CreateStatusListResult = {
379
+ created: boolean;
380
+ error?: Error;
381
+ resource: BitstringStatusList;
382
+ resourceMetadata: LinkedResourceMetadataResolutionResult;
383
+ encrypted?: boolean;
384
+ symmetricKey?: string;
385
+ };
308
386
  export type TransactionResult = {
309
387
  successful: boolean;
310
388
  transactionHash?: string;
@@ -356,6 +434,15 @@ export declare const GenerateVersionIdMethodName = "cheqdGenerateVersionId";
356
434
  export declare const GenerateStatusList2021MethodName = "cheqdGenerateStatusList2021";
357
435
  export declare const IssueRevocableCredentialWithStatusList2021MethodName = "cheqdIssueRevocableCredentialWithStatusList2021";
358
436
  export declare const IssueSuspendableCredentialWithStatusList2021MethodName = "cheqdIssueSuspendableCredentialWithStatusList2021";
437
+ export declare const CreateStatusListMethodName = "cheqdCreateStatusList";
438
+ export declare const BroadcastStatusListMethodName = "cheqdBroadcastStatusList";
439
+ export declare const GenerateStatusListMethodName = "cheqdGenerateStatusList";
440
+ export declare const VerifyStatusListCredentialMethodName = "cheqdVerifyStatusListCredential";
441
+ export declare const IssueCredentialWithStatusListMethodName = "cheqdIssueCredentialWithStatusList";
442
+ export declare const VerifyCredentialWithStatusListMethodName = "cheqdVerifyCredentialWithStatusList";
443
+ export declare const UpdateCredentialWithStatusListMethodName = "cheqdUpdateCredentialWithStatusList";
444
+ export declare const BulkUpdateCredentialsWithStatusListMethodName = "cheqdBulkUpdateCredentialsWithStatusList";
445
+ export declare const VerifyPresentationWithStatusListMethodName = "cheqdVerifyPresentationWithStatusList";
359
446
  export declare const VerifyCredentialMethodName = "cheqdVerifyCredential";
360
447
  export declare const VerifyPresentationMethodName = "cheqdVerifyPresentation";
361
448
  export declare const CheckCredentialStatusMethodName = "cheqdCheckCredentialStatus";
@@ -411,7 +498,7 @@ export interface ICheqdCreateStatusList2021Args {
411
498
  resourceVersion?: ResourcePayload['version'];
412
499
  alsoKnownAs?: ResourcePayload['alsoKnownAs'];
413
500
  statusListLength?: number;
414
- statusListEncoding?: DefaultStatusList2021Encoding;
501
+ statusListEncoding?: DefaultStatusListEncoding;
415
502
  validUntil?: string;
416
503
  returnSymmetricKey?: boolean;
417
504
  }
@@ -423,14 +510,32 @@ export interface ICheqdCreateUnencryptedStatusList2021Args {
423
510
  signInputs?: ISignInputs[];
424
511
  fee?: DidStdFee | 'auto' | number;
425
512
  }
426
- export interface ICheqdBroadcastStatusList2021Args {
513
+ export interface ICheqdBroadcastStatusListArgs {
427
514
  kms: string;
428
- payload: StatusList2021ResourcePayload;
515
+ payload: StatusList2021ResourcePayload | BitstringStatusListResourcePayload;
429
516
  network: CheqdNetwork;
430
517
  file?: string;
431
518
  signInputs?: ISignInputs[];
432
519
  fee?: DidStdFee | 'auto' | number;
433
520
  }
521
+ export interface ICheqdCreateBitstringStatusListArgs {
522
+ kms: string;
523
+ issuerDid: string;
524
+ statusListName: string;
525
+ statusPurpose: BitstringStatusListPurposeType | BitstringStatusListPurposeType[];
526
+ statusSize?: number;
527
+ statusMessages?: BitstringStatusMessage[];
528
+ ttl?: number;
529
+ encrypted: boolean;
530
+ paymentConditions?: PaymentCondition[];
531
+ dkgOptions?: DkgOptions;
532
+ resourceVersion?: ResourcePayload['version'];
533
+ alsoKnownAs?: ResourcePayload['alsoKnownAs'];
534
+ statusListLength?: number;
535
+ statusListEncoding?: DefaultStatusListEncoding;
536
+ validUntil?: string;
537
+ returnSymmetricKey?: boolean;
538
+ }
434
539
  export interface ICheqdGenerateDidDocArgs {
435
540
  verificationMethod: VerificationMethods;
436
541
  methodSpecificIdAlgo: MethodSpecificIdAlgo;
@@ -448,7 +553,30 @@ export interface ICheqdGenerateVersionIdArgs {
448
553
  export interface ICheqdGenerateStatusList2021Args {
449
554
  length?: number;
450
555
  buffer?: Uint8Array;
451
- bitstringEncoding?: DefaultStatusList2021Encoding;
556
+ bitstringEncoding?: DefaultStatusListEncoding;
557
+ }
558
+ export interface ICheqdGenerateStatusListArgs {
559
+ length?: number;
560
+ statusSize?: number;
561
+ buffer?: Buffer;
562
+ bitstringEncoding?: DefaultStatusListEncoding;
563
+ }
564
+ export interface ICheqdVerifyStatusListCredentialArgs {
565
+ credential: BitstringStatusListCredential;
566
+ verificationArgs?: IVerifyCredentialArgs;
567
+ }
568
+ export interface StatusOptions {
569
+ statusPurpose: BitstringStatusListPurposeType;
570
+ statusListName: string;
571
+ statusListIndex?: number;
572
+ statusListVersion?: string;
573
+ statusListRangeStart?: number;
574
+ statusListRangeEnd?: number;
575
+ indexNotIn?: number[];
576
+ }
577
+ export interface ICheqdIssueCredentialWithStatusListArgs {
578
+ issuanceOptions: ICreateVerifiableCredentialArgs;
579
+ statusOptions: StatusOptions;
452
580
  }
453
581
  export interface ICheqdIssueRevocableCredentialWithStatusList2021Args {
454
582
  issuanceOptions: ICreateVerifiableCredentialArgs;
@@ -474,31 +602,39 @@ export interface ICheqdIssueSuspendableCredentialWithStatusList2021Args {
474
602
  indexNotIn?: number[];
475
603
  };
476
604
  }
477
- export interface ICheqdVerifyCredentialWithStatusList2021Args {
605
+ export interface ICheqdVerifyCredentialWithStatusListArgs {
478
606
  credential: W3CVerifiableCredential;
479
607
  verificationArgs?: IVerifyCredentialArgs;
480
608
  fetchList?: boolean;
481
609
  dkgOptions?: DkgOptions;
482
- options?: ICheqdStatusList2021Options;
610
+ options?: ICheqdStatusListOptions;
483
611
  }
484
- export interface ICheqdVerifyPresentationWithStatusList2021Args {
612
+ export interface ICheqdVerifyCredentialWithBitstringArgs {
613
+ credential: BitstringVerifiableCredential;
614
+ verificationArgs?: IVerifyCredentialArgs;
615
+ fetchList?: boolean;
616
+ dkgOptions?: DkgOptions;
617
+ options?: ICheqdStatusListOptions;
618
+ }
619
+ export interface ICheqdVerifyPresentationWithStatusListArgs {
485
620
  presentation: VerifiablePresentation;
486
621
  verificationArgs?: IVerifyPresentationArgs;
487
622
  fetchList?: boolean;
488
623
  dkgOptions?: DkgOptions;
489
- options?: ICheqdStatusList2021Options;
624
+ options?: ICheqdStatusListOptions;
490
625
  }
491
- export interface ICheqdCheckCredentialStatusWithStatusList2021Args {
626
+ export interface ICheqdCheckCredentialStatusWithStatusListArgs {
492
627
  credential?: W3CVerifiableCredential;
493
- statusOptions?: ICheqdCheckCredentialWithStatusList2021StatusOptions;
628
+ statusOptions?: ICheqdCheckCredentialStatusOptions;
494
629
  verificationOptions?: IVerifyCredentialArgs;
495
630
  fetchList?: boolean;
496
631
  dkgOptions?: DkgOptions;
497
- options?: ICheqdStatusList2021Options;
632
+ options?: ICheqdStatusListOptions;
498
633
  }
499
- export interface ICheqdRevokeCredentialWithStatusList2021Args {
634
+ export interface ICheqdUpdateCredentialWithStatusListArgs {
500
635
  credential?: W3CVerifiableCredential;
501
- revocationOptions?: ICheqdRevokeCredentialWithStatusList2021Options;
636
+ newStatus: BitstringStatusValue;
637
+ updateOptions?: ICheqdCredentialStatusUpdateOptions;
502
638
  verificationOptions?: IVerifyCredentialArgs;
503
639
  fetchList?: boolean;
504
640
  publish?: boolean;
@@ -510,11 +646,13 @@ export interface ICheqdRevokeCredentialWithStatusList2021Args {
510
646
  returnSymmetricKey?: boolean;
511
647
  returnStatusListMetadata?: boolean;
512
648
  dkgOptions?: DkgOptions;
513
- options?: ICheqdStatusList2021Options;
649
+ options?: ICheqdStatusListOptions;
650
+ fee?: DidStdFee | 'auto' | number;
514
651
  }
515
- export interface ICheqdRevokeBulkCredentialsWithStatusList2021Args {
652
+ export interface ICheqdBulkUpdateCredentialWithStatusListArgs {
516
653
  credentials?: W3CVerifiableCredential[];
517
- revocationOptions?: ICheqdRevokeBulkCredentialsWithStatusList2021Options;
654
+ newStatus: BitstringStatusValue;
655
+ updateOptions?: ICheqdBulkCredentialStatusUpdateOptions;
518
656
  verificationOptions?: IVerifyCredentialArgs;
519
657
  fetchList?: boolean;
520
658
  publish?: boolean;
@@ -526,12 +664,12 @@ export interface ICheqdRevokeBulkCredentialsWithStatusList2021Args {
526
664
  returnSymmetricKey?: boolean;
527
665
  returnStatusListMetadata?: boolean;
528
666
  dkgOptions?: DkgOptions;
529
- options?: ICheqdStatusList2021Options;
667
+ options?: ICheqdStatusListOptions;
530
668
  fee?: DidStdFee | 'auto' | number;
531
669
  }
532
- export interface ICheqdSuspendCredentialWithStatusList2021Args {
670
+ export interface ICheqdRevokeCredentialWithStatusListArgs {
533
671
  credential?: W3CVerifiableCredential;
534
- suspensionOptions?: ICheqdSuspendCredentialWithStatusList2021Options;
672
+ revocationOptions?: ICheqdCredentialStatusUpdateOptions;
535
673
  verificationOptions?: IVerifyCredentialArgs;
536
674
  fetchList?: boolean;
537
675
  publish?: boolean;
@@ -543,12 +681,45 @@ export interface ICheqdSuspendCredentialWithStatusList2021Args {
543
681
  returnSymmetricKey?: boolean;
544
682
  returnStatusListMetadata?: boolean;
545
683
  dkgOptions?: DkgOptions;
546
- options?: ICheqdStatusList2021Options;
684
+ options?: ICheqdStatusListOptions;
685
+ }
686
+ export interface ICheqdRevokeBulkCredentialsWithStatusListArgs {
687
+ credentials?: W3CVerifiableCredential[];
688
+ revocationOptions?: ICheqdBulkCredentialStatusUpdateOptions;
689
+ verificationOptions?: IVerifyCredentialArgs;
690
+ fetchList?: boolean;
691
+ publish?: boolean;
692
+ publishEncrypted?: boolean;
693
+ symmetricKey?: string;
694
+ paymentConditions?: PaymentCondition[];
695
+ writeToFile?: boolean;
696
+ returnUpdatedStatusList?: boolean;
697
+ returnSymmetricKey?: boolean;
698
+ returnStatusListMetadata?: boolean;
699
+ dkgOptions?: DkgOptions;
700
+ options?: ICheqdStatusListOptions;
547
701
  fee?: DidStdFee | 'auto' | number;
548
702
  }
549
- export interface ICheqdSuspendBulkCredentialsWithStatusList2021Args {
703
+ export interface ICheqdSuspendCredentialWithStatusListArgs {
704
+ credential?: W3CVerifiableCredential;
705
+ suspensionOptions?: ICheqdCredentialStatusUpdateOptions;
706
+ verificationOptions?: IVerifyCredentialArgs;
707
+ fetchList?: boolean;
708
+ publish?: boolean;
709
+ publishEncrypted?: boolean;
710
+ symmetricKey?: string;
711
+ paymentConditions?: PaymentCondition[];
712
+ writeToFile?: boolean;
713
+ returnUpdatedStatusList?: boolean;
714
+ returnSymmetricKey?: boolean;
715
+ returnStatusListMetadata?: boolean;
716
+ dkgOptions?: DkgOptions;
717
+ options?: ICheqdStatusListOptions;
718
+ fee?: DidStdFee | 'auto' | number;
719
+ }
720
+ export interface ICheqdSuspendBulkCredentialsWithStatusListArgs {
550
721
  credentials?: W3CVerifiableCredential[];
551
- suspensionOptions?: ICheqdSuspendBulkCredentialsWithStatusList2021Options;
722
+ suspensionOptions?: ICheqdBulkCredentialStatusUpdateOptions;
552
723
  verificationOptions?: IVerifyCredentialArgs;
553
724
  fetchList?: boolean;
554
725
  publish?: boolean;
@@ -560,12 +731,12 @@ export interface ICheqdSuspendBulkCredentialsWithStatusList2021Args {
560
731
  returnSymmetricKey?: boolean;
561
732
  returnStatusListMetadata?: boolean;
562
733
  dkgOptions?: DkgOptions;
563
- options?: ICheqdStatusList2021Options;
734
+ options?: ICheqdStatusListOptions;
564
735
  fee?: DidStdFee | 'auto' | number;
565
736
  }
566
- export interface ICheqdUnsuspendCredentialWithStatusList2021Args {
737
+ export interface ICheqdUnsuspendCredentialWithStatusListArgs {
567
738
  credential?: W3CVerifiableCredential;
568
- unsuspensionOptions?: ICheqdUnsuspendCredentialWithStatusList2021Options;
739
+ unsuspensionOptions?: ICheqdCredentialStatusUpdateOptions;
569
740
  verificationOptions?: IVerifyCredentialArgs;
570
741
  fetchList?: boolean;
571
742
  publish?: boolean;
@@ -577,12 +748,12 @@ export interface ICheqdUnsuspendCredentialWithStatusList2021Args {
577
748
  returnSymmetricKey?: boolean;
578
749
  returnStatusListMetadata?: boolean;
579
750
  dkgOptions?: DkgOptions;
580
- options?: ICheqdStatusList2021Options;
751
+ options?: ICheqdStatusListOptions;
581
752
  fee?: DidStdFee | 'auto' | number;
582
753
  }
583
- export interface ICheqdUnsuspendBulkCredentialsWithStatusList2021Args {
754
+ export interface ICheqdUnsuspendBulkCredentialsWithStatusListArgs {
584
755
  credentials?: W3CVerifiableCredential[];
585
- unsuspensionOptions?: ICheqdUnsuspendBulkCredentialsWithStatusList2021Options;
756
+ unsuspensionOptions?: ICheqdBulkCredentialStatusUpdateOptions;
586
757
  verificationOptions?: IVerifyCredentialArgs;
587
758
  fetchList?: boolean;
588
759
  publish?: boolean;
@@ -594,7 +765,7 @@ export interface ICheqdUnsuspendBulkCredentialsWithStatusList2021Args {
594
765
  returnSymmetricKey?: boolean;
595
766
  returnStatusListMetadata?: boolean;
596
767
  dkgOptions?: DkgOptions;
597
- options?: ICheqdStatusList2021Options;
768
+ options?: ICheqdStatusListOptions;
598
769
  fee?: DidStdFee | 'auto' | number;
599
770
  }
600
771
  export interface ICheqdTransactSendTokensArgs {
@@ -630,54 +801,36 @@ export interface ICheqdDelegateCapacityCreditArgs {
630
801
  expiration?: string;
631
802
  statement?: string;
632
803
  }
633
- export interface ICheqdStatusList2021Options {
804
+ export interface ICheqdStatusListOptions {
634
805
  statusListFile?: string;
635
806
  statusListInlineBitstring?: string;
636
807
  fee?: DidStdFee | 'auto' | number;
637
808
  signInputs?: ISignInputs[];
638
809
  [key: string]: any;
639
810
  }
640
- export interface ICheqdRevokeCredentialWithStatusList2021Options {
641
- issuerDid: string;
642
- statusListName: string;
643
- statusListIndex: number;
644
- statusListVersion?: string;
645
- }
646
- export interface ICheqdRevokeBulkCredentialsWithStatusList2021Options {
647
- issuerDid: string;
648
- statusListName: string;
649
- statusListIndices: number[];
650
- statusListVersion?: string;
651
- }
652
- export interface ICheqdSuspendCredentialWithStatusList2021Options {
811
+ export interface ICheqdCredentialStatusUpdateOptions {
653
812
  issuerDid: string;
654
813
  statusListName: string;
655
814
  statusListIndex: number;
656
815
  statusListVersion?: string;
657
816
  }
658
- export interface ICheqdSuspendBulkCredentialsWithStatusList2021Options {
817
+ export interface ICheqdBulkCredentialStatusUpdateOptions {
659
818
  issuerDid: string;
660
819
  statusListName: string;
661
820
  statusListIndices: number[];
662
821
  statusListVersion?: string;
663
822
  }
664
- export interface ICheqdUnsuspendCredentialWithStatusList2021Options {
665
- issuerDid: string;
666
- statusListName: string;
667
- statusListIndex: number;
668
- statusListVersion?: string;
823
+ export declare enum BitstringStatusValue {
824
+ VALID = 0,// 0x0 - valid
825
+ REVOKED = 1,// 0x1 - revoked
826
+ SUSPENDED = 2,// 0x2 - suspended
827
+ UNKNOWN = 3
669
828
  }
670
- export interface ICheqdUnsuspendBulkCredentialsWithStatusList2021Options {
671
- issuerDid: string;
672
- statusListName: string;
673
- statusListIndices: number[];
674
- statusListVersion?: string;
675
- }
676
- export interface ICheqdCheckCredentialWithStatusList2021StatusOptions {
829
+ export interface ICheqdCheckCredentialStatusOptions {
677
830
  issuerDid: string;
678
831
  statusListName: string;
679
832
  statusListIndex: number;
680
- statusPurpose: DefaultStatusList2021StatusPurposeType;
833
+ statusPurpose: DefaultStatusList2021StatusPurposeType | BitstringStatusListPurposeType;
681
834
  statusListVersion?: string;
682
835
  }
683
836
  export interface ICheqd extends IPluginMethodMap {
@@ -686,23 +839,32 @@ export interface ICheqd extends IPluginMethodMap {
686
839
  [DeactivateIdentifierMethodName]: (args: ICheqdDeactivateIdentifierArgs, context: IContext) => Promise<boolean>;
687
840
  [CreateResourceMethodName]: (args: ICheqdCreateLinkedResourceArgs, context: IContext) => Promise<boolean>;
688
841
  [CreateStatusList2021MethodName]: (args: ICheqdCreateStatusList2021Args, context: IContext) => Promise<CreateStatusList2021Result>;
689
- [BroadcastStatusList2021MethodName]: (args: ICheqdBroadcastStatusList2021Args, context: IContext) => Promise<boolean>;
842
+ [BroadcastStatusList2021MethodName]: (args: ICheqdBroadcastStatusListArgs, context: IContext) => Promise<boolean>;
690
843
  [GenerateDidDocMethodName]: (args: ICheqdGenerateDidDocArgs, context: IContext) => Promise<TExportedDIDDocWithKeys>;
691
844
  [GenerateDidDocWithLinkedResourceMethodName]: (args: ICheqdGenerateDidDocWithLinkedResourceArgs, context: IContext) => Promise<TExportedDIDDocWithLinkedResourceWithKeys>;
692
845
  [GenerateKeyPairMethodName]: (args: ICheqdGenerateKeyPairArgs, context: IContext) => Promise<TImportableEd25519Key>;
693
846
  [GenerateVersionIdMethodName]: (args: ICheqdGenerateVersionIdArgs, context: IContext) => Promise<string>;
847
+ [CreateStatusListMethodName]: (args: ICheqdCreateBitstringStatusListArgs, context: IContext) => Promise<CreateStatusListResult>;
848
+ [BroadcastStatusListMethodName]: (args: ICheqdBroadcastStatusListArgs, context: IContext) => Promise<boolean>;
849
+ [GenerateStatusListMethodName]: (args: ICheqdGenerateStatusListArgs, context: IContext) => Promise<string>;
850
+ [VerifyStatusListCredentialMethodName]: (args: ICheqdVerifyStatusListCredentialArgs, context: IContext) => Promise<VerificationResult>;
851
+ [IssueCredentialWithStatusListMethodName]: (args: ICheqdIssueCredentialWithStatusListArgs, context: IContext) => Promise<BitstringVerifiableCredential>;
694
852
  [GenerateStatusList2021MethodName]: (args: ICheqdGenerateStatusList2021Args, context: IContext) => Promise<string>;
695
853
  [IssueRevocableCredentialWithStatusList2021MethodName]: (args: ICheqdIssueRevocableCredentialWithStatusList2021Args, context: IContext) => Promise<VerifiableCredential>;
696
854
  [IssueSuspendableCredentialWithStatusList2021MethodName]: (args: ICheqdIssueSuspendableCredentialWithStatusList2021Args, context: IContext) => Promise<VerifiableCredential>;
697
- [VerifyCredentialMethodName]: (args: ICheqdVerifyCredentialWithStatusList2021Args, context: IContext) => Promise<VerificationResult>;
698
- [VerifyPresentationMethodName]: (args: ICheqdVerifyPresentationWithStatusList2021Args, context: IContext) => Promise<VerificationResult>;
699
- [CheckCredentialStatusMethodName]: (args: ICheqdCheckCredentialStatusWithStatusList2021Args, context: IContext) => Promise<StatusCheckResult>;
700
- [RevokeCredentialMethodName]: (args: ICheqdRevokeCredentialWithStatusList2021Args, context: IContext) => Promise<RevocationResult>;
701
- [RevokeCredentialsMethodName]: (args: ICheqdRevokeBulkCredentialsWithStatusList2021Args, context: IContext) => Promise<BulkRevocationResult>;
702
- [SuspendCredentialMethodName]: (args: ICheqdSuspendCredentialWithStatusList2021Args, context: IContext) => Promise<SuspensionResult>;
703
- [SuspendCredentialsMethodName]: (args: ICheqdSuspendBulkCredentialsWithStatusList2021Args, context: IContext) => Promise<BulkSuspensionResult>;
704
- [UnsuspendCredentialMethodName]: (args: ICheqdUnsuspendCredentialWithStatusList2021Args, context: IContext) => Promise<UnsuspensionResult>;
705
- [UnsuspendCredentialsMethodName]: (args: ICheqdUnsuspendBulkCredentialsWithStatusList2021Args, context: IContext) => Promise<BulkUnsuspensionResult>;
855
+ [VerifyCredentialMethodName]: (args: ICheqdVerifyCredentialWithStatusListArgs, context: IContext) => Promise<VerificationResult>;
856
+ [VerifyCredentialWithStatusListMethodName]: (args: ICheqdVerifyCredentialWithBitstringArgs, context: IContext) => Promise<VerificationResult>;
857
+ [VerifyPresentationMethodName]: (args: ICheqdVerifyPresentationWithStatusListArgs, context: IContext) => Promise<VerificationResult>;
858
+ [CheckCredentialStatusMethodName]: (args: ICheqdCheckCredentialStatusWithStatusListArgs, context: IContext) => Promise<StatusCheckResult>;
859
+ [VerifyPresentationWithStatusListMethodName]: (args: ICheqdVerifyPresentationWithStatusListArgs, context: IContext) => Promise<BitstringVerificationResult>;
860
+ [UpdateCredentialWithStatusListMethodName]: (args: ICheqdUpdateCredentialWithStatusListArgs, context: IContext) => Promise<BitstringUpdateResult>;
861
+ [BulkUpdateCredentialsWithStatusListMethodName]: (args: ICheqdBulkUpdateCredentialWithStatusListArgs, context: IContext) => Promise<BulkBitstringUpdateResult>;
862
+ [RevokeCredentialMethodName]: (args: ICheqdRevokeCredentialWithStatusListArgs, context: IContext) => Promise<RevocationResult>;
863
+ [RevokeCredentialsMethodName]: (args: ICheqdRevokeBulkCredentialsWithStatusListArgs, context: IContext) => Promise<BulkRevocationResult>;
864
+ [SuspendCredentialMethodName]: (args: ICheqdSuspendCredentialWithStatusListArgs, context: IContext) => Promise<SuspensionResult>;
865
+ [SuspendCredentialsMethodName]: (args: ICheqdSuspendBulkCredentialsWithStatusListArgs, context: IContext) => Promise<BulkSuspensionResult>;
866
+ [UnsuspendCredentialMethodName]: (args: ICheqdUnsuspendCredentialWithStatusListArgs, context: IContext) => Promise<UnsuspensionResult>;
867
+ [UnsuspendCredentialsMethodName]: (args: ICheqdUnsuspendBulkCredentialsWithStatusListArgs, context: IContext) => Promise<BulkUnsuspensionResult>;
706
868
  [TransactSendTokensMethodName]: (args: ICheqdTransactSendTokensArgs, context: IContext) => Promise<TransactionResult>;
707
869
  [ObservePaymentConditionMethodName]: (args: ICheqdObservePaymentConditionArgs, context: IContext) => Promise<ObservationResult>;
708
870
  [MintCapacityCreditMethodName]: (args: ICheqdMintCapacityCreditArgs, context: IContext) => Promise<MintCapacityCreditResult>;
@@ -717,6 +879,12 @@ export declare class Cheqd implements IAgentPlugin {
717
879
  static readonly defaultStatusList2021Length: number;
718
880
  static readonly defaultContextV1 = "https://www.w3.org/2018/credentials/v1";
719
881
  static readonly statusList2021Context = "https://w3id.org/vc-status-list-2021/v1";
882
+ static readonly DefaultBitstringContexts: {
883
+ v2: string;
884
+ statusList: string;
885
+ };
886
+ static readonly DefaultBitstringStatusSize: number;
887
+ static readonly DefaultBitstringLength: number;
720
888
  constructor(args: {
721
889
  providers: CheqdDIDProvider[];
722
890
  });
@@ -726,17 +894,51 @@ export declare class Cheqd implements IAgentPlugin {
726
894
  private CreateResource;
727
895
  private CreateStatusList2021;
728
896
  private BroadcastStatusList2021;
897
+ private CreateBitstringStatusList;
898
+ private BroadcastBitstringStatusList;
899
+ /**
900
+ * Validate Bitstring Status List payload structure and content
901
+ */
902
+ private validateBitstringStatusListPayload;
903
+ /**
904
+ * Validate status messages for multi-bit status
905
+ */
906
+ private validateStatusMessagesInPayload;
729
907
  private GenerateDidDoc;
730
908
  private GenerateDidDocWithLinkedResource;
731
909
  private GenerateIdentityKeys;
732
910
  private GenerateVersionId;
733
911
  private GenerateStatusList2021;
912
+ private GenerateBitstringStatusList;
913
+ private VerifyStatusListCredential;
914
+ private IssueCredentialWithBitstringStatusList;
734
915
  private IssueRevocableCredentialWithStatusList2021;
735
916
  private IssueSuspendableCredentialWithStatusList2021;
917
+ private addStatusList2021Contexts;
918
+ private addBitstringStatusListContexts;
736
919
  private VerifyCredentialWithStatusList2021;
920
+ private VerifyCredentialWithBitstringStatusList;
921
+ static validateBitstringStatus(vcToValidate: BitstringVerifiableCredential, publishedList: BitstringStatusList, options?: ICheqdStatusListOptions): Promise<BitstringValidationResult>;
922
+ private VerifyPresentationWithBitstringStatusList;
737
923
  private VerifyPresentationWithStatusList2021;
738
924
  private CheckCredentialStatusWithStatusList2021;
925
+ private UpdateCredentialWithStatusList;
926
+ private getStatusPurposeForMultiPurposeList;
927
+ static updateBitstringCredentialStatus(credential: VerifiableCredential, options?: ICheqdStatusListOptions): Promise<BitstringUpdateResult>;
928
+ static fetchAndDecryptBitstring(publishedList: BitstringStatusList, options?: ICheqdStatusListOptions): Promise<string>;
929
+ static publishUpdatedBitstringStatusList(updatedStatusList: BitstringStatusList, credential: VerifiableCredential, options?: ICheqdStatusListOptions): Promise<{
930
+ symmetricKey?: string;
931
+ }>;
932
+ static publishBitstringStatusList(statusListRaw: Uint8Array, statusListMetadata: LinkedResourceMetadataResolutionResult, options: {
933
+ context: IContext;
934
+ resourceId?: string;
935
+ resourceVersion?: string;
936
+ resourceAlsoKnownAs?: AlternativeUri[];
937
+ signInputs?: ISignInputs[];
938
+ fee?: DidStdFee | 'auto' | number;
939
+ }): Promise<boolean>;
739
940
  private RevokeCredentialWithStatusList2021;
941
+ private BulkUpdateCredentialsWithStatusList;
740
942
  private RevokeBulkCredentialsWithStatusList2021;
741
943
  private SuspendCredentialWithStatusList2021;
742
944
  private SuspendBulkCredentialsWithStatusList2021;
@@ -746,14 +948,14 @@ export declare class Cheqd implements IAgentPlugin {
746
948
  private ObservePaymentCondition;
747
949
  private MintCapacityCredit;
748
950
  private DelegateCapacityCredit;
749
- static revokeCredential(credential: VerifiableCredential, options?: ICheqdStatusList2021Options): Promise<RevocationResult>;
750
- static revokeCredentials(credentials: VerifiableCredential[], options?: ICheqdStatusList2021Options): Promise<BulkRevocationResult>;
751
- static suspendCredential(credential: VerifiableCredential, options?: ICheqdStatusList2021Options): Promise<SuspensionResult>;
752
- static suspendCredentials(credentials: VerifiableCredential[], options?: ICheqdStatusList2021Options): Promise<BulkSuspensionResult>;
753
- static unsuspendCredential(credential: VerifiableCredential, options?: ICheqdStatusList2021Options): Promise<UnsuspensionResult>;
754
- static unsuspendCredentials(credentials: VerifiableCredential[], options?: ICheqdStatusList2021Options): Promise<BulkUnsuspensionResult>;
755
- static checkRevoked(credential: VerifiableCredential, options?: ICheqdStatusList2021Options): Promise<boolean>;
756
- static checkSuspended(credential: VerifiableCredential, options?: ICheqdStatusList2021Options): Promise<boolean>;
951
+ static revokeCredential(credential: VerifiableCredential, options?: ICheqdStatusListOptions): Promise<RevocationResult>;
952
+ static revokeCredentials(credentials: VerifiableCredential[], options?: ICheqdStatusListOptions): Promise<BulkRevocationResult>;
953
+ static suspendCredential(credential: VerifiableCredential, options?: ICheqdStatusListOptions): Promise<SuspensionResult>;
954
+ static suspendCredentials(credentials: VerifiableCredential[], options?: ICheqdStatusListOptions): Promise<BulkSuspensionResult>;
955
+ static unsuspendCredential(credential: VerifiableCredential, options?: ICheqdStatusListOptions): Promise<UnsuspensionResult>;
956
+ static unsuspendCredentials(credentials: VerifiableCredential[], options?: ICheqdStatusListOptions): Promise<BulkUnsuspensionResult>;
957
+ static checkRevoked(credential: VerifiableCredential, options?: ICheqdStatusListOptions): Promise<boolean>;
958
+ static checkSuspended(credential: VerifiableCredential, options?: ICheqdStatusListOptions): Promise<boolean>;
757
959
  private static checkRevokedNonMigrated;
758
960
  private static checkSuspendedNonMigrated;
759
961
  static publishStatusList2021(statusList2021Raw: Uint8Array, statusList2021Metadata: LinkedResourceMetadataResolutionResult, options: {
@@ -765,12 +967,19 @@ export declare class Cheqd implements IAgentPlugin {
765
967
  fee?: DidStdFee | 'auto' | number;
766
968
  }): Promise<boolean>;
767
969
  static fetchStatusList2021(credential: VerifiableCredential, returnRaw?: boolean): Promise<StatusList2021Revocation | StatusList2021Suspension | Uint8Array>;
768
- static fetchStatusList2021Metadata(credential: VerifiableCredential): Promise<LinkedResourceMetadataResolutionResult>;
970
+ static fetchStatusListMetadata(credential: VerifiableCredential): Promise<LinkedResourceMetadataResolutionResult>;
971
+ /**
972
+ * Fetch the JSON metadata from a bitstring status list credential URL
973
+ */
974
+ static fetchBitstringStatusList(credential: VerifiableCredential): Promise<BitstringStatusList>;
769
975
  static getProviderFromDidUrl(didUrl: string, providers: CheqdDIDProvider[], message?: string): Promise<CheqdDIDProvider>;
770
976
  static getProviderFromNetwork(network: CheqdNetwork, providers: CheqdDIDProvider[], message?: string): Promise<CheqdDIDProvider>;
771
977
  static generateProviderId(namespace: string): string;
772
978
  static getFile(filename: string): Promise<Uint8Array>;
773
979
  static writeFile(content: Uint8Array, filename?: string): Promise<void>;
774
980
  static decodeCredentialJWT(jwt: string): Promise<VerifiableCredential>;
981
+ static getBitValue(bitstring: DBBitstring, bitIndex: number, statusSize?: number): number;
982
+ static setBitValue(bitstring: DBBitstring, bitIndex: number, value: number, statusSize?: number): void;
775
983
  }
984
+ export { BitstringStatusListResourceType, DefaultStatusListEncodings };
776
985
  //# sourceMappingURL=ICheqd.d.ts.map