@0xpolygonid/js-sdk 1.21.1 → 1.21.3

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.
@@ -7093,6 +7093,8 @@ var PolygonIdSdk = (function (exports) {
7093
7093
  function encode(prefix, words, limit = 90) {
7094
7094
  if (typeof prefix !== 'string')
7095
7095
  throw new Error(`bech32.encode prefix should be string, not ${typeof prefix}`);
7096
+ if (words instanceof Uint8Array)
7097
+ words = Array.from(words);
7096
7098
  if (!Array.isArray(words) || (words.length && typeof words[0] !== 'number'))
7097
7099
  throw new Error(`bech32.encode words should be array of numbers, not ${typeof words}`);
7098
7100
  if (prefix.length === 0)
@@ -7131,7 +7133,19 @@ var PolygonIdSdk = (function (exports) {
7131
7133
  const { prefix, words } = decode(str, false);
7132
7134
  return { prefix, words, bytes: fromWords(words) };
7133
7135
  }
7134
- return { encode, decode, decodeToBytes, decodeUnsafe, fromWords, fromWordsUnsafe, toWords };
7136
+ function encodeFromBytes(prefix, bytes) {
7137
+ return encode(prefix, toWords(bytes));
7138
+ }
7139
+ return {
7140
+ encode,
7141
+ decode,
7142
+ encodeFromBytes,
7143
+ decodeToBytes,
7144
+ decodeUnsafe,
7145
+ fromWords,
7146
+ fromWordsUnsafe,
7147
+ toWords,
7148
+ };
7135
7149
  }
7136
7150
  const bech32 = /* @__PURE__ */ genBech32('bech32');
7137
7151
 
@@ -30419,7 +30433,7 @@ var PolygonIdSdk = (function (exports) {
30419
30433
  /**
30420
30434
  * The current version of Ethers.
30421
30435
  */
30422
- const version = "6.13.2";
30436
+ const version = "6.13.4";
30423
30437
 
30424
30438
  /**
30425
30439
  * Property helper functions.
@@ -46822,7 +46836,18 @@ var PolygonIdSdk = (function (exports) {
46822
46836
  }
46823
46837
  this.emit("debug", { action: "sendCcipReadFetchRequest", request, index: i, urls });
46824
46838
  let errorMessage = "unknown error";
46825
- const resp = await request.send();
46839
+ // Fetch the resource...
46840
+ let resp;
46841
+ try {
46842
+ resp = await request.send();
46843
+ }
46844
+ catch (error) {
46845
+ // ...low-level fetch error (missing host, bad SSL, etc.),
46846
+ // so try next URL
46847
+ errorMessages.push(error.message);
46848
+ this.emit("debug", { action: "receiveCcipReadFetchError", request, result: { error } });
46849
+ continue;
46850
+ }
46826
46851
  try {
46827
46852
  const result = resp.bodyJson;
46828
46853
  if (result.data) {
@@ -48418,7 +48443,7 @@ var PolygonIdSdk = (function (exports) {
48418
48443
  // If the network changed: calling again will also fail
48419
48444
  // If unsupported: likely destroyed
48420
48445
  if (isError(error, "CANCELLED") || isError(error, "BAD_DATA") ||
48421
- isError(error, "NETWORK_ERROR")) {
48446
+ isError(error, "NETWORK_ERROR") || isError(error, "UNSUPPORTED_OPERATION")) {
48422
48447
  if (error.info == null) {
48423
48448
  error.info = {};
48424
48449
  }
@@ -54327,10 +54352,12 @@ var PolygonIdSdk = (function (exports) {
54327
54352
  if (!Array.isArray(b) || b.length !== 2) {
54328
54353
  throw new Error('$between/$nonbetween operator value should be 2 elements array');
54329
54354
  }
54355
+ const [min, max] = b.map(BigInt);
54356
+ const predicate = (val) => val >= min && val <= max;
54330
54357
  if (Array.isArray(a)) {
54331
- return a.every((val) => val >= b[0] && val <= b[1]);
54358
+ return a.map(BigInt).every(predicate);
54332
54359
  }
54333
- return a >= b[0] && a <= b[1];
54360
+ return predicate(BigInt(a));
54334
54361
  };
54335
54362
  const comparatorOptions = {
54336
54363
  $noop: () => true,
@@ -54340,7 +54367,7 @@ var PolygonIdSdk = (function (exports) {
54340
54367
  $in: (a, b) => inOperator(a, b),
54341
54368
  $nin: (a, b) => !inOperator(a, b),
54342
54369
  $gt: (a, b) => greaterThan(a, b),
54343
- $lt: (a, b) => !greaterThan(a, b),
54370
+ $lt: (a, b) => !greaterThanOrEqual(a, b),
54344
54371
  $ne: (a, b) => !equalsComparator(a, b),
54345
54372
  $gte: (a, b) => greaterThanOrEqual(a, b),
54346
54373
  $lte: (a, b) => lessThanOrEqual(a, b),
@@ -79413,7 +79440,8 @@ var PolygonIdSdk = (function (exports) {
79413
79440
  exports.Operators.GT,
79414
79441
  exports.Operators.IN,
79415
79442
  exports.Operators.NIN,
79416
- exports.Operators.NE
79443
+ exports.Operators.NE,
79444
+ exports.Operators.SD
79417
79445
  ];
79418
79446
  const v2OnChainOperations = [
79419
79447
  exports.Operators.EQ,