@0xpolygonid/js-sdk 1.17.3 → 1.17.5

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.
@@ -592,6 +592,13 @@ var PolygonIdSdk = (function (exports) {
592
592
  return b$5.encodeString(b);
593
593
  }
594
594
 
595
+ /**
596
+ * Merges two objects together, prioritizing the properties of the second object.
597
+ * If a property exists in both objects, the value from the second object will be used.
598
+ * @param credSubject - The first object to merge.
599
+ * @param otherCredSubject - The second object to merge.
600
+ * @returns A new object with the merged properties.
601
+ */
595
602
  function mergeObjects(credSubject, otherCredSubject) {
596
603
  let result = {};
597
604
  const credSubjectKeys = Object.keys(credSubject);
@@ -52443,12 +52450,6 @@ var PolygonIdSdk = (function (exports) {
52443
52450
  }
52444
52451
  getStateContractAndProviderForId(id) {
52445
52452
  const idTyped = H$2.fromBigInt(id);
52446
- if (!Array.isArray(this.ethConfig)) {
52447
- return {
52448
- stateContract: this.stateContract,
52449
- provider: this.provider
52450
- };
52451
- }
52452
52453
  const chainId = et$2(Z$2.blockchainFromId(idTyped), Z$2.networkIdFromId(idTyped));
52453
52454
  const config = this.networkByChainId(chainId);
52454
52455
  const provider = new JsonRpcProvider(config.url);
@@ -52456,14 +52457,12 @@ var PolygonIdSdk = (function (exports) {
52456
52457
  return { stateContract, provider };
52457
52458
  }
52458
52459
  networkByChainId(chainId) {
52459
- if (Array.isArray(this.ethConfig)) {
52460
- const network = this.ethConfig.find((c) => c.chainId === chainId);
52461
- if (!network) {
52462
- throw new Error(`chainId "${chainId}" not supported`);
52463
- }
52464
- return network;
52460
+ const config = Array.isArray(this.ethConfig) ? this.ethConfig : [this.ethConfig];
52461
+ const network = config.find((c) => c.chainId === chainId);
52462
+ if (!network) {
52463
+ throw new Error(`chainId "${chainId}" not supported`);
52465
52464
  }
52466
- return this.ethConfig;
52465
+ return network;
52467
52466
  }
52468
52467
  }
52469
52468
 
@@ -77075,7 +77074,7 @@ var PolygonIdSdk = (function (exports) {
77075
77074
  * Returns a Map where the key is the groupId and the value is an object containing the query and linkNonce.
77076
77075
  *
77077
77076
  * @param requestScope - An array of ZeroKnowledgeProofRequest objects.
77078
- * @returns A Map<number, { query: JSONObject; linkNonce: number }> representing the grouped queries.
77077
+ * @returns A Map<number, { query: JsonDocumentObject; linkNonce: number }> representing the grouped queries.
77079
77078
  */
77080
77079
  const getGroupedQueries = (requestScope) => requestScope.reduce((acc, proofReq) => {
77081
77080
  const groupId = proofReq.query.groupId;
@@ -80350,6 +80349,7 @@ var PolygonIdSdk = (function (exports) {
80350
80349
  break;
80351
80350
  }
80352
80351
  catch (err) {
80352
+ // eslint-disable-next-line no-console
80353
80353
  console.warn(`Error while transiting state, retrying state transition, attempt: ${attempt}`, err);
80354
80354
  }
80355
80355
  } while (--attempt);