@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.
@@ -541,6 +541,13 @@ function bytesToHex$3(b) {
541
541
  return Hex.encodeString(b);
542
542
  }
543
543
 
544
+ /**
545
+ * Merges two objects together, prioritizing the properties of the second object.
546
+ * If a property exists in both objects, the value from the second object will be used.
547
+ * @param credSubject - The first object to merge.
548
+ * @param otherCredSubject - The second object to merge.
549
+ * @returns A new object with the merged properties.
550
+ */
544
551
  function mergeObjects(credSubject, otherCredSubject) {
545
552
  let result = {};
546
553
  const credSubjectKeys = Object.keys(credSubject);
@@ -52304,12 +52311,6 @@ class EthStateStorage {
52304
52311
  }
52305
52312
  getStateContractAndProviderForId(id) {
52306
52313
  const idTyped = Id$1.fromBigInt(id);
52307
- if (!Array.isArray(this.ethConfig)) {
52308
- return {
52309
- stateContract: this.stateContract,
52310
- provider: this.provider
52311
- };
52312
- }
52313
52314
  const chainId = getChainId(DID.blockchainFromId(idTyped), DID.networkIdFromId(idTyped));
52314
52315
  const config = this.networkByChainId(chainId);
52315
52316
  const provider = new JsonRpcProvider(config.url);
@@ -52317,14 +52318,12 @@ class EthStateStorage {
52317
52318
  return { stateContract, provider };
52318
52319
  }
52319
52320
  networkByChainId(chainId) {
52320
- if (Array.isArray(this.ethConfig)) {
52321
- const network = this.ethConfig.find((c) => c.chainId === chainId);
52322
- if (!network) {
52323
- throw new Error(`chainId "${chainId}" not supported`);
52324
- }
52325
- return network;
52321
+ const config = Array.isArray(this.ethConfig) ? this.ethConfig : [this.ethConfig];
52322
+ const network = config.find((c) => c.chainId === chainId);
52323
+ if (!network) {
52324
+ throw new Error(`chainId "${chainId}" not supported`);
52326
52325
  }
52327
- return this.ethConfig;
52326
+ return network;
52328
52327
  }
52329
52328
  }
52330
52329
 
@@ -56167,7 +56166,7 @@ var CredentialOfferStatus;
56167
56166
  * Returns a Map where the key is the groupId and the value is an object containing the query and linkNonce.
56168
56167
  *
56169
56168
  * @param requestScope - An array of ZeroKnowledgeProofRequest objects.
56170
- * @returns A Map<number, { query: JSONObject; linkNonce: number }> representing the grouped queries.
56169
+ * @returns A Map<number, { query: JsonDocumentObject; linkNonce: number }> representing the grouped queries.
56171
56170
  */
56172
56171
  const getGroupedQueries = (requestScope) => requestScope.reduce((acc, proofReq) => {
56173
56172
  const groupId = proofReq.query.groupId;
@@ -59442,6 +59441,7 @@ class IdentityWallet {
59442
59441
  break;
59443
59442
  }
59444
59443
  catch (err) {
59444
+ // eslint-disable-next-line no-console
59445
59445
  console.warn(`Error while transiting state, retrying state transition, attempt: ${attempt}`, err);
59446
59446
  }
59447
59447
  } while (--attempt);