emblem-vault-sdk 1.10.1 → 1.10.2

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.
package/dist/bundle.js CHANGED
@@ -711421,7 +711421,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
711421
711421
  const bignumber_1 = require("@ethersproject/bignumber");
711422
711422
  const utils_1 = require("./utils");
711423
711423
  const derive_1 = require("./derive");
711424
- const SDK_VERSION = '1.10.1';
711424
+ const SDK_VERSION = '1.10.2';
711425
711425
  class EmblemVaultSDK {
711426
711426
  constructor(apiKey, baseUrl) {
711427
711427
  this.apiKey = apiKey;
@@ -712630,8 +712630,11 @@ function checkContentType(url) {
712630
712630
  let returnVal = { valid: false };
712631
712631
  // Function to make fetch requests
712632
712632
  function fetchUrl(method) {
712633
- return fetch(url, { method: method })
712633
+ const controller = new AbortController();
712634
+ const timeoutId = setTimeout(() => controller.abort(), 3000); // 10 seconds timeout
712635
+ return fetch(url, { method: method, signal: controller.signal })
712634
712636
  .then(response => {
712637
+ clearTimeout(timeoutId);
712635
712638
  if (!response.ok) {
712636
712639
  returnVal.valid = false;
712637
712640
  return resolve(returnVal);
@@ -712659,6 +712662,7 @@ function checkContentType(url) {
712659
712662
  }
712660
712663
  })
712661
712664
  .catch(error => {
712665
+ clearTimeout(timeoutId);
712662
712666
  console.error('Error while fetching URL:', error);
712663
712667
  return resolve(returnVal);
712664
712668
  });
package/dist/index.js CHANGED
@@ -35,7 +35,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
35
35
  const bignumber_1 = require("@ethersproject/bignumber");
36
36
  const utils_1 = require("./utils");
37
37
  const derive_1 = require("./derive");
38
- const SDK_VERSION = '1.10.1';
38
+ const SDK_VERSION = '1.10.2';
39
39
  class EmblemVaultSDK {
40
40
  constructor(apiKey, baseUrl) {
41
41
  this.apiKey = apiKey;
package/dist/utils.js CHANGED
@@ -601,8 +601,11 @@ function checkContentType(url) {
601
601
  let returnVal = { valid: false };
602
602
  // Function to make fetch requests
603
603
  function fetchUrl(method) {
604
- return fetch(url, { method: method })
604
+ const controller = new AbortController();
605
+ const timeoutId = setTimeout(() => controller.abort(), 3000); // 10 seconds timeout
606
+ return fetch(url, { method: method, signal: controller.signal })
605
607
  .then(response => {
608
+ clearTimeout(timeoutId);
606
609
  if (!response.ok) {
607
610
  returnVal.valid = false;
608
611
  return resolve(returnVal);
@@ -630,6 +633,7 @@ function checkContentType(url) {
630
633
  }
631
634
  })
632
635
  .catch(error => {
636
+ clearTimeout(timeoutId);
633
637
  console.error('Error while fetching URL:', error);
634
638
  return resolve(returnVal);
635
639
  });
package/docs/bundle.js CHANGED
@@ -711421,7 +711421,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
711421
711421
  const bignumber_1 = require("@ethersproject/bignumber");
711422
711422
  const utils_1 = require("./utils");
711423
711423
  const derive_1 = require("./derive");
711424
- const SDK_VERSION = '1.10.1';
711424
+ const SDK_VERSION = '1.10.2';
711425
711425
  class EmblemVaultSDK {
711426
711426
  constructor(apiKey, baseUrl) {
711427
711427
  this.apiKey = apiKey;
@@ -712630,8 +712630,11 @@ function checkContentType(url) {
712630
712630
  let returnVal = { valid: false };
712631
712631
  // Function to make fetch requests
712632
712632
  function fetchUrl(method) {
712633
- return fetch(url, { method: method })
712633
+ const controller = new AbortController();
712634
+ const timeoutId = setTimeout(() => controller.abort(), 3000); // 10 seconds timeout
712635
+ return fetch(url, { method: method, signal: controller.signal })
712634
712636
  .then(response => {
712637
+ clearTimeout(timeoutId);
712635
712638
  if (!response.ok) {
712636
712639
  returnVal.valid = false;
712637
712640
  return resolve(returnVal);
@@ -712659,6 +712662,7 @@ function checkContentType(url) {
712659
712662
  }
712660
712663
  })
712661
712664
  .catch(error => {
712665
+ clearTimeout(timeoutId);
712662
712666
  console.error('Error while fetching URL:', error);
712663
712667
  return resolve(returnVal);
712664
712668
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emblem-vault-sdk",
3
- "version": "1.10.1",
3
+ "version": "1.10.2",
4
4
  "description": "Emblem Vault Software Development Kit",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/utils.ts CHANGED
@@ -574,8 +574,12 @@ export function checkContentType(url: string) {
574
574
 
575
575
  // Function to make fetch requests
576
576
  function fetchUrl(method: string): any {
577
- return fetch(url, { method: method })
577
+ const controller = new AbortController();
578
+ const timeoutId = setTimeout(() => controller.abort(), 3000); // 3 seconds timeout (probably need to make this timeout only for HEAD)
579
+
580
+ return fetch(url, { method: method, signal: controller.signal })
578
581
  .then(response => {
582
+ clearTimeout(timeoutId);
579
583
  if (!response.ok) {
580
584
  returnVal.valid = false;
581
585
  return resolve(returnVal);
@@ -600,6 +604,7 @@ export function checkContentType(url: string) {
600
604
  }
601
605
  })
602
606
  .catch(error => {
607
+ clearTimeout(timeoutId);
603
608
  console.error('Error while fetching URL:', error);
604
609
  return resolve(returnVal);
605
610
  });