emblem-vault-sdk 1.4.7 → 1.4.8

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
@@ -684212,7 +684212,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
684212
684212
  };
684213
684213
  Object.defineProperty(exports, "__esModule", { value: true });
684214
684214
  const utils_1 = require("./utils");
684215
- const SDK_VERSION = '1.4.7';
684215
+ const SDK_VERSION = '1.4.8';
684216
684216
  class EmblemVaultSDK {
684217
684217
  constructor(apiKey, baseUrl) {
684218
684218
  this.apiKey = apiKey;
@@ -684309,10 +684309,12 @@ class EmblemVaultSDK {
684309
684309
  }
684310
684310
  else {
684311
684311
  console.error('MetaMask is not installed!');
684312
+ return undefined;
684312
684313
  }
684313
684314
  }
684314
684315
  catch (error) {
684315
684316
  console.error('Error loading Web3 or connecting to MetaMask', error);
684317
+ return undefined;
684316
684318
  }
684317
684319
  });
684318
684320
  }
package/dist/index.js CHANGED
@@ -33,7 +33,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
33
  };
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
35
  const utils_1 = require("./utils");
36
- const SDK_VERSION = '1.4.7';
36
+ const SDK_VERSION = '1.4.8';
37
37
  class EmblemVaultSDK {
38
38
  constructor(apiKey, baseUrl) {
39
39
  this.apiKey = apiKey;
@@ -130,10 +130,12 @@ class EmblemVaultSDK {
130
130
  }
131
131
  else {
132
132
  console.error('MetaMask is not installed!');
133
+ return undefined;
133
134
  }
134
135
  }
135
136
  catch (error) {
136
137
  console.error('Error loading Web3 or connecting to MetaMask', error);
138
+ return undefined;
137
139
  }
138
140
  });
139
141
  }
package/docs/bundle.js CHANGED
@@ -684212,7 +684212,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
684212
684212
  };
684213
684213
  Object.defineProperty(exports, "__esModule", { value: true });
684214
684214
  const utils_1 = require("./utils");
684215
- const SDK_VERSION = '1.4.7';
684215
+ const SDK_VERSION = '1.4.8';
684216
684216
  class EmblemVaultSDK {
684217
684217
  constructor(apiKey, baseUrl) {
684218
684218
  this.apiKey = apiKey;
@@ -684309,10 +684309,12 @@ class EmblemVaultSDK {
684309
684309
  }
684310
684310
  else {
684311
684311
  console.error('MetaMask is not installed!');
684312
+ return undefined;
684312
684313
  }
684313
684314
  }
684314
684315
  catch (error) {
684315
684316
  console.error('Error loading Web3 or connecting to MetaMask', error);
684317
+ return undefined;
684316
684318
  }
684317
684319
  });
684318
684320
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emblem-vault-sdk",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
4
4
  "description": "Emble Vault Software Development Kit",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -85,26 +85,28 @@ class EmblemVaultSDK {
85
85
  // ** Web3 **
86
86
  //
87
87
  // Function to load web3 dynamically and attach it to the window object
88
- async loadWeb3() {
88
+ async loadWeb3(): Promise<any | undefined> {
89
89
  try {
90
90
  // Dynamically import the Web3 module
91
91
  const { default: Web3 } = await import('web3');
92
-
92
+
93
93
  // Check if MetaMask (window.ethereum) is available
94
94
  if (window.ethereum) {
95
-
95
+
96
96
  // Initialize Web3 with MetaMask's provider
97
97
  const web3 = new Web3(window.ethereum);
98
-
98
+
99
99
  // Attach Web3 to the window object
100
100
  window.web3 = web3;
101
-
101
+
102
102
  return web3;
103
103
  } else {
104
104
  console.error('MetaMask is not installed!');
105
+ return undefined;
105
106
  }
106
107
  } catch (error) {
107
108
  console.error('Error loading Web3 or connecting to MetaMask', error);
109
+ return undefined;
108
110
  }
109
111
  }
110
112
 
package/types/index.d.ts CHANGED
@@ -10,7 +10,7 @@ declare class EmblemVaultSDK {
10
10
  createCuratedVault(template: any): Promise<Vault>;
11
11
  fetchMetadata(tokenId: string): Promise<MetaData>;
12
12
  fetchVaultsOfType(vaultType: string, address: string): Promise<any>;
13
- loadWeb3(): Promise<import("web3").default<import("web3-eth").RegisteredSubscription> | undefined>;
13
+ loadWeb3(): Promise<any | undefined>;
14
14
  }
15
15
  declare global {
16
16
  interface Window {