@0xpolygonid/js-sdk 1.17.5 → 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.
@@ -7621,6 +7621,7 @@ var PolygonIdSdk = (function (exports) {
7621
7621
  exports.SupportedCurrencies = void 0;
7622
7622
  (function (SupportedCurrencies) {
7623
7623
  SupportedCurrencies["ETH"] = "ETH";
7624
+ SupportedCurrencies["MATIC"] = "MATIC";
7624
7625
  })(exports.SupportedCurrencies || (exports.SupportedCurrencies = {}));
7625
7626
  /**
7626
7627
  * DisplayMethodType type for display method
@@ -49409,45 +49410,29 @@ var PolygonIdSdk = (function (exports) {
49409
49410
  throw new Error(exports.CircuitError.EmptyQueryValue);
49410
49411
  }
49411
49412
  validateValueArraySize(maxArrSize) {
49412
- switch (this.values.length) {
49413
- case 0: {
49414
- const zeroArrSizeOps = [exports.Operators.NOOP, exports.Operators.SD, exports.Operators.NULLIFY];
49415
- if (!zeroArrSizeOps.includes(this.operator)) {
49416
- throw new Error(exports.CircuitError.InvalidValuesArrSize);
49417
- }
49418
- return;
49419
- }
49420
- case 1: {
49421
- const oneArrSizeOps = [
49422
- exports.Operators.EQ,
49423
- exports.Operators.LT,
49424
- exports.Operators.GT,
49425
- exports.Operators.NE,
49426
- exports.Operators.LTE,
49427
- exports.Operators.GTE,
49428
- exports.Operators.EXISTS
49429
- ];
49430
- if (!oneArrSizeOps.includes(this.operator)) {
49431
- throw new Error(exports.CircuitError.InvalidValuesArrSize);
49432
- }
49433
- return;
49434
- }
49435
- case 2: {
49436
- const twoArrSizeOps = [exports.Operators.BETWEEN, exports.Operators.NONBETWEEN];
49437
- if (!twoArrSizeOps.includes(this.operator)) {
49438
- throw new Error(exports.CircuitError.InvalidValuesArrSize);
49439
- }
49440
- return;
49441
- }
49442
- default: {
49443
- const maxArrSizeOps = [exports.Operators.IN, exports.Operators.NIN];
49444
- if (!maxArrSizeOps.includes(this.operator)) {
49445
- throw new Error(exports.CircuitError.InvalidOperationType);
49446
- }
49447
- if (!this.values.length || this.values.length > maxArrSize) {
49448
- throw new Error(exports.CircuitError.InvalidValuesArrSize);
49449
- }
49450
- }
49413
+ if ([exports.Operators.NOOP, exports.Operators.SD, exports.Operators.NULLIFY].includes(this.operator) &&
49414
+ this.values.length !== 0) {
49415
+ throw new Error(exports.CircuitError.InvalidValuesArrSize);
49416
+ }
49417
+ else if ([
49418
+ exports.Operators.EQ,
49419
+ exports.Operators.LT,
49420
+ exports.Operators.GT,
49421
+ exports.Operators.NE,
49422
+ exports.Operators.LTE,
49423
+ exports.Operators.GTE,
49424
+ exports.Operators.EXISTS
49425
+ ].includes(this.operator) &&
49426
+ this.values.length !== 1) {
49427
+ throw new Error(exports.CircuitError.InvalidValuesArrSize);
49428
+ }
49429
+ else if ([exports.Operators.BETWEEN, exports.Operators.NONBETWEEN].includes(this.operator) &&
49430
+ this.values.length !== 2) {
49431
+ throw new Error(exports.CircuitError.InvalidValuesArrSize);
49432
+ }
49433
+ else if ([exports.Operators.IN, exports.Operators.NIN].includes(this.operator) &&
49434
+ this.values.length > maxArrSize) {
49435
+ throw new Error(exports.CircuitError.InvalidValuesArrSize);
49451
49436
  }
49452
49437
  }
49453
49438
  }