@0xpolygonid/js-sdk 1.4.0 → 1.4.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.
@@ -57601,8 +57601,23 @@ class EthStateStorage {
57601
57601
  ],
57602
57602
  proof.proof.pi_c.slice(0, 2)
57603
57603
  ];
57604
- await contract.transitState.estimateGas(...payload);
57605
- const tx = await contract.transitState(...payload);
57604
+ const feeData = await this.provider.getFeeData();
57605
+ const maxFeePerGas = defaultEthConnectionConfig.maxFeePerGas
57606
+ ? BigInt(defaultEthConnectionConfig.maxFeePerGas)
57607
+ : feeData.maxFeePerGas;
57608
+ const maxPriorityFeePerGas = defaultEthConnectionConfig.maxPriorityFeePerGas
57609
+ ? BigInt(defaultEthConnectionConfig.maxPriorityFeePerGas)
57610
+ : feeData.maxPriorityFeePerGas;
57611
+ const gasLimit = await contract.transitState.estimateGas(...payload);
57612
+ const txData = await contract.transitState.populateTransaction(...payload);
57613
+ const request = {
57614
+ to: txData.to,
57615
+ data: txData.data,
57616
+ gasLimit,
57617
+ maxFeePerGas,
57618
+ maxPriorityFeePerGas
57619
+ };
57620
+ const tx = await signer.sendTransaction(request);
57606
57621
  const txnReceipt = await tx.wait();
57607
57622
  if (!txnReceipt) {
57608
57623
  throw new Error(`transaction: ${tx.hash} failed to mined`);
@@ -58082,7 +58097,23 @@ class OnChainZKPVerifier {
58082
58097
  ],
58083
58098
  zkProof.proof.pi_c.slice(0, 2)
58084
58099
  ];
58085
- const tx = await contract.submitZKPResponse(...payload);
58100
+ const feeData = await provider.getFeeData();
58101
+ const maxFeePerGas = chainConfig.maxFeePerGas
58102
+ ? BigInt(chainConfig.maxFeePerGas)
58103
+ : feeData.maxFeePerGas;
58104
+ const maxPriorityFeePerGas = chainConfig.maxPriorityFeePerGas
58105
+ ? BigInt(chainConfig.maxPriorityFeePerGas)
58106
+ : feeData.maxPriorityFeePerGas;
58107
+ const gasLimit = await contract.submitZKPResponse.estimateGas(...payload);
58108
+ const txData = await contract.submitZKPResponse.populateTransaction(...payload);
58109
+ const request = {
58110
+ to: txData.to,
58111
+ data: txData.data,
58112
+ gasLimit,
58113
+ maxFeePerGas,
58114
+ maxPriorityFeePerGas
58115
+ };
58116
+ const tx = await ethSigner.sendTransaction(request);
58086
58117
  const txnReceipt = await tx.wait();
58087
58118
  if (!txnReceipt) {
58088
58119
  throw new Error(`transaction: ${tx.hash} failed to mined`);
@@ -60699,7 +60730,7 @@ class ProofService {
60699
60730
  this._identityWallet = _identityWallet;
60700
60731
  this._credentialWallet = _credentialWallet;
60701
60732
  this._stateStorage = _stateStorage;
60702
- this._prover = new NativeProver(_circuitStorage);
60733
+ this._prover = opts?.prover ?? new NativeProver(_circuitStorage);
60703
60734
  this._ldOptions = { ...opts, documentLoader: opts?.documentLoader ?? cacheLoader(opts) };
60704
60735
  }
60705
60736
  /** {@inheritdoc IProofService.verifyProof} */