@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.
@@ -7867,7 +7867,10 @@ var FetchHandler = class _FetchHandler extends AbstractMessageHandler {
7867
7867
  if (!issuanceMsg.body?.credential) {
7868
7868
  throw new Error("credential is missing in issuance response message");
7869
7869
  }
7870
- await this.opts.credentialWallet.save(W3CCredential.fromJSON(issuanceMsg.body.credential));
7870
+ if (!(issuanceMsg.body.credential instanceof W3CCredential)) {
7871
+ throw new Error("credential object is not properly unmarshaled");
7872
+ }
7873
+ await this.opts.credentialWallet.save(issuanceMsg.body.credential);
7871
7874
  return null;
7872
7875
  }
7873
7876
  /**
@@ -7882,6 +7885,7 @@ var FetchHandler = class _FetchHandler extends AbstractMessageHandler {
7882
7885
  if (!opts?.allowExpiredMessages) {
7883
7886
  verifyExpiresTime(issuanceMsg);
7884
7887
  }
7888
+ issuanceMsg.body.credential = W3CCredential.fromJSON(issuanceMsg.body.credential);
7885
7889
  await this.handleIssuanceResponseMsg(issuanceMsg);
7886
7890
  return Uint8Array.from([]);
7887
7891
  }