@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.
@@ -53775,9 +53775,6 @@ const processProofAuth = async (to, proofService, opts) => {
53775
53775
  if (!opts.senderAddress) {
53776
53776
  throw new Error('Sender address is not provided');
53777
53777
  }
53778
- if (!opts.zkpResponses || opts.zkpResponses.length === 0) {
53779
- throw new Error('ZKP responses are not provided');
53780
- }
53781
53778
  const challengeAuth = calcChallengeAuthV2(opts.senderAddress, opts.zkpResponses);
53782
53779
  const zkpRes = await proofService.generateAuthProof(circuitId, to, { challenge: challengeAuth });
53783
53780
  return {
@@ -55868,6 +55865,8 @@ class ContractRequestHandler extends AbstractMessageHandler {
55868
55865
  for (const [txHash, zkpResponses] of txHashZkpResponsesMap) {
55869
55866
  response.set(txHash, { responses: zkpResponses });
55870
55867
  }
55868
+ // set txHash of the first response
55869
+ message.body.transaction_data.txHash = txHashZkpResponsesMap.keys().next().value;
55871
55870
  return response;
55872
55871
  }
55873
55872
  case FunctionSignatures.SubmitZKPResponseV1: {
@@ -55876,6 +55875,8 @@ class ContractRequestHandler extends AbstractMessageHandler {
55876
55875
  for (const [txHash, zkpResponse] of txHashZkpResponseMap) {
55877
55876
  response.set(txHash, { responses: [zkpResponse] });
55878
55877
  }
55878
+ // set txHash of the first response
55879
+ message.body.transaction_data.txHash = txHashZkpResponseMap.keys().next().value;
55879
55880
  return response;
55880
55881
  }
55881
55882
  case FunctionSignatures.SubmitResponse: {
@@ -55895,7 +55896,10 @@ class ContractRequestHandler extends AbstractMessageHandler {
55895
55896
  senderAddress: await ethSigner.getAddress(),
55896
55897
  zkpResponses: zkpResponses
55897
55898
  });
55898
- return this._zkpVerifier.submitResponse(ethSigner, message.body.transaction_data, zkpResponses, authProof);
55899
+ // we return txHash because responsesMap could be empty if there are no queries in scope
55900
+ const txHashZkpResponsesMap = await this._zkpVerifier.submitResponse(ethSigner, message.body.transaction_data, zkpResponses, authProof);
55901
+ message.body.transaction_data.txHash = txHashZkpResponsesMap.keys().next().value;
55902
+ return txHashZkpResponsesMap;
55899
55903
  }
55900
55904
  default:
55901
55905
  throw new Error(`Not supported method id. Only '${FunctionSignatures.SubmitZKPResponseV1}, ${FunctionSignatures.SubmitZKPResponseV2} and ${FunctionSignatures.SubmitResponse} are supported.'`);