@0xpolygonid/js-sdk 1.17.4 → 1.17.6

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);
@@ -7561,6 +7568,7 @@ var PaymentType;
7561
7568
  var SupportedCurrencies;
7562
7569
  (function (SupportedCurrencies) {
7563
7570
  SupportedCurrencies["ETH"] = "ETH";
7571
+ SupportedCurrencies["MATIC"] = "MATIC";
7564
7572
  })(SupportedCurrencies || (SupportedCurrencies = {}));
7565
7573
  /**
7566
7574
  * DisplayMethodType type for display method
@@ -49263,45 +49271,29 @@ class Query {
49263
49271
  throw new Error(CircuitError.EmptyQueryValue);
49264
49272
  }
49265
49273
  validateValueArraySize(maxArrSize) {
49266
- switch (this.values.length) {
49267
- case 0: {
49268
- const zeroArrSizeOps = [Operators.NOOP, Operators.SD, Operators.NULLIFY];
49269
- if (!zeroArrSizeOps.includes(this.operator)) {
49270
- throw new Error(CircuitError.InvalidValuesArrSize);
49271
- }
49272
- return;
49273
- }
49274
- case 1: {
49275
- const oneArrSizeOps = [
49276
- Operators.EQ,
49277
- Operators.LT,
49278
- Operators.GT,
49279
- Operators.NE,
49280
- Operators.LTE,
49281
- Operators.GTE,
49282
- Operators.EXISTS
49283
- ];
49284
- if (!oneArrSizeOps.includes(this.operator)) {
49285
- throw new Error(CircuitError.InvalidValuesArrSize);
49286
- }
49287
- return;
49288
- }
49289
- case 2: {
49290
- const twoArrSizeOps = [Operators.BETWEEN, Operators.NONBETWEEN];
49291
- if (!twoArrSizeOps.includes(this.operator)) {
49292
- throw new Error(CircuitError.InvalidValuesArrSize);
49293
- }
49294
- return;
49295
- }
49296
- default: {
49297
- const maxArrSizeOps = [Operators.IN, Operators.NIN];
49298
- if (!maxArrSizeOps.includes(this.operator)) {
49299
- throw new Error(CircuitError.InvalidOperationType);
49300
- }
49301
- if (!this.values.length || this.values.length > maxArrSize) {
49302
- throw new Error(CircuitError.InvalidValuesArrSize);
49303
- }
49304
- }
49274
+ if ([Operators.NOOP, Operators.SD, Operators.NULLIFY].includes(this.operator) &&
49275
+ this.values.length !== 0) {
49276
+ throw new Error(CircuitError.InvalidValuesArrSize);
49277
+ }
49278
+ else if ([
49279
+ Operators.EQ,
49280
+ Operators.LT,
49281
+ Operators.GT,
49282
+ Operators.NE,
49283
+ Operators.LTE,
49284
+ Operators.GTE,
49285
+ Operators.EXISTS
49286
+ ].includes(this.operator) &&
49287
+ this.values.length !== 1) {
49288
+ throw new Error(CircuitError.InvalidValuesArrSize);
49289
+ }
49290
+ else if ([Operators.BETWEEN, Operators.NONBETWEEN].includes(this.operator) &&
49291
+ this.values.length !== 2) {
49292
+ throw new Error(CircuitError.InvalidValuesArrSize);
49293
+ }
49294
+ else if ([Operators.IN, Operators.NIN].includes(this.operator) &&
49295
+ this.values.length > maxArrSize) {
49296
+ throw new Error(CircuitError.InvalidValuesArrSize);
49305
49297
  }
49306
49298
  }
49307
49299
  }
@@ -56159,7 +56151,7 @@ var CredentialOfferStatus;
56159
56151
  * Returns a Map where the key is the groupId and the value is an object containing the query and linkNonce.
56160
56152
  *
56161
56153
  * @param requestScope - An array of ZeroKnowledgeProofRequest objects.
56162
- * @returns A Map<number, { query: JSONObject; linkNonce: number }> representing the grouped queries.
56154
+ * @returns A Map<number, { query: JsonDocumentObject; linkNonce: number }> representing the grouped queries.
56163
56155
  */
56164
56156
  const getGroupedQueries = (requestScope) => requestScope.reduce((acc, proofReq) => {
56165
56157
  const groupId = proofReq.query.groupId;
@@ -59434,6 +59426,7 @@ class IdentityWallet {
59434
59426
  break;
59435
59427
  }
59436
59428
  catch (err) {
59429
+ // eslint-disable-next-line no-console
59437
59430
  console.warn(`Error while transiting state, retrying state transition, attempt: ${attempt}`, err);
59438
59431
  }
59439
59432
  } while (--attempt);