@0xpolygonid/js-sdk 1.29.2 → 1.29.3

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.
@@ -74657,9 +74657,6 @@ var PolygonIdSdk = (function (exports) {
74657
74657
  if (!opts.senderAddress) {
74658
74658
  throw new Error('Sender address is not provided');
74659
74659
  }
74660
- if (!opts.zkpResponses || opts.zkpResponses.length === 0) {
74661
- throw new Error('ZKP responses are not provided');
74662
- }
74663
74660
  const challengeAuth = calcChallengeAuthV2(opts.senderAddress, opts.zkpResponses);
74664
74661
  const zkpRes = await proofService.generateAuthProof(circuitId, to, { challenge: challengeAuth });
74665
74662
  return {
@@ -76750,6 +76747,8 @@ var PolygonIdSdk = (function (exports) {
76750
76747
  for (const [txHash, zkpResponses] of txHashZkpResponsesMap) {
76751
76748
  response.set(txHash, { responses: zkpResponses });
76752
76749
  }
76750
+ // set txHash of the first response
76751
+ message.body.transaction_data.txHash = txHashZkpResponsesMap.keys().next().value;
76753
76752
  return response;
76754
76753
  }
76755
76754
  case exports.FunctionSignatures.SubmitZKPResponseV1: {
@@ -76758,6 +76757,8 @@ var PolygonIdSdk = (function (exports) {
76758
76757
  for (const [txHash, zkpResponse] of txHashZkpResponseMap) {
76759
76758
  response.set(txHash, { responses: [zkpResponse] });
76760
76759
  }
76760
+ // set txHash of the first response
76761
+ message.body.transaction_data.txHash = txHashZkpResponseMap.keys().next().value;
76761
76762
  return response;
76762
76763
  }
76763
76764
  case exports.FunctionSignatures.SubmitResponse: {
@@ -76777,7 +76778,10 @@ var PolygonIdSdk = (function (exports) {
76777
76778
  senderAddress: await ethSigner.getAddress(),
76778
76779
  zkpResponses: zkpResponses
76779
76780
  });
76780
- return this._zkpVerifier.submitResponse(ethSigner, message.body.transaction_data, zkpResponses, authProof);
76781
+ // we return txHash because responsesMap could be empty if there are no queries in scope
76782
+ const txHashZkpResponsesMap = await this._zkpVerifier.submitResponse(ethSigner, message.body.transaction_data, zkpResponses, authProof);
76783
+ message.body.transaction_data.txHash = txHashZkpResponsesMap.keys().next().value;
76784
+ return txHashZkpResponsesMap;
76781
76785
  }
76782
76786
  default:
76783
76787
  throw new Error(`Not supported method id. Only '${exports.FunctionSignatures.SubmitZKPResponseV1}, ${exports.FunctionSignatures.SubmitZKPResponseV2} and ${exports.FunctionSignatures.SubmitResponse} are supported.'`);