@dxos/credentials 0.5.2-main.ff937a8 → 0.5.2-next.41b4fdd

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.
@@ -34,6 +34,9 @@ var getCredentialProofPayload = (credential) => {
34
34
  chain: void 0
35
35
  }
36
36
  };
37
+ if (copy.parentCredentialIds?.length === 0) {
38
+ delete copy.parentCredentialIds;
39
+ }
37
40
  delete copy.id;
38
41
  return Buffer.from(canonicalStringify(copy));
39
42
  };
@@ -84,7 +87,15 @@ var truncateKey = (key) => {
84
87
  // packages/core/halo/credentials/src/presentations/signing.ts
85
88
  var getPresentationProofPayload = (credentials, proof) => {
86
89
  const copy = {
87
- credentials,
90
+ credentials: credentials.map((credential) => {
91
+ const copy2 = {
92
+ ...credential
93
+ };
94
+ if (copy2.parentCredentialIds?.length === 0) {
95
+ delete copy2.parentCredentialIds;
96
+ }
97
+ return copy2;
98
+ }),
88
99
  proof: {
89
100
  ...proof,
90
101
  value: new Uint8Array(),
@@ -217,6 +228,7 @@ var createCredential = async ({ signer, issuer, subject, assertion, signingKey,
217
228
  id: subject,
218
229
  assertion
219
230
  },
231
+ parentCredentialIds,
220
232
  proof: {
221
233
  type: SIGNATURE_TYPE_ED25519,
222
234
  creationDate: /* @__PURE__ */ new Date(),
@@ -225,9 +237,6 @@ var createCredential = async ({ signer, issuer, subject, assertion, signingKey,
225
237
  nonce
226
238
  }
227
239
  };
228
- if ((parentCredentialIds?.length ?? 0) > 0) {
229
- credential.parentCredentialIds = parentCredentialIds;
230
- }
231
240
  const signedPayload = getCredentialProofPayload(credential);
232
241
  credential.proof.value = await signer.sign(signingKey ?? issuer, signedPayload);
233
242
  if (chain) {