@learncard/core 2.1.0 → 3.0.0

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.
@@ -42434,11 +42434,7 @@ var verifyCredential = /* @__PURE__ */ __name((initWallet) => {
42434
42434
 
42435
42435
  // src/wallet/plugins/vc/issuePresentation.ts
42436
42436
  var issuePresentation = /* @__PURE__ */ __name((initWallet) => {
42437
- return (wallet, credential) => __async(void 0, null, function* () {
42438
- const did = wallet.pluginMethods.getSubjectDid("key");
42439
- if (!did)
42440
- throw new Error("Cannot create presentation: No holder key found");
42441
- const holder = did;
42437
+ return (wallet, presentation) => __async(void 0, null, function* () {
42442
42438
  const kp = wallet.pluginMethods.getSubjectKeypair();
42443
42439
  if (!kp)
42444
42440
  throw new Error("Cannot issue credential: Could not get subject keypair");
@@ -42446,12 +42442,6 @@ var issuePresentation = /* @__PURE__ */ __name((initWallet) => {
42446
42442
  verificationMethod: yield initWallet.pluginMethods.keyToVerificationMethod("key", kp),
42447
42443
  proofPurpose: "assertionMethod"
42448
42444
  };
42449
- const presentation = {
42450
- "@context": ["https://www.w3.org/2018/credentials/v1"],
42451
- type: ["VerifiablePresentation"],
42452
- holder,
42453
- verifiableCredential: credential
42454
- };
42455
42445
  return initWallet.pluginMethods.issuePresentation(presentation, options, kp);
42456
42446
  });
42457
42447
  }, "issuePresentation");
@@ -42481,7 +42471,17 @@ var getVCPlugin = /* @__PURE__ */ __name((wallet) => __async(void 0, null, funct
42481
42471
  issuanceDate: "2020-08-19T21:41:50Z",
42482
42472
  credentialSubject: { id: subject }
42483
42473
  };
42484
- }
42474
+ },
42475
+ getTestVp: (_wallet, _credential) => __async(void 0, null, function* () {
42476
+ const credential = _credential || (yield _wallet.pluginMethods.issueCredential(_wallet.pluginMethods.getTestVc()));
42477
+ const did = _wallet.pluginMethods.getSubjectDid("key");
42478
+ return {
42479
+ "@context": ["https://www.w3.org/2018/credentials/v1"],
42480
+ type: ["VerifiablePresentation"],
42481
+ holder: did,
42482
+ verifiableCredential: credential
42483
+ };
42484
+ })
42485
42485
  })
42486
42486
  };
42487
42487
  }), "getVCPlugin");
@@ -47959,6 +47959,7 @@ var walletFromKey = /* @__PURE__ */ __name((_0, ..._1) => __async(void 0, [_0, .
47959
47959
  }),
47960
47960
  readFromCeramic: wallet.pluginMethods.readContentFromCeramic,
47961
47961
  getTestVc: wallet.pluginMethods.getTestVc,
47962
+ getTestVp: wallet.pluginMethods.getTestVp,
47962
47963
  checkMyEth: wallet.pluginMethods.checkMyEth,
47963
47964
  checkMyDai: wallet.pluginMethods.checkMyDai,
47964
47965
  checkMyUsdc: wallet.pluginMethods.checkMyUsdc