@0xpolygonid/js-sdk 1.33.0 → 1.33.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.
@@ -7357,7 +7357,10 @@ var FetchHandler = class _FetchHandler extends AbstractMessageHandler {
7357
7357
  if (!issuanceMsg.body?.credential) {
7358
7358
  throw new Error("credential is missing in issuance response message");
7359
7359
  }
7360
- await this.opts.credentialWallet.save(W3CCredential.fromJSON(issuanceMsg.body.credential));
7360
+ if (!(issuanceMsg.body.credential instanceof W3CCredential)) {
7361
+ throw new Error("credential object is not properly unmarshaled");
7362
+ }
7363
+ await this.opts.credentialWallet.save(issuanceMsg.body.credential);
7361
7364
  return null;
7362
7365
  }
7363
7366
  /**
@@ -7372,6 +7375,7 @@ var FetchHandler = class _FetchHandler extends AbstractMessageHandler {
7372
7375
  if (!opts?.allowExpiredMessages) {
7373
7376
  verifyExpiresTime(issuanceMsg);
7374
7377
  }
7378
+ issuanceMsg.body.credential = W3CCredential.fromJSON(issuanceMsg.body.credential);
7375
7379
  await this.handleIssuanceResponseMsg(issuanceMsg);
7376
7380
  return Uint8Array.from([]);
7377
7381
  }