@twin.org/identity-cli 0.0.2-next.3 → 0.0.2-next.5

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.
@@ -285,7 +285,8 @@ function buildCommandProofCreate() {
285
285
  .description(core.I18n.formatMessage("commands.proof-create.description"))
286
286
  .requiredOption(core.I18n.formatMessage("commands.proof-create.options.id.param"), core.I18n.formatMessage("commands.proof-create.options.id.description"))
287
287
  .requiredOption(core.I18n.formatMessage("commands.proof-create.options.private-key.param"), core.I18n.formatMessage("commands.proof-create.options.private-key.description"))
288
- .requiredOption(core.I18n.formatMessage("commands.proof-create.options.document-filename.param"), core.I18n.formatMessage("commands.proof-create.options.document-filename.description"));
288
+ .requiredOption(core.I18n.formatMessage("commands.proof-create.options.document-filename.param"), core.I18n.formatMessage("commands.proof-create.options.document-filename.description"))
289
+ .option(core.I18n.formatMessage("commands.proof-create.options.addressIndex.param"), core.I18n.formatMessage("commands.proof-create.options.addressIndex.description"), "0");
289
290
  cliCore.CLIOptions.output(command, {
290
291
  noConsole: true,
291
292
  json: true,
@@ -307,6 +308,8 @@ function buildCommandProofCreate() {
307
308
  * @param opts The options for the command.
308
309
  * @param opts.id The id of the verification method to use for the credential.
309
310
  * @param opts.privateKey The private key for the verification method.
311
+ * @param opts.documentFilename The filename of the document to create the proof for.
312
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
310
313
  * @param opts.data The data to create the proof for.
311
314
  * @param opts.connector The connector to perform the operations with.
312
315
  * @param opts.node The node URL.
@@ -315,6 +318,7 @@ function buildCommandProofCreate() {
315
318
  async function actionCommandProofCreate(opts) {
316
319
  const id = cliCore.CLIParam.stringValue("id", opts.id);
317
320
  const privateKey = cliCore.CLIParam.hexBase64("private-key", opts.privateKey);
321
+ const addressIndex = cliCore.CLIParam.integer("addressIndex", opts.addressIndex ?? "0", false, 0);
318
322
  const documentFilename = path.resolve(cliCore.CLIParam.stringValue("document-filename", opts.documentFilename));
319
323
  const nodeEndpoint = cliCore.CLIParam.url("node", opts.node);
320
324
  const network = opts.connector === IdentityConnectorTypes.Iota
@@ -322,6 +326,7 @@ async function actionCommandProofCreate(opts) {
322
326
  : undefined;
323
327
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-create.labels.verificationMethodId"), id);
324
328
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-create.labels.documentFilename"), documentFilename);
329
+ cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.proof-create.labels.addressIndex"), addressIndex);
325
330
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
326
331
  if (core.Is.stringValue(network)) {
327
332
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.network"), network);
@@ -334,7 +339,7 @@ async function actionCommandProofCreate(opts) {
334
339
  await vaultConnector.addKey(`${localIdentity}/${vmParts.fragment}`, vaultModels.VaultKeyType.Ed25519, privateKey, new Uint8Array());
335
340
  const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, network }, opts.connector);
336
341
  walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
337
- const identityConnector = setupIdentityConnector({ nodeEndpoint, network }, opts.connector);
342
+ const identityConnector = setupIdentityConnector({ nodeEndpoint, network, addressIndex }, opts.connector);
338
343
  cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.proof-create.progress.creatingProof"));
339
344
  cliCore.CLIDisplay.break();
340
345
  cliCore.CLIDisplay.spinnerStart();
@@ -457,7 +462,8 @@ function buildCommandServiceAdd() {
457
462
  .requiredOption(core.I18n.formatMessage("commands.service-add.options.did.param"), core.I18n.formatMessage("commands.service-add.options.did.description"))
458
463
  .requiredOption(core.I18n.formatMessage("commands.service-add.options.id.param"), core.I18n.formatMessage("commands.service-add.options.id.description"))
459
464
  .requiredOption(core.I18n.formatMessage("commands.service-add.options.type.param"), core.I18n.formatMessage("commands.service-add.options.type.description"))
460
- .requiredOption(core.I18n.formatMessage("commands.service-add.options.endpoint.param"), core.I18n.formatMessage("commands.service-add.options.endpoint.description"));
465
+ .requiredOption(core.I18n.formatMessage("commands.service-add.options.endpoint.param"), core.I18n.formatMessage("commands.service-add.options.endpoint.description"))
466
+ .option(core.I18n.formatMessage("commands.service-add.options.addressIndex.param"), core.I18n.formatMessage("commands.service-add.options.addressIndex.description"), "0");
461
467
  cliCore.CLIOptions.output(command, {
462
468
  noConsole: true,
463
469
  json: true,
@@ -483,6 +489,7 @@ function buildCommandServiceAdd() {
483
489
  * @param opts.id The id of the service to add.
484
490
  * @param opts.type The type of the service to add.
485
491
  * @param opts.endpoint The service endpoint.
492
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
486
493
  * @param opts.connector The connector to perform the operations with.
487
494
  * @param opts.node The node URL.
488
495
  * @param opts.explorer The explorer URL.
@@ -493,6 +500,7 @@ async function actionCommandServiceAdd(opts) {
493
500
  const id = cliCore.CLIParam.stringValue("id", opts.id);
494
501
  const type = cliCore.CLIParam.stringValue("type", opts.type);
495
502
  const endpoint = cliCore.CLIParam.url("endpoint", opts.endpoint);
503
+ const addressIndex = cliCore.CLIParam.integer("addressIndex", opts.addressIndex ?? "0", false, 0);
496
504
  const nodeEndpoint = cliCore.CLIParam.url("node", opts.node);
497
505
  const network = opts.connector === IdentityConnectorTypes.Iota
498
506
  ? cliCore.CLIParam.stringValue("network", opts.network)
@@ -502,6 +510,7 @@ async function actionCommandServiceAdd(opts) {
502
510
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.service-add.labels.serviceId"), id);
503
511
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.service-add.labels.serviceType"), type);
504
512
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.service-add.labels.serviceEndpoint"), endpoint);
513
+ cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.service-add.labels.addressIndex"), addressIndex);
505
514
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
506
515
  if (core.Is.stringValue(network)) {
507
516
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.network"), network);
@@ -515,7 +524,7 @@ async function actionCommandServiceAdd(opts) {
515
524
  await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, core.Converter.bytesToBase64(seed));
516
525
  const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, vaultSeedId, network }, opts.connector);
517
526
  walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
518
- const identityConnector = setupIdentityConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
527
+ const identityConnector = setupIdentityConnector({ nodeEndpoint, network, addressIndex, vaultSeedId }, opts.connector);
519
528
  cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.service-add.progress.addingService"));
520
529
  cliCore.CLIDisplay.break();
521
530
  cliCore.CLIDisplay.spinnerStart();
@@ -554,7 +563,8 @@ function buildCommandServiceRemove() {
554
563
  .summary(core.I18n.formatMessage("commands.service-remove.summary"))
555
564
  .description(core.I18n.formatMessage("commands.service-remove.description"))
556
565
  .requiredOption(core.I18n.formatMessage("commands.service-remove.options.seed.param"), core.I18n.formatMessage("commands.service-remove.options.seed.description"))
557
- .requiredOption(core.I18n.formatMessage("commands.service-remove.options.id.param"), core.I18n.formatMessage("commands.service-remove.options.id.description"));
566
+ .requiredOption(core.I18n.formatMessage("commands.service-remove.options.id.param"), core.I18n.formatMessage("commands.service-remove.options.id.description"))
567
+ .option(core.I18n.formatMessage("commands.service-remove.options.addressIndex.param"), core.I18n.formatMessage("commands.service-remove.options.addressIndex.description"), "0");
558
568
  cliCore.CLIOptions.output(command, {
559
569
  noConsole: true,
560
570
  json: true,
@@ -581,16 +591,19 @@ function buildCommandServiceRemove() {
581
591
  * @param opts.node The node URL.
582
592
  * @param opts.network The network to use for connector.
583
593
  * @param opts.explorer The explorer URL.
594
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
584
595
  */
585
596
  async function actionCommandServiceRemove(opts) {
586
597
  const seed = cliCore.CLIParam.hexBase64("seed", opts.seed);
587
598
  const id = cliCore.CLIParam.stringValue("id", opts.id);
599
+ const addressIndex = cliCore.CLIParam.integer("addressIndex", opts.addressIndex ?? "0", false, 0);
588
600
  const nodeEndpoint = cliCore.CLIParam.url("node", opts.node);
589
601
  const network = opts.connector === IdentityConnectorTypes.Iota
590
602
  ? cliCore.CLIParam.stringValue("network", opts.network)
591
603
  : undefined;
592
604
  const explorerEndpoint = cliCore.CLIParam.url("explorer", opts.explorer);
593
605
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.service-remove.labels.serviceId"), id);
606
+ cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.service-remove.labels.addressIndex"), addressIndex);
594
607
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
595
608
  if (core.Is.stringValue(network)) {
596
609
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.network"), network);
@@ -604,7 +617,7 @@ async function actionCommandServiceRemove(opts) {
604
617
  await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, core.Converter.bytesToBase64(seed));
605
618
  const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, vaultSeedId, network }, opts.connector);
606
619
  walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
607
- const identityConnector = setupIdentityConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
620
+ const identityConnector = setupIdentityConnector({ nodeEndpoint, network, addressIndex, vaultSeedId }, opts.connector);
608
621
  cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.service-remove.progress.removingService"));
609
622
  cliCore.CLIDisplay.break();
610
623
  cliCore.CLIDisplay.spinnerStart();
@@ -637,7 +650,8 @@ function buildCommandVerifiableCredentialCreate() {
637
650
  .requiredOption(core.I18n.formatMessage("commands.verifiable-credential-create.options.private-key.param"), core.I18n.formatMessage("commands.verifiable-credential-create.options.private-key.description"))
638
651
  .option(core.I18n.formatMessage("commands.verifiable-credential-create.options.credential-id.param"), core.I18n.formatMessage("commands.verifiable-credential-create.options.credential-id.description"))
639
652
  .requiredOption(core.I18n.formatMessage("commands.verifiable-credential-create.options.subject-json.param"), core.I18n.formatMessage("commands.verifiable-credential-create.options.subject-json.description"))
640
- .option(core.I18n.formatMessage("commands.verifiable-credential-create.options.revocation-index.param"), core.I18n.formatMessage("commands.verifiable-credential-create.options.revocation-index.description"));
653
+ .option(core.I18n.formatMessage("commands.verifiable-credential-create.options.revocation-index.param"), core.I18n.formatMessage("commands.verifiable-credential-create.options.revocation-index.description"))
654
+ .option(core.I18n.formatMessage("commands.verifiable-credential-create.options.addressIndex.param"), core.I18n.formatMessage("commands.verifiable-credential-create.options.addressIndex.description"), "0");
641
655
  cliCore.CLIOptions.output(command, {
642
656
  noConsole: true,
643
657
  json: true,
@@ -662,6 +676,7 @@ function buildCommandVerifiableCredentialCreate() {
662
676
  * @param opts.credentialId The id of the credential.
663
677
  * @param opts.subjectJson The JSON data for the subject.
664
678
  * @param opts.revocationIndex The revocation index for the credential.
679
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
665
680
  * @param opts.connector The connector to perform the operations with.
666
681
  * @param opts.node The node URL.
667
682
  */
@@ -671,6 +686,7 @@ async function actionCommandVerifiableCredentialCreate(opts) {
671
686
  const credentialId = cliCore.CLIParam.stringValue("credential-id", opts.credentialId);
672
687
  const subjectJson = path.resolve(cliCore.CLIParam.stringValue("subject-json", opts.subjectJson));
673
688
  const revocationIndex = core.Coerce.number(opts.revocationIndex);
689
+ const addressIndex = cliCore.CLIParam.integer("addressIndex", opts.addressIndex ?? "0", false, 0);
674
690
  const nodeEndpoint = cliCore.CLIParam.url("node", opts.node);
675
691
  const network = opts.connector === IdentityConnectorTypes.Iota
676
692
  ? cliCore.CLIParam.stringValue("network", opts.network)
@@ -679,6 +695,7 @@ async function actionCommandVerifiableCredentialCreate(opts) {
679
695
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verifiable-credential-create.labels.credentialId"), credentialId);
680
696
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verifiable-credential-create.labels.subjectJson"), subjectJson);
681
697
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verifiable-credential-create.labels.revocationIndex"), revocationIndex);
698
+ cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verifiable-credential-create.labels.addressIndex"), addressIndex);
682
699
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
683
700
  if (core.Is.stringValue(network)) {
684
701
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.network"), network);
@@ -691,7 +708,7 @@ async function actionCommandVerifiableCredentialCreate(opts) {
691
708
  await vaultConnector.addKey(`${localIdentity}/${vmParts.fragment}`, vaultModels.VaultKeyType.Ed25519, privateKey, new Uint8Array());
692
709
  const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, network }, opts.connector);
693
710
  walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
694
- const identityConnector = setupIdentityConnector({ nodeEndpoint, network }, opts.connector);
711
+ const identityConnector = setupIdentityConnector({ nodeEndpoint, network, addressIndex }, opts.connector);
695
712
  cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.verifiable-credential-create.progress.loadingSubjectData"));
696
713
  cliCore.CLIDisplay.break();
697
714
  const jsonData = await cliCore.CLIUtils.readJsonFile(subjectJson);
@@ -701,7 +718,9 @@ async function actionCommandVerifiableCredentialCreate(opts) {
701
718
  cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.verifiable-credential-create.progress.creatingVerifiableCredential"));
702
719
  cliCore.CLIDisplay.break();
703
720
  cliCore.CLIDisplay.spinnerStart();
704
- const verifiableCredential = await identityConnector.createVerifiableCredential(localIdentity, id, credentialId, jsonData, revocationIndex);
721
+ const verifiableCredential = await identityConnector.createVerifiableCredential(localIdentity, id, credentialId, jsonData, {
722
+ revocationIndex
723
+ });
705
724
  cliCore.CLIDisplay.spinnerStop();
706
725
  if (opts.console) {
707
726
  cliCore.CLIDisplay.section(core.I18n.formatMessage("commands.verifiable-credential-create.labels.verifiableCredential"));
@@ -732,7 +751,8 @@ function buildCommandVerifiableCredentialRevoke() {
732
751
  .description(core.I18n.formatMessage("commands.verifiable-credential-revoke.description"))
733
752
  .requiredOption(core.I18n.formatMessage("commands.verifiable-credential-revoke.options.seed.param"), core.I18n.formatMessage("commands.verifiable-credential-revoke.options.seed.description"))
734
753
  .requiredOption(core.I18n.formatMessage("commands.verifiable-credential-revoke.options.did.param"), core.I18n.formatMessage("commands.verifiable-credential-revoke.options.did.description"))
735
- .requiredOption(core.I18n.formatMessage("commands.verifiable-credential-revoke.options.revocation-index.param"), core.I18n.formatMessage("commands.verifiable-credential-revoke.options.revocation-index.description"));
754
+ .requiredOption(core.I18n.formatMessage("commands.verifiable-credential-revoke.options.revocation-index.param"), core.I18n.formatMessage("commands.verifiable-credential-revoke.options.revocation-index.description"))
755
+ .option(core.I18n.formatMessage("commands.verifiable-credential-revoke.options.addressIndex.param"), core.I18n.formatMessage("commands.verifiable-credential-revoke.options.addressIndex.description"), "0");
736
756
  command
737
757
  .addOption(new commander.Option(core.I18n.formatMessage("commands.common.options.connector.param"), core.I18n.formatMessage("commands.common.options.connector.description"))
738
758
  .choices(Object.values(IdentityConnectorTypes))
@@ -751,17 +771,20 @@ function buildCommandVerifiableCredentialRevoke() {
751
771
  * @param opts.connector The connector to perform the operations with.
752
772
  * @param opts.node The node URL.
753
773
  * @param opts.network The network to use for connector.
774
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
754
775
  */
755
776
  async function actionCommandVerifiableCredentialRevoke(opts) {
756
777
  const seed = cliCore.CLIParam.hexBase64("seed", opts.seed);
757
778
  const did = cliCore.CLIParam.stringValue("did", opts.did);
758
779
  const revocationIndex = cliCore.CLIParam.integer("revocation-index", opts.revocationIndex);
780
+ const addressIndex = cliCore.CLIParam.integer("addressIndex", opts.addressIndex ?? "0", false, 0);
759
781
  const nodeEndpoint = cliCore.CLIParam.url("node", opts.node);
760
782
  const network = opts.connector === IdentityConnectorTypes.Iota
761
783
  ? cliCore.CLIParam.stringValue("network", opts.network)
762
784
  : undefined;
763
785
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.did"), did);
764
786
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verifiable-credential-revoke.labels.revocationIndex"), revocationIndex);
787
+ cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verifiable-credential-revoke.labels.addressIndex"), addressIndex);
765
788
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
766
789
  if (core.Is.stringValue(network)) {
767
790
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.network"), network);
@@ -774,7 +797,7 @@ async function actionCommandVerifiableCredentialRevoke(opts) {
774
797
  await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, core.Converter.bytesToBase64(seed));
775
798
  const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, vaultSeedId, network }, opts.connector);
776
799
  walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
777
- const identityConnector = setupIdentityConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
800
+ const identityConnector = setupIdentityConnector({ nodeEndpoint, network, addressIndex, vaultSeedId }, opts.connector);
778
801
  cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.verifiable-credential-revoke.progress.revokingCredential"));
779
802
  cliCore.CLIDisplay.break();
780
803
  cliCore.CLIDisplay.spinnerStart();
@@ -797,7 +820,8 @@ function buildCommandVerifiableCredentialUnrevoke() {
797
820
  .description(core.I18n.formatMessage("commands.verifiable-credential-unrevoke.description"))
798
821
  .requiredOption(core.I18n.formatMessage("commands.verifiable-credential-unrevoke.options.seed.param"), core.I18n.formatMessage("commands.verifiable-credential-unrevoke.options.seed.description"))
799
822
  .requiredOption(core.I18n.formatMessage("commands.verifiable-credential-unrevoke.options.did.param"), core.I18n.formatMessage("commands.verifiable-credential-unrevoke.options.did.description"))
800
- .requiredOption(core.I18n.formatMessage("commands.verifiable-credential-unrevoke.options.revocation-index.param"), core.I18n.formatMessage("commands.verifiable-credential-unrevoke.options.revocation-index.description"));
823
+ .requiredOption(core.I18n.formatMessage("commands.verifiable-credential-unrevoke.options.revocation-index.param"), core.I18n.formatMessage("commands.verifiable-credential-unrevoke.options.revocation-index.description"))
824
+ .option(core.I18n.formatMessage("commands.verifiable-credential-unrevoke.options.addressIndex.param"), core.I18n.formatMessage("commands.verifiable-credential-unrevoke.options.addressIndex.description"), "0");
801
825
  command
802
826
  .addOption(new commander.Option(core.I18n.formatMessage("commands.common.options.connector.param"), core.I18n.formatMessage("commands.common.options.connector.description"))
803
827
  .choices(Object.values(IdentityConnectorTypes))
@@ -816,17 +840,20 @@ function buildCommandVerifiableCredentialUnrevoke() {
816
840
  * @param opts.connector The connector to perform the operations with.
817
841
  * @param opts.node The node URL.
818
842
  * @param opts.network The network to use for connector.
843
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
819
844
  */
820
845
  async function actionCommandVerifiableCredentialUnrevoke(opts) {
821
846
  const seed = cliCore.CLIParam.hexBase64("seed", opts.seed);
822
847
  const did = cliCore.CLIParam.stringValue("did", opts.did);
823
848
  const revocationIndex = cliCore.CLIParam.integer("revocation-index", opts.revocationIndex);
849
+ const addressIndex = cliCore.CLIParam.integer("addressIndex", opts.addressIndex ?? "0", false, 0);
824
850
  const nodeEndpoint = cliCore.CLIParam.url("node", opts.node);
825
851
  const network = opts.connector === IdentityConnectorTypes.Iota
826
852
  ? cliCore.CLIParam.stringValue("network", opts.network)
827
853
  : undefined;
828
854
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.did"), did);
829
855
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verifiable-credential-unrevoke.labels.revocationIndex"), revocationIndex);
856
+ cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verifiable-credential-unrevoke.labels.addressIndex"), addressIndex);
830
857
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
831
858
  if (core.Is.stringValue(network)) {
832
859
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.network"), network);
@@ -839,7 +866,7 @@ async function actionCommandVerifiableCredentialUnrevoke(opts) {
839
866
  await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, core.Converter.bytesToBase64(seed));
840
867
  const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, vaultSeedId, network }, opts.connector);
841
868
  walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
842
- const identityConnector = setupIdentityConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
869
+ const identityConnector = setupIdentityConnector({ nodeEndpoint, network, addressIndex, vaultSeedId }, opts.connector);
843
870
  cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.verifiable-credential-unrevoke.progress.unrevokingCredential"));
844
871
  cliCore.CLIDisplay.break();
845
872
  cliCore.CLIDisplay.spinnerStart();
@@ -941,7 +968,8 @@ function buildCommandVerificationMethodAdd() {
941
968
  .addOption(new commander.Option(core.I18n.formatMessage("commands.verification-method-add.options.type.param"), core.I18n.formatMessage("commands.verification-method-add.options.type.description"))
942
969
  .choices(Object.values(standardsW3cDid.DidVerificationMethodType))
943
970
  .makeOptionMandatory())
944
- .option(core.I18n.formatMessage("commands.verification-method-add.options.id.param"), core.I18n.formatMessage("commands.verification-method-add.options.id.description"));
971
+ .option(core.I18n.formatMessage("commands.verification-method-add.options.id.param"), core.I18n.formatMessage("commands.verification-method-add.options.id.description"))
972
+ .option(core.I18n.formatMessage("commands.verification-method-add.options.addressIndex.param"), core.I18n.formatMessage("commands.verification-method-add.options.addressIndex.description"), "0");
945
973
  cliCore.CLIOptions.output(command, {
946
974
  noConsole: true,
947
975
  json: true,
@@ -969,11 +997,14 @@ function buildCommandVerificationMethodAdd() {
969
997
  * @param opts.connector The connector to perform the operations with.
970
998
  * @param opts.node The node URL.
971
999
  * @param opts.explorer The explorer URL.
1000
+ * @param opts.network The network to use for connector.
1001
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
972
1002
  */
973
1003
  async function actionCommandVerificationMethodAdd(opts) {
974
1004
  const seed = cliCore.CLIParam.hexBase64("seed", opts.seed);
975
1005
  const did = cliCore.CLIParam.stringValue("did", opts.did);
976
1006
  const type = cliCore.CLIParam.stringValue("type", opts.type);
1007
+ const addressIndex = cliCore.CLIParam.integer("addressIndex", opts.addressIndex ?? "0", false, 0);
977
1008
  const nodeEndpoint = cliCore.CLIParam.url("node", opts.node);
978
1009
  const network = opts.connector === IdentityConnectorTypes.Iota
979
1010
  ? cliCore.CLIParam.stringValue("network", opts.network)
@@ -984,6 +1015,7 @@ async function actionCommandVerificationMethodAdd(opts) {
984
1015
  if (core.Is.stringValue(opts.id)) {
985
1016
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verification-method-add.labels.verificationMethodId"), opts?.id);
986
1017
  }
1018
+ cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verification-method-add.labels.addressIndex"), addressIndex);
987
1019
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
988
1020
  if (core.Is.stringValue(network)) {
989
1021
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.network"), network);
@@ -997,7 +1029,7 @@ async function actionCommandVerificationMethodAdd(opts) {
997
1029
  await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, core.Converter.bytesToBase64(seed));
998
1030
  const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, vaultSeedId, network }, opts.connector);
999
1031
  walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
1000
- const identityConnector = setupIdentityConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
1032
+ const identityConnector = setupIdentityConnector({ nodeEndpoint, network, addressIndex, vaultSeedId }, opts.connector);
1001
1033
  cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.verification-method-add.progress.addingVerificationMethod"));
1002
1034
  cliCore.CLIDisplay.break();
1003
1035
  cliCore.CLIDisplay.spinnerStart();
@@ -1061,7 +1093,8 @@ function buildCommandVerificationMethodRemove() {
1061
1093
  .summary(core.I18n.formatMessage("commands.verification-method-remove.summary"))
1062
1094
  .description(core.I18n.formatMessage("commands.verification-method-remove.description"))
1063
1095
  .requiredOption(core.I18n.formatMessage("commands.verification-method-remove.options.seed.param"), core.I18n.formatMessage("commands.verification-method-remove.options.seed.description"))
1064
- .requiredOption(core.I18n.formatMessage("commands.verification-method-remove.options.id.param"), core.I18n.formatMessage("commands.verification-method-remove.options.id.description"));
1096
+ .requiredOption(core.I18n.formatMessage("commands.verification-method-remove.options.id.param"), core.I18n.formatMessage("commands.verification-method-remove.options.id.description"))
1097
+ .option(core.I18n.formatMessage("commands.verification-method-remove.options.addressIndex.param"), core.I18n.formatMessage("commands.verification-method-remove.options.addressIndex.description"), "0");
1065
1098
  cliCore.CLIOptions.output(command, {
1066
1099
  noConsole: true,
1067
1100
  json: true,
@@ -1088,16 +1121,19 @@ function buildCommandVerificationMethodRemove() {
1088
1121
  * @param opts.node The node URL.
1089
1122
  * @param opts.explorer The explorer URL.
1090
1123
  * @param opts.network The network to use for connector.
1124
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
1091
1125
  */
1092
1126
  async function actionCommandVerificationMethodRemove(opts) {
1093
1127
  const seed = cliCore.CLIParam.hexBase64("seed", opts.seed);
1094
1128
  const id = cliCore.CLIParam.stringValue("id", opts.id);
1129
+ const addressIndex = cliCore.CLIParam.integer("addressIndex", opts.addressIndex ?? "0", false, 0);
1095
1130
  const nodeEndpoint = cliCore.CLIParam.url("node", opts.node);
1096
1131
  const network = opts.connector === IdentityConnectorTypes.Iota
1097
1132
  ? cliCore.CLIParam.stringValue("network", opts.network)
1098
1133
  : undefined;
1099
1134
  const explorerEndpoint = cliCore.CLIParam.url("explorer", opts.explorer);
1100
- cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verification-method-add.labels.verificationMethodId"), id);
1135
+ cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verification-method-remove.labels.verificationMethodId"), id);
1136
+ cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.verification-method-remove.labels.addressIndex"), addressIndex);
1101
1137
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
1102
1138
  if (core.Is.stringValue(network)) {
1103
1139
  cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.common.labels.network"), network);
@@ -1111,7 +1147,7 @@ async function actionCommandVerificationMethodRemove(opts) {
1111
1147
  await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, core.Converter.bytesToBase64(seed));
1112
1148
  const walletConnector = walletCli.setupWalletConnector({ nodeEndpoint, vaultSeedId, network }, opts.connector);
1113
1149
  walletModels.WalletConnectorFactory.register("wallet", () => walletConnector);
1114
- const identityConnector = setupIdentityConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
1150
+ const identityConnector = setupIdentityConnector({ nodeEndpoint, network, addressIndex, vaultSeedId }, opts.connector);
1115
1151
  cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.verification-method-remove.progress.removingVerificationMethod"));
1116
1152
  cliCore.CLIDisplay.break();
1117
1153
  cliCore.CLIDisplay.spinnerStart();
@@ -1146,7 +1182,7 @@ class CLI extends cliCore.CLIBase {
1146
1182
  return this.execute({
1147
1183
  title: "TWIN Identity",
1148
1184
  appName: "twin-identity",
1149
- version: "0.0.2-next.3", // x-release-please-version
1185
+ version: "0.0.2-next.5", // x-release-please-version
1150
1186
  icon: "🌍",
1151
1187
  supportsEnvFiles: true,
1152
1188
  overrideOutputWidth: options?.overrideOutputWidth,
@@ -282,7 +282,8 @@ function buildCommandProofCreate() {
282
282
  .description(I18n.formatMessage("commands.proof-create.description"))
283
283
  .requiredOption(I18n.formatMessage("commands.proof-create.options.id.param"), I18n.formatMessage("commands.proof-create.options.id.description"))
284
284
  .requiredOption(I18n.formatMessage("commands.proof-create.options.private-key.param"), I18n.formatMessage("commands.proof-create.options.private-key.description"))
285
- .requiredOption(I18n.formatMessage("commands.proof-create.options.document-filename.param"), I18n.formatMessage("commands.proof-create.options.document-filename.description"));
285
+ .requiredOption(I18n.formatMessage("commands.proof-create.options.document-filename.param"), I18n.formatMessage("commands.proof-create.options.document-filename.description"))
286
+ .option(I18n.formatMessage("commands.proof-create.options.addressIndex.param"), I18n.formatMessage("commands.proof-create.options.addressIndex.description"), "0");
286
287
  CLIOptions.output(command, {
287
288
  noConsole: true,
288
289
  json: true,
@@ -304,6 +305,8 @@ function buildCommandProofCreate() {
304
305
  * @param opts The options for the command.
305
306
  * @param opts.id The id of the verification method to use for the credential.
306
307
  * @param opts.privateKey The private key for the verification method.
308
+ * @param opts.documentFilename The filename of the document to create the proof for.
309
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
307
310
  * @param opts.data The data to create the proof for.
308
311
  * @param opts.connector The connector to perform the operations with.
309
312
  * @param opts.node The node URL.
@@ -312,6 +315,7 @@ function buildCommandProofCreate() {
312
315
  async function actionCommandProofCreate(opts) {
313
316
  const id = CLIParam.stringValue("id", opts.id);
314
317
  const privateKey = CLIParam.hexBase64("private-key", opts.privateKey);
318
+ const addressIndex = CLIParam.integer("addressIndex", opts.addressIndex ?? "0", false, 0);
315
319
  const documentFilename = path.resolve(CLIParam.stringValue("document-filename", opts.documentFilename));
316
320
  const nodeEndpoint = CLIParam.url("node", opts.node);
317
321
  const network = opts.connector === IdentityConnectorTypes.Iota
@@ -319,6 +323,7 @@ async function actionCommandProofCreate(opts) {
319
323
  : undefined;
320
324
  CLIDisplay.value(I18n.formatMessage("commands.proof-create.labels.verificationMethodId"), id);
321
325
  CLIDisplay.value(I18n.formatMessage("commands.proof-create.labels.documentFilename"), documentFilename);
326
+ CLIDisplay.value(I18n.formatMessage("commands.proof-create.labels.addressIndex"), addressIndex);
322
327
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
323
328
  if (Is.stringValue(network)) {
324
329
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.network"), network);
@@ -331,7 +336,7 @@ async function actionCommandProofCreate(opts) {
331
336
  await vaultConnector.addKey(`${localIdentity}/${vmParts.fragment}`, VaultKeyType.Ed25519, privateKey, new Uint8Array());
332
337
  const walletConnector = setupWalletConnector({ nodeEndpoint, network }, opts.connector);
333
338
  WalletConnectorFactory.register("wallet", () => walletConnector);
334
- const identityConnector = setupIdentityConnector({ nodeEndpoint, network }, opts.connector);
339
+ const identityConnector = setupIdentityConnector({ nodeEndpoint, network, addressIndex }, opts.connector);
335
340
  CLIDisplay.task(I18n.formatMessage("commands.proof-create.progress.creatingProof"));
336
341
  CLIDisplay.break();
337
342
  CLIDisplay.spinnerStart();
@@ -454,7 +459,8 @@ function buildCommandServiceAdd() {
454
459
  .requiredOption(I18n.formatMessage("commands.service-add.options.did.param"), I18n.formatMessage("commands.service-add.options.did.description"))
455
460
  .requiredOption(I18n.formatMessage("commands.service-add.options.id.param"), I18n.formatMessage("commands.service-add.options.id.description"))
456
461
  .requiredOption(I18n.formatMessage("commands.service-add.options.type.param"), I18n.formatMessage("commands.service-add.options.type.description"))
457
- .requiredOption(I18n.formatMessage("commands.service-add.options.endpoint.param"), I18n.formatMessage("commands.service-add.options.endpoint.description"));
462
+ .requiredOption(I18n.formatMessage("commands.service-add.options.endpoint.param"), I18n.formatMessage("commands.service-add.options.endpoint.description"))
463
+ .option(I18n.formatMessage("commands.service-add.options.addressIndex.param"), I18n.formatMessage("commands.service-add.options.addressIndex.description"), "0");
458
464
  CLIOptions.output(command, {
459
465
  noConsole: true,
460
466
  json: true,
@@ -480,6 +486,7 @@ function buildCommandServiceAdd() {
480
486
  * @param opts.id The id of the service to add.
481
487
  * @param opts.type The type of the service to add.
482
488
  * @param opts.endpoint The service endpoint.
489
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
483
490
  * @param opts.connector The connector to perform the operations with.
484
491
  * @param opts.node The node URL.
485
492
  * @param opts.explorer The explorer URL.
@@ -490,6 +497,7 @@ async function actionCommandServiceAdd(opts) {
490
497
  const id = CLIParam.stringValue("id", opts.id);
491
498
  const type = CLIParam.stringValue("type", opts.type);
492
499
  const endpoint = CLIParam.url("endpoint", opts.endpoint);
500
+ const addressIndex = CLIParam.integer("addressIndex", opts.addressIndex ?? "0", false, 0);
493
501
  const nodeEndpoint = CLIParam.url("node", opts.node);
494
502
  const network = opts.connector === IdentityConnectorTypes.Iota
495
503
  ? CLIParam.stringValue("network", opts.network)
@@ -499,6 +507,7 @@ async function actionCommandServiceAdd(opts) {
499
507
  CLIDisplay.value(I18n.formatMessage("commands.service-add.labels.serviceId"), id);
500
508
  CLIDisplay.value(I18n.formatMessage("commands.service-add.labels.serviceType"), type);
501
509
  CLIDisplay.value(I18n.formatMessage("commands.service-add.labels.serviceEndpoint"), endpoint);
510
+ CLIDisplay.value(I18n.formatMessage("commands.service-add.labels.addressIndex"), addressIndex);
502
511
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
503
512
  if (Is.stringValue(network)) {
504
513
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.network"), network);
@@ -512,7 +521,7 @@ async function actionCommandServiceAdd(opts) {
512
521
  await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, Converter.bytesToBase64(seed));
513
522
  const walletConnector = setupWalletConnector({ nodeEndpoint, vaultSeedId, network }, opts.connector);
514
523
  WalletConnectorFactory.register("wallet", () => walletConnector);
515
- const identityConnector = setupIdentityConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
524
+ const identityConnector = setupIdentityConnector({ nodeEndpoint, network, addressIndex, vaultSeedId }, opts.connector);
516
525
  CLIDisplay.task(I18n.formatMessage("commands.service-add.progress.addingService"));
517
526
  CLIDisplay.break();
518
527
  CLIDisplay.spinnerStart();
@@ -551,7 +560,8 @@ function buildCommandServiceRemove() {
551
560
  .summary(I18n.formatMessage("commands.service-remove.summary"))
552
561
  .description(I18n.formatMessage("commands.service-remove.description"))
553
562
  .requiredOption(I18n.formatMessage("commands.service-remove.options.seed.param"), I18n.formatMessage("commands.service-remove.options.seed.description"))
554
- .requiredOption(I18n.formatMessage("commands.service-remove.options.id.param"), I18n.formatMessage("commands.service-remove.options.id.description"));
563
+ .requiredOption(I18n.formatMessage("commands.service-remove.options.id.param"), I18n.formatMessage("commands.service-remove.options.id.description"))
564
+ .option(I18n.formatMessage("commands.service-remove.options.addressIndex.param"), I18n.formatMessage("commands.service-remove.options.addressIndex.description"), "0");
555
565
  CLIOptions.output(command, {
556
566
  noConsole: true,
557
567
  json: true,
@@ -578,16 +588,19 @@ function buildCommandServiceRemove() {
578
588
  * @param opts.node The node URL.
579
589
  * @param opts.network The network to use for connector.
580
590
  * @param opts.explorer The explorer URL.
591
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
581
592
  */
582
593
  async function actionCommandServiceRemove(opts) {
583
594
  const seed = CLIParam.hexBase64("seed", opts.seed);
584
595
  const id = CLIParam.stringValue("id", opts.id);
596
+ const addressIndex = CLIParam.integer("addressIndex", opts.addressIndex ?? "0", false, 0);
585
597
  const nodeEndpoint = CLIParam.url("node", opts.node);
586
598
  const network = opts.connector === IdentityConnectorTypes.Iota
587
599
  ? CLIParam.stringValue("network", opts.network)
588
600
  : undefined;
589
601
  const explorerEndpoint = CLIParam.url("explorer", opts.explorer);
590
602
  CLIDisplay.value(I18n.formatMessage("commands.service-remove.labels.serviceId"), id);
603
+ CLIDisplay.value(I18n.formatMessage("commands.service-remove.labels.addressIndex"), addressIndex);
591
604
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
592
605
  if (Is.stringValue(network)) {
593
606
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.network"), network);
@@ -601,7 +614,7 @@ async function actionCommandServiceRemove(opts) {
601
614
  await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, Converter.bytesToBase64(seed));
602
615
  const walletConnector = setupWalletConnector({ nodeEndpoint, vaultSeedId, network }, opts.connector);
603
616
  WalletConnectorFactory.register("wallet", () => walletConnector);
604
- const identityConnector = setupIdentityConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
617
+ const identityConnector = setupIdentityConnector({ nodeEndpoint, network, addressIndex, vaultSeedId }, opts.connector);
605
618
  CLIDisplay.task(I18n.formatMessage("commands.service-remove.progress.removingService"));
606
619
  CLIDisplay.break();
607
620
  CLIDisplay.spinnerStart();
@@ -634,7 +647,8 @@ function buildCommandVerifiableCredentialCreate() {
634
647
  .requiredOption(I18n.formatMessage("commands.verifiable-credential-create.options.private-key.param"), I18n.formatMessage("commands.verifiable-credential-create.options.private-key.description"))
635
648
  .option(I18n.formatMessage("commands.verifiable-credential-create.options.credential-id.param"), I18n.formatMessage("commands.verifiable-credential-create.options.credential-id.description"))
636
649
  .requiredOption(I18n.formatMessage("commands.verifiable-credential-create.options.subject-json.param"), I18n.formatMessage("commands.verifiable-credential-create.options.subject-json.description"))
637
- .option(I18n.formatMessage("commands.verifiable-credential-create.options.revocation-index.param"), I18n.formatMessage("commands.verifiable-credential-create.options.revocation-index.description"));
650
+ .option(I18n.formatMessage("commands.verifiable-credential-create.options.revocation-index.param"), I18n.formatMessage("commands.verifiable-credential-create.options.revocation-index.description"))
651
+ .option(I18n.formatMessage("commands.verifiable-credential-create.options.addressIndex.param"), I18n.formatMessage("commands.verifiable-credential-create.options.addressIndex.description"), "0");
638
652
  CLIOptions.output(command, {
639
653
  noConsole: true,
640
654
  json: true,
@@ -659,6 +673,7 @@ function buildCommandVerifiableCredentialCreate() {
659
673
  * @param opts.credentialId The id of the credential.
660
674
  * @param opts.subjectJson The JSON data for the subject.
661
675
  * @param opts.revocationIndex The revocation index for the credential.
676
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
662
677
  * @param opts.connector The connector to perform the operations with.
663
678
  * @param opts.node The node URL.
664
679
  */
@@ -668,6 +683,7 @@ async function actionCommandVerifiableCredentialCreate(opts) {
668
683
  const credentialId = CLIParam.stringValue("credential-id", opts.credentialId);
669
684
  const subjectJson = path.resolve(CLIParam.stringValue("subject-json", opts.subjectJson));
670
685
  const revocationIndex = Coerce.number(opts.revocationIndex);
686
+ const addressIndex = CLIParam.integer("addressIndex", opts.addressIndex ?? "0", false, 0);
671
687
  const nodeEndpoint = CLIParam.url("node", opts.node);
672
688
  const network = opts.connector === IdentityConnectorTypes.Iota
673
689
  ? CLIParam.stringValue("network", opts.network)
@@ -676,6 +692,7 @@ async function actionCommandVerifiableCredentialCreate(opts) {
676
692
  CLIDisplay.value(I18n.formatMessage("commands.verifiable-credential-create.labels.credentialId"), credentialId);
677
693
  CLIDisplay.value(I18n.formatMessage("commands.verifiable-credential-create.labels.subjectJson"), subjectJson);
678
694
  CLIDisplay.value(I18n.formatMessage("commands.verifiable-credential-create.labels.revocationIndex"), revocationIndex);
695
+ CLIDisplay.value(I18n.formatMessage("commands.verifiable-credential-create.labels.addressIndex"), addressIndex);
679
696
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
680
697
  if (Is.stringValue(network)) {
681
698
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.network"), network);
@@ -688,7 +705,7 @@ async function actionCommandVerifiableCredentialCreate(opts) {
688
705
  await vaultConnector.addKey(`${localIdentity}/${vmParts.fragment}`, VaultKeyType.Ed25519, privateKey, new Uint8Array());
689
706
  const walletConnector = setupWalletConnector({ nodeEndpoint, network }, opts.connector);
690
707
  WalletConnectorFactory.register("wallet", () => walletConnector);
691
- const identityConnector = setupIdentityConnector({ nodeEndpoint, network }, opts.connector);
708
+ const identityConnector = setupIdentityConnector({ nodeEndpoint, network, addressIndex }, opts.connector);
692
709
  CLIDisplay.task(I18n.formatMessage("commands.verifiable-credential-create.progress.loadingSubjectData"));
693
710
  CLIDisplay.break();
694
711
  const jsonData = await CLIUtils.readJsonFile(subjectJson);
@@ -698,7 +715,9 @@ async function actionCommandVerifiableCredentialCreate(opts) {
698
715
  CLIDisplay.task(I18n.formatMessage("commands.verifiable-credential-create.progress.creatingVerifiableCredential"));
699
716
  CLIDisplay.break();
700
717
  CLIDisplay.spinnerStart();
701
- const verifiableCredential = await identityConnector.createVerifiableCredential(localIdentity, id, credentialId, jsonData, revocationIndex);
718
+ const verifiableCredential = await identityConnector.createVerifiableCredential(localIdentity, id, credentialId, jsonData, {
719
+ revocationIndex
720
+ });
702
721
  CLIDisplay.spinnerStop();
703
722
  if (opts.console) {
704
723
  CLIDisplay.section(I18n.formatMessage("commands.verifiable-credential-create.labels.verifiableCredential"));
@@ -729,7 +748,8 @@ function buildCommandVerifiableCredentialRevoke() {
729
748
  .description(I18n.formatMessage("commands.verifiable-credential-revoke.description"))
730
749
  .requiredOption(I18n.formatMessage("commands.verifiable-credential-revoke.options.seed.param"), I18n.formatMessage("commands.verifiable-credential-revoke.options.seed.description"))
731
750
  .requiredOption(I18n.formatMessage("commands.verifiable-credential-revoke.options.did.param"), I18n.formatMessage("commands.verifiable-credential-revoke.options.did.description"))
732
- .requiredOption(I18n.formatMessage("commands.verifiable-credential-revoke.options.revocation-index.param"), I18n.formatMessage("commands.verifiable-credential-revoke.options.revocation-index.description"));
751
+ .requiredOption(I18n.formatMessage("commands.verifiable-credential-revoke.options.revocation-index.param"), I18n.formatMessage("commands.verifiable-credential-revoke.options.revocation-index.description"))
752
+ .option(I18n.formatMessage("commands.verifiable-credential-revoke.options.addressIndex.param"), I18n.formatMessage("commands.verifiable-credential-revoke.options.addressIndex.description"), "0");
733
753
  command
734
754
  .addOption(new Option(I18n.formatMessage("commands.common.options.connector.param"), I18n.formatMessage("commands.common.options.connector.description"))
735
755
  .choices(Object.values(IdentityConnectorTypes))
@@ -748,17 +768,20 @@ function buildCommandVerifiableCredentialRevoke() {
748
768
  * @param opts.connector The connector to perform the operations with.
749
769
  * @param opts.node The node URL.
750
770
  * @param opts.network The network to use for connector.
771
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
751
772
  */
752
773
  async function actionCommandVerifiableCredentialRevoke(opts) {
753
774
  const seed = CLIParam.hexBase64("seed", opts.seed);
754
775
  const did = CLIParam.stringValue("did", opts.did);
755
776
  const revocationIndex = CLIParam.integer("revocation-index", opts.revocationIndex);
777
+ const addressIndex = CLIParam.integer("addressIndex", opts.addressIndex ?? "0", false, 0);
756
778
  const nodeEndpoint = CLIParam.url("node", opts.node);
757
779
  const network = opts.connector === IdentityConnectorTypes.Iota
758
780
  ? CLIParam.stringValue("network", opts.network)
759
781
  : undefined;
760
782
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.did"), did);
761
783
  CLIDisplay.value(I18n.formatMessage("commands.verifiable-credential-revoke.labels.revocationIndex"), revocationIndex);
784
+ CLIDisplay.value(I18n.formatMessage("commands.verifiable-credential-revoke.labels.addressIndex"), addressIndex);
762
785
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
763
786
  if (Is.stringValue(network)) {
764
787
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.network"), network);
@@ -771,7 +794,7 @@ async function actionCommandVerifiableCredentialRevoke(opts) {
771
794
  await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, Converter.bytesToBase64(seed));
772
795
  const walletConnector = setupWalletConnector({ nodeEndpoint, vaultSeedId, network }, opts.connector);
773
796
  WalletConnectorFactory.register("wallet", () => walletConnector);
774
- const identityConnector = setupIdentityConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
797
+ const identityConnector = setupIdentityConnector({ nodeEndpoint, network, addressIndex, vaultSeedId }, opts.connector);
775
798
  CLIDisplay.task(I18n.formatMessage("commands.verifiable-credential-revoke.progress.revokingCredential"));
776
799
  CLIDisplay.break();
777
800
  CLIDisplay.spinnerStart();
@@ -794,7 +817,8 @@ function buildCommandVerifiableCredentialUnrevoke() {
794
817
  .description(I18n.formatMessage("commands.verifiable-credential-unrevoke.description"))
795
818
  .requiredOption(I18n.formatMessage("commands.verifiable-credential-unrevoke.options.seed.param"), I18n.formatMessage("commands.verifiable-credential-unrevoke.options.seed.description"))
796
819
  .requiredOption(I18n.formatMessage("commands.verifiable-credential-unrevoke.options.did.param"), I18n.formatMessage("commands.verifiable-credential-unrevoke.options.did.description"))
797
- .requiredOption(I18n.formatMessage("commands.verifiable-credential-unrevoke.options.revocation-index.param"), I18n.formatMessage("commands.verifiable-credential-unrevoke.options.revocation-index.description"));
820
+ .requiredOption(I18n.formatMessage("commands.verifiable-credential-unrevoke.options.revocation-index.param"), I18n.formatMessage("commands.verifiable-credential-unrevoke.options.revocation-index.description"))
821
+ .option(I18n.formatMessage("commands.verifiable-credential-unrevoke.options.addressIndex.param"), I18n.formatMessage("commands.verifiable-credential-unrevoke.options.addressIndex.description"), "0");
798
822
  command
799
823
  .addOption(new Option(I18n.formatMessage("commands.common.options.connector.param"), I18n.formatMessage("commands.common.options.connector.description"))
800
824
  .choices(Object.values(IdentityConnectorTypes))
@@ -813,17 +837,20 @@ function buildCommandVerifiableCredentialUnrevoke() {
813
837
  * @param opts.connector The connector to perform the operations with.
814
838
  * @param opts.node The node URL.
815
839
  * @param opts.network The network to use for connector.
840
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
816
841
  */
817
842
  async function actionCommandVerifiableCredentialUnrevoke(opts) {
818
843
  const seed = CLIParam.hexBase64("seed", opts.seed);
819
844
  const did = CLIParam.stringValue("did", opts.did);
820
845
  const revocationIndex = CLIParam.integer("revocation-index", opts.revocationIndex);
846
+ const addressIndex = CLIParam.integer("addressIndex", opts.addressIndex ?? "0", false, 0);
821
847
  const nodeEndpoint = CLIParam.url("node", opts.node);
822
848
  const network = opts.connector === IdentityConnectorTypes.Iota
823
849
  ? CLIParam.stringValue("network", opts.network)
824
850
  : undefined;
825
851
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.did"), did);
826
852
  CLIDisplay.value(I18n.formatMessage("commands.verifiable-credential-unrevoke.labels.revocationIndex"), revocationIndex);
853
+ CLIDisplay.value(I18n.formatMessage("commands.verifiable-credential-unrevoke.labels.addressIndex"), addressIndex);
827
854
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
828
855
  if (Is.stringValue(network)) {
829
856
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.network"), network);
@@ -836,7 +863,7 @@ async function actionCommandVerifiableCredentialUnrevoke(opts) {
836
863
  await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, Converter.bytesToBase64(seed));
837
864
  const walletConnector = setupWalletConnector({ nodeEndpoint, vaultSeedId, network }, opts.connector);
838
865
  WalletConnectorFactory.register("wallet", () => walletConnector);
839
- const identityConnector = setupIdentityConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
866
+ const identityConnector = setupIdentityConnector({ nodeEndpoint, network, addressIndex, vaultSeedId }, opts.connector);
840
867
  CLIDisplay.task(I18n.formatMessage("commands.verifiable-credential-unrevoke.progress.unrevokingCredential"));
841
868
  CLIDisplay.break();
842
869
  CLIDisplay.spinnerStart();
@@ -938,7 +965,8 @@ function buildCommandVerificationMethodAdd() {
938
965
  .addOption(new Option(I18n.formatMessage("commands.verification-method-add.options.type.param"), I18n.formatMessage("commands.verification-method-add.options.type.description"))
939
966
  .choices(Object.values(DidVerificationMethodType))
940
967
  .makeOptionMandatory())
941
- .option(I18n.formatMessage("commands.verification-method-add.options.id.param"), I18n.formatMessage("commands.verification-method-add.options.id.description"));
968
+ .option(I18n.formatMessage("commands.verification-method-add.options.id.param"), I18n.formatMessage("commands.verification-method-add.options.id.description"))
969
+ .option(I18n.formatMessage("commands.verification-method-add.options.addressIndex.param"), I18n.formatMessage("commands.verification-method-add.options.addressIndex.description"), "0");
942
970
  CLIOptions.output(command, {
943
971
  noConsole: true,
944
972
  json: true,
@@ -966,11 +994,14 @@ function buildCommandVerificationMethodAdd() {
966
994
  * @param opts.connector The connector to perform the operations with.
967
995
  * @param opts.node The node URL.
968
996
  * @param opts.explorer The explorer URL.
997
+ * @param opts.network The network to use for connector.
998
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
969
999
  */
970
1000
  async function actionCommandVerificationMethodAdd(opts) {
971
1001
  const seed = CLIParam.hexBase64("seed", opts.seed);
972
1002
  const did = CLIParam.stringValue("did", opts.did);
973
1003
  const type = CLIParam.stringValue("type", opts.type);
1004
+ const addressIndex = CLIParam.integer("addressIndex", opts.addressIndex ?? "0", false, 0);
974
1005
  const nodeEndpoint = CLIParam.url("node", opts.node);
975
1006
  const network = opts.connector === IdentityConnectorTypes.Iota
976
1007
  ? CLIParam.stringValue("network", opts.network)
@@ -981,6 +1012,7 @@ async function actionCommandVerificationMethodAdd(opts) {
981
1012
  if (Is.stringValue(opts.id)) {
982
1013
  CLIDisplay.value(I18n.formatMessage("commands.verification-method-add.labels.verificationMethodId"), opts?.id);
983
1014
  }
1015
+ CLIDisplay.value(I18n.formatMessage("commands.verification-method-add.labels.addressIndex"), addressIndex);
984
1016
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
985
1017
  if (Is.stringValue(network)) {
986
1018
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.network"), network);
@@ -994,7 +1026,7 @@ async function actionCommandVerificationMethodAdd(opts) {
994
1026
  await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, Converter.bytesToBase64(seed));
995
1027
  const walletConnector = setupWalletConnector({ nodeEndpoint, vaultSeedId, network }, opts.connector);
996
1028
  WalletConnectorFactory.register("wallet", () => walletConnector);
997
- const identityConnector = setupIdentityConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
1029
+ const identityConnector = setupIdentityConnector({ nodeEndpoint, network, addressIndex, vaultSeedId }, opts.connector);
998
1030
  CLIDisplay.task(I18n.formatMessage("commands.verification-method-add.progress.addingVerificationMethod"));
999
1031
  CLIDisplay.break();
1000
1032
  CLIDisplay.spinnerStart();
@@ -1058,7 +1090,8 @@ function buildCommandVerificationMethodRemove() {
1058
1090
  .summary(I18n.formatMessage("commands.verification-method-remove.summary"))
1059
1091
  .description(I18n.formatMessage("commands.verification-method-remove.description"))
1060
1092
  .requiredOption(I18n.formatMessage("commands.verification-method-remove.options.seed.param"), I18n.formatMessage("commands.verification-method-remove.options.seed.description"))
1061
- .requiredOption(I18n.formatMessage("commands.verification-method-remove.options.id.param"), I18n.formatMessage("commands.verification-method-remove.options.id.description"));
1093
+ .requiredOption(I18n.formatMessage("commands.verification-method-remove.options.id.param"), I18n.formatMessage("commands.verification-method-remove.options.id.description"))
1094
+ .option(I18n.formatMessage("commands.verification-method-remove.options.addressIndex.param"), I18n.formatMessage("commands.verification-method-remove.options.addressIndex.description"), "0");
1062
1095
  CLIOptions.output(command, {
1063
1096
  noConsole: true,
1064
1097
  json: true,
@@ -1085,16 +1118,19 @@ function buildCommandVerificationMethodRemove() {
1085
1118
  * @param opts.node The node URL.
1086
1119
  * @param opts.explorer The explorer URL.
1087
1120
  * @param opts.network The network to use for connector.
1121
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
1088
1122
  */
1089
1123
  async function actionCommandVerificationMethodRemove(opts) {
1090
1124
  const seed = CLIParam.hexBase64("seed", opts.seed);
1091
1125
  const id = CLIParam.stringValue("id", opts.id);
1126
+ const addressIndex = CLIParam.integer("addressIndex", opts.addressIndex ?? "0", false, 0);
1092
1127
  const nodeEndpoint = CLIParam.url("node", opts.node);
1093
1128
  const network = opts.connector === IdentityConnectorTypes.Iota
1094
1129
  ? CLIParam.stringValue("network", opts.network)
1095
1130
  : undefined;
1096
1131
  const explorerEndpoint = CLIParam.url("explorer", opts.explorer);
1097
- CLIDisplay.value(I18n.formatMessage("commands.verification-method-add.labels.verificationMethodId"), id);
1132
+ CLIDisplay.value(I18n.formatMessage("commands.verification-method-remove.labels.verificationMethodId"), id);
1133
+ CLIDisplay.value(I18n.formatMessage("commands.verification-method-remove.labels.addressIndex"), addressIndex);
1098
1134
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.node"), nodeEndpoint);
1099
1135
  if (Is.stringValue(network)) {
1100
1136
  CLIDisplay.value(I18n.formatMessage("commands.common.labels.network"), network);
@@ -1108,7 +1144,7 @@ async function actionCommandVerificationMethodRemove(opts) {
1108
1144
  await vaultConnector.setSecret(`${localIdentity}/${vaultSeedId}`, Converter.bytesToBase64(seed));
1109
1145
  const walletConnector = setupWalletConnector({ nodeEndpoint, vaultSeedId, network }, opts.connector);
1110
1146
  WalletConnectorFactory.register("wallet", () => walletConnector);
1111
- const identityConnector = setupIdentityConnector({ nodeEndpoint, network, vaultSeedId }, opts.connector);
1147
+ const identityConnector = setupIdentityConnector({ nodeEndpoint, network, addressIndex, vaultSeedId }, opts.connector);
1112
1148
  CLIDisplay.task(I18n.formatMessage("commands.verification-method-remove.progress.removingVerificationMethod"));
1113
1149
  CLIDisplay.break();
1114
1150
  CLIDisplay.spinnerStart();
@@ -1143,7 +1179,7 @@ class CLI extends CLIBase {
1143
1179
  return this.execute({
1144
1180
  title: "TWIN Identity",
1145
1181
  appName: "twin-identity",
1146
- version: "0.0.2-next.3", // x-release-please-version
1182
+ version: "0.0.2-next.5", // x-release-please-version
1147
1183
  icon: "🌍",
1148
1184
  supportsEnvFiles: true,
1149
1185
  overrideOutputWidth: options?.overrideOutputWidth,
@@ -650,6 +650,10 @@
650
650
  "id": {
651
651
  "param": "--id '<'id'>'",
652
652
  "description": "The optional id of verification method to add, if not provided one will be generated."
653
+ },
654
+ "addressIndex": {
655
+ "param": "--address-index '<'index'>'",
656
+ "description": "The address index to use for the identity controller."
653
657
  }
654
658
  },
655
659
  "progress": {
@@ -662,7 +666,8 @@
662
666
  "publicKeyBase64": "Public Key Base64",
663
667
  "privateKeyHex": "Private Key Hex",
664
668
  "publicKeyHex": "Public Key Hex",
665
- "kid": "Key Id"
669
+ "kid": "Key Id",
670
+ "addressIndex": "Address Index"
666
671
  }
667
672
  },
668
673
  "verification-method-remove": {
@@ -680,13 +685,18 @@
680
685
  "id": {
681
686
  "param": "--id '<'id'>'",
682
687
  "description": "The id of verification method to remove."
688
+ },
689
+ "addressIndex": {
690
+ "param": "--address-index '<'index'>'",
691
+ "description": "The address index to use for the identity controller."
683
692
  }
684
693
  },
685
694
  "progress": {
686
695
  "removingVerificationMethod": "Removing Verification Method"
687
696
  },
688
697
  "labels": {
689
- "verificationMethodId": "Verification Method Id"
698
+ "verificationMethodId": "Verification Method Id",
699
+ "addressIndex": "Address Index"
690
700
  }
691
701
  },
692
702
  "service-add": {
@@ -712,6 +722,10 @@
712
722
  "endpoint": {
713
723
  "param": "--endpoint '<'endpoint'>'",
714
724
  "description": "The service endpoint to add."
725
+ },
726
+ "addressIndex": {
727
+ "param": "--address-index '<'index'>'",
728
+ "description": "The address index to use for the identity controller."
715
729
  }
716
730
  },
717
731
  "progress": {
@@ -720,7 +734,8 @@
720
734
  "labels": {
721
735
  "serviceId": "Service Id",
722
736
  "serviceType": "Service Type",
723
- "serviceEndpoint": "Service Endpoint"
737
+ "serviceEndpoint": "Service Endpoint",
738
+ "addressIndex": "Address Index"
724
739
  }
725
740
  },
726
741
  "service-remove": {
@@ -734,13 +749,18 @@
734
749
  "id": {
735
750
  "param": "--id '<'id'>'",
736
751
  "description": "The id of service to remove."
752
+ },
753
+ "addressIndex": {
754
+ "param": "--address-index '<'index'>'",
755
+ "description": "The address index to use for the identity controller."
737
756
  }
738
757
  },
739
758
  "progress": {
740
759
  "removingService": "Removing Service"
741
760
  },
742
761
  "labels": {
743
- "serviceId": "Service Id"
762
+ "serviceId": "Service Id",
763
+ "addressIndex": "Address Index"
744
764
  }
745
765
  },
746
766
  "verifiable-credential-create": {
@@ -766,6 +786,10 @@
766
786
  "revocation-index": {
767
787
  "param": "--revocation-index '<'revocation-index'>'",
768
788
  "description": "The revocation index in the issuing document to use if revoking the credential."
789
+ },
790
+ "addressIndex": {
791
+ "param": "--address-index '<'index'>'",
792
+ "description": "The address index to use for the identity controller."
769
793
  }
770
794
  },
771
795
  "progress": {
@@ -777,7 +801,8 @@
777
801
  "credentialId": "Credential Id",
778
802
  "subjectJson": "Subject JSON",
779
803
  "revocationIndex": "Revocation Index",
780
- "verifiableCredential": "Verifiable Credential"
804
+ "verifiableCredential": "Verifiable Credential",
805
+ "addressIndex": "Address Index"
781
806
  }
782
807
  },
783
808
  "verifiable-credential-verify": {
@@ -813,13 +838,18 @@
813
838
  "revocation-index": {
814
839
  "param": "--revocation-index '<'revocation-index'>'",
815
840
  "description": "The revocation index of the credential revoke."
841
+ },
842
+ "addressIndex": {
843
+ "param": "--address-index '<'index'>'",
844
+ "description": "The address index to use for the identity controller."
816
845
  }
817
846
  },
818
847
  "progress": {
819
848
  "revokingCredential": "Revoking Credential Index"
820
849
  },
821
850
  "labels": {
822
- "revocationIndex": "Revocation Index"
851
+ "revocationIndex": "Revocation Index",
852
+ "addressIndex": "Address Index"
823
853
  }
824
854
  },
825
855
  "verifiable-credential-unrevoke": {
@@ -837,13 +867,18 @@
837
867
  "revocation-index": {
838
868
  "param": "--revocation-index '<'revocation-index'>'",
839
869
  "description": "The revocation index of the credential unrevoke."
870
+ },
871
+ "addressIndex": {
872
+ "param": "--address-index '<'index'>'",
873
+ "description": "The address index to use for the identity controller."
840
874
  }
841
875
  },
842
876
  "progress": {
843
877
  "unrevokingCredential": "Unrevoking Credential Index"
844
878
  },
845
879
  "labels": {
846
- "revocationIndex": "Revocation Index"
880
+ "revocationIndex": "Revocation Index",
881
+ "addressIndex": "Address Index"
847
882
  }
848
883
  },
849
884
  "proof-create": {
@@ -861,6 +896,10 @@
861
896
  "document-filename": {
862
897
  "param": "--document-filename '<'document-filename'>'",
863
898
  "description": "The filename of a JSON-LD document to create the proof for."
899
+ },
900
+ "addressIndex": {
901
+ "param": "--address-index '<'index'>'",
902
+ "description": "The address index to use for the identity controller."
864
903
  }
865
904
  },
866
905
  "progress": {
@@ -868,7 +907,8 @@
868
907
  },
869
908
  "labels": {
870
909
  "documentFilename": "Document Filename",
871
- "verificationMethodId": "Verification Method Id"
910
+ "verificationMethodId": "Verification Method Id",
911
+ "addressIndex": "Address Index"
872
912
  }
873
913
  },
874
914
  "proof-verify": {
@@ -11,6 +11,8 @@ export declare function buildCommandProofCreate(): Command;
11
11
  * @param opts The options for the command.
12
12
  * @param opts.id The id of the verification method to use for the credential.
13
13
  * @param opts.privateKey The private key for the verification method.
14
+ * @param opts.documentFilename The filename of the document to create the proof for.
15
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
14
16
  * @param opts.data The data to create the proof for.
15
17
  * @param opts.connector The connector to perform the operations with.
16
18
  * @param opts.node The node URL.
@@ -20,6 +22,7 @@ export declare function actionCommandProofCreate(opts: {
20
22
  id: string;
21
23
  privateKey: string;
22
24
  documentFilename: string;
25
+ addressIndex?: string;
23
26
  connector?: IdentityConnectorTypes;
24
27
  node: string;
25
28
  network?: string;
@@ -14,6 +14,7 @@ export declare function buildCommandServiceAdd(): Command;
14
14
  * @param opts.id The id of the service to add.
15
15
  * @param opts.type The type of the service to add.
16
16
  * @param opts.endpoint The service endpoint.
17
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
17
18
  * @param opts.connector The connector to perform the operations with.
18
19
  * @param opts.node The node URL.
19
20
  * @param opts.explorer The explorer URL.
@@ -24,6 +25,7 @@ export declare function actionCommandServiceAdd(opts: {
24
25
  id: string;
25
26
  type: string;
26
27
  endpoint: string;
28
+ addressIndex?: string;
27
29
  connector?: IdentityConnectorTypes;
28
30
  node: string;
29
31
  network?: string;
@@ -14,10 +14,12 @@ export declare function buildCommandServiceRemove(): Command;
14
14
  * @param opts.node The node URL.
15
15
  * @param opts.network The network to use for connector.
16
16
  * @param opts.explorer The explorer URL.
17
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
17
18
  */
18
19
  export declare function actionCommandServiceRemove(opts: {
19
20
  seed: string;
20
21
  id: string;
22
+ addressIndex?: string;
21
23
  connector?: IdentityConnectorTypes;
22
24
  node: string;
23
25
  network?: string;
@@ -14,6 +14,7 @@ export declare function buildCommandVerifiableCredentialCreate(): Command;
14
14
  * @param opts.credentialId The id of the credential.
15
15
  * @param opts.subjectJson The JSON data for the subject.
16
16
  * @param opts.revocationIndex The revocation index for the credential.
17
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
17
18
  * @param opts.connector The connector to perform the operations with.
18
19
  * @param opts.node The node URL.
19
20
  */
@@ -23,6 +24,7 @@ export declare function actionCommandVerifiableCredentialCreate(opts: {
23
24
  credentialId?: string;
24
25
  subjectJson: string;
25
26
  revocationIndex?: string;
27
+ addressIndex?: string;
26
28
  connector?: IdentityConnectorTypes;
27
29
  node: string;
28
30
  network?: string;
@@ -14,11 +14,13 @@ export declare function buildCommandVerifiableCredentialRevoke(): Command;
14
14
  * @param opts.connector The connector to perform the operations with.
15
15
  * @param opts.node The node URL.
16
16
  * @param opts.network The network to use for connector.
17
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
17
18
  */
18
19
  export declare function actionCommandVerifiableCredentialRevoke(opts: {
19
20
  seed: string;
20
21
  did: string;
21
22
  revocationIndex: string;
23
+ addressIndex?: string;
22
24
  connector?: IdentityConnectorTypes;
23
25
  node: string;
24
26
  network?: string;
@@ -14,11 +14,13 @@ export declare function buildCommandVerifiableCredentialUnrevoke(): Command;
14
14
  * @param opts.connector The connector to perform the operations with.
15
15
  * @param opts.node The node URL.
16
16
  * @param opts.network The network to use for connector.
17
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
17
18
  */
18
19
  export declare function actionCommandVerifiableCredentialUnrevoke(opts: {
19
20
  seed: string;
20
21
  did: string;
21
22
  revocationIndex: string;
23
+ addressIndex?: string;
22
24
  connector?: IdentityConnectorTypes;
23
25
  node: string;
24
26
  network?: string;
@@ -17,12 +17,15 @@ export declare function buildCommandVerificationMethodAdd(): Command;
17
17
  * @param opts.connector The connector to perform the operations with.
18
18
  * @param opts.node The node URL.
19
19
  * @param opts.explorer The explorer URL.
20
+ * @param opts.network The network to use for connector.
21
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
20
22
  */
21
23
  export declare function actionCommandVerificationMethodAdd(opts: {
22
24
  seed: string;
23
25
  did: string;
24
26
  type: DidVerificationMethodType;
25
27
  id?: string;
28
+ addressIndex?: string;
26
29
  connector?: IdentityConnectorTypes;
27
30
  node: string;
28
31
  network?: string;
@@ -14,10 +14,12 @@ export declare function buildCommandVerificationMethodRemove(): Command;
14
14
  * @param opts.node The node URL.
15
15
  * @param opts.explorer The explorer URL.
16
16
  * @param opts.network The network to use for connector.
17
+ * @param opts.addressIndex The address index to use for key derivation (if applicable).
17
18
  */
18
19
  export declare function actionCommandVerificationMethodRemove(opts: {
19
20
  seed: string;
20
21
  id: string;
22
+ addressIndex?: string;
21
23
  connector?: IdentityConnectorTypes;
22
24
  node: string;
23
25
  network?: string;
package/docs/changelog.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @twin.org/identity-cli - Changelog
2
2
 
3
+ ## [0.0.2-next.5](https://github.com/twinfoundation/identity/compare/identity-cli-v0.0.2-next.4...identity-cli-v0.0.2-next.5) (2025-09-15)
4
+
5
+
6
+ ### Features
7
+
8
+ * add addressIndex option to all commands ([a644674](https://github.com/twinfoundation/identity/commit/a644674017d1a8fe5d8685950316bec922a9b195))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/identity-models bumped from 0.0.2-next.4 to 0.0.2-next.5
16
+ * @twin.org/identity-connector-iota bumped from 0.0.2-next.4 to 0.0.2-next.5
17
+
18
+ ## [0.0.2-next.4](https://github.com/twinfoundation/identity/compare/identity-cli-v0.0.2-next.3...identity-cli-v0.0.2-next.4) (2025-09-12)
19
+
20
+
21
+ ### Features
22
+
23
+ * add expiration date option to vc creation ([73e05e1](https://github.com/twinfoundation/identity/commit/73e05e1ae61112c7e056889969751f4ff82d9f29))
24
+
25
+
26
+ ### Dependencies
27
+
28
+ * The following workspace dependencies were updated
29
+ * dependencies
30
+ * @twin.org/identity-models bumped from 0.0.2-next.3 to 0.0.2-next.4
31
+ * @twin.org/identity-connector-iota bumped from 0.0.2-next.3 to 0.0.2-next.4
32
+
3
33
  ## [0.0.2-next.3](https://github.com/twinfoundation/identity/compare/identity-cli-v0.0.2-next.2...identity-cli-v0.0.2-next.3) (2025-08-29)
4
34
 
5
35
 
@@ -22,6 +22,12 @@ The private key for the controller.
22
22
 
23
23
  The id of the service to remove.
24
24
 
25
+ #### addressIndex?
26
+
27
+ `string`
28
+
29
+ The address index to use for key derivation (if applicable).
30
+
25
31
  #### connector?
26
32
 
27
33
  `"iota"`
@@ -28,6 +28,12 @@ The id of the document to revoke the index.
28
28
 
29
29
  The revocation index for the credential.
30
30
 
31
+ #### addressIndex?
32
+
33
+ `string`
34
+
35
+ The address index to use for key derivation (if applicable).
36
+
31
37
  #### connector?
32
38
 
33
39
  `"iota"`
@@ -28,6 +28,12 @@ The id of the document to unrevoke the index.
28
28
 
29
29
  The revocation index for the credential.
30
30
 
31
+ #### addressIndex?
32
+
33
+ `string`
34
+
35
+ The address index to use for key derivation (if applicable).
36
+
31
37
  #### connector?
32
38
 
33
39
  `"iota"`
@@ -22,6 +22,12 @@ The private key for the controller.
22
22
 
23
23
  The id of the verification method to remove.
24
24
 
25
+ #### addressIndex?
26
+
27
+ `string`
28
+
29
+ The address index to use for key derivation (if applicable).
30
+
25
31
  #### connector?
26
32
 
27
33
  `"iota"`
package/locales/en.json CHANGED
@@ -67,6 +67,10 @@
67
67
  "id": {
68
68
  "param": "--id '<'id'>'",
69
69
  "description": "The optional id of verification method to add, if not provided one will be generated."
70
+ },
71
+ "addressIndex": {
72
+ "param": "--address-index '<'index'>'",
73
+ "description": "The address index to use for the identity controller."
70
74
  }
71
75
  },
72
76
  "progress": {
@@ -79,7 +83,8 @@
79
83
  "publicKeyBase64": "Public Key Base64",
80
84
  "privateKeyHex": "Private Key Hex",
81
85
  "publicKeyHex": "Public Key Hex",
82
- "kid": "Key Id"
86
+ "kid": "Key Id",
87
+ "addressIndex": "Address Index"
83
88
  }
84
89
  },
85
90
  "verification-method-remove": {
@@ -97,13 +102,18 @@
97
102
  "id": {
98
103
  "param": "--id '<'id'>'",
99
104
  "description": "The id of verification method to remove."
105
+ },
106
+ "addressIndex": {
107
+ "param": "--address-index '<'index'>'",
108
+ "description": "The address index to use for the identity controller."
100
109
  }
101
110
  },
102
111
  "progress": {
103
112
  "removingVerificationMethod": "Removing Verification Method"
104
113
  },
105
114
  "labels": {
106
- "verificationMethodId": "Verification Method Id"
115
+ "verificationMethodId": "Verification Method Id",
116
+ "addressIndex": "Address Index"
107
117
  }
108
118
  },
109
119
  "service-add": {
@@ -129,6 +139,10 @@
129
139
  "endpoint": {
130
140
  "param": "--endpoint '<'endpoint'>'",
131
141
  "description": "The service endpoint to add."
142
+ },
143
+ "addressIndex": {
144
+ "param": "--address-index '<'index'>'",
145
+ "description": "The address index to use for the identity controller."
132
146
  }
133
147
  },
134
148
  "progress": {
@@ -137,7 +151,8 @@
137
151
  "labels": {
138
152
  "serviceId": "Service Id",
139
153
  "serviceType": "Service Type",
140
- "serviceEndpoint": "Service Endpoint"
154
+ "serviceEndpoint": "Service Endpoint",
155
+ "addressIndex": "Address Index"
141
156
  }
142
157
  },
143
158
  "service-remove": {
@@ -151,13 +166,18 @@
151
166
  "id": {
152
167
  "param": "--id '<'id'>'",
153
168
  "description": "The id of service to remove."
169
+ },
170
+ "addressIndex": {
171
+ "param": "--address-index '<'index'>'",
172
+ "description": "The address index to use for the identity controller."
154
173
  }
155
174
  },
156
175
  "progress": {
157
176
  "removingService": "Removing Service"
158
177
  },
159
178
  "labels": {
160
- "serviceId": "Service Id"
179
+ "serviceId": "Service Id",
180
+ "addressIndex": "Address Index"
161
181
  }
162
182
  },
163
183
  "verifiable-credential-create": {
@@ -183,6 +203,10 @@
183
203
  "revocation-index": {
184
204
  "param": "--revocation-index '<'revocation-index'>'",
185
205
  "description": "The revocation index in the issuing document to use if revoking the credential."
206
+ },
207
+ "addressIndex": {
208
+ "param": "--address-index '<'index'>'",
209
+ "description": "The address index to use for the identity controller."
186
210
  }
187
211
  },
188
212
  "progress": {
@@ -194,7 +218,8 @@
194
218
  "credentialId": "Credential Id",
195
219
  "subjectJson": "Subject JSON",
196
220
  "revocationIndex": "Revocation Index",
197
- "verifiableCredential": "Verifiable Credential"
221
+ "verifiableCredential": "Verifiable Credential",
222
+ "addressIndex": "Address Index"
198
223
  }
199
224
  },
200
225
  "verifiable-credential-verify": {
@@ -230,13 +255,18 @@
230
255
  "revocation-index": {
231
256
  "param": "--revocation-index '<'revocation-index'>'",
232
257
  "description": "The revocation index of the credential revoke."
258
+ },
259
+ "addressIndex": {
260
+ "param": "--address-index '<'index'>'",
261
+ "description": "The address index to use for the identity controller."
233
262
  }
234
263
  },
235
264
  "progress": {
236
265
  "revokingCredential": "Revoking Credential Index"
237
266
  },
238
267
  "labels": {
239
- "revocationIndex": "Revocation Index"
268
+ "revocationIndex": "Revocation Index",
269
+ "addressIndex": "Address Index"
240
270
  }
241
271
  },
242
272
  "verifiable-credential-unrevoke": {
@@ -254,13 +284,18 @@
254
284
  "revocation-index": {
255
285
  "param": "--revocation-index '<'revocation-index'>'",
256
286
  "description": "The revocation index of the credential unrevoke."
287
+ },
288
+ "addressIndex": {
289
+ "param": "--address-index '<'index'>'",
290
+ "description": "The address index to use for the identity controller."
257
291
  }
258
292
  },
259
293
  "progress": {
260
294
  "unrevokingCredential": "Unrevoking Credential Index"
261
295
  },
262
296
  "labels": {
263
- "revocationIndex": "Revocation Index"
297
+ "revocationIndex": "Revocation Index",
298
+ "addressIndex": "Address Index"
264
299
  }
265
300
  },
266
301
  "proof-create": {
@@ -278,6 +313,10 @@
278
313
  "document-filename": {
279
314
  "param": "--document-filename '<'document-filename'>'",
280
315
  "description": "The filename of a JSON-LD document to create the proof for."
316
+ },
317
+ "addressIndex": {
318
+ "param": "--address-index '<'index'>'",
319
+ "description": "The address index to use for the identity controller."
281
320
  }
282
321
  },
283
322
  "progress": {
@@ -285,7 +324,8 @@
285
324
  },
286
325
  "labels": {
287
326
  "documentFilename": "Document Filename",
288
- "verificationMethodId": "Verification Method Id"
327
+ "verificationMethodId": "Verification Method Id",
328
+ "addressIndex": "Address Index"
289
329
  }
290
330
  },
291
331
  "proof-verify": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/identity-cli",
3
- "version": "0.0.2-next.3",
3
+ "version": "0.0.2-next.5",
4
4
  "description": "A command line interface for interacting with the identity connectors",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,8 +21,8 @@
21
21
  "@twin.org/data-json-ld": "next",
22
22
  "@twin.org/entity": "next",
23
23
  "@twin.org/entity-storage-connector-memory": "next",
24
- "@twin.org/identity-connector-iota": "0.0.2-next.3",
25
- "@twin.org/identity-models": "0.0.2-next.3",
24
+ "@twin.org/identity-connector-iota": "0.0.2-next.5",
25
+ "@twin.org/identity-models": "0.0.2-next.5",
26
26
  "@twin.org/nameof": "next",
27
27
  "@twin.org/standards-w3c-did": "next",
28
28
  "@twin.org/vault-connector-entity-storage": "next",