@phantom/browser-injected-sdk 2.0.1 → 2.0.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.
@@ -33,7 +33,7 @@ function isInstalled() {
33
33
  try {
34
34
  const phantom = window?.phantom;
35
35
  return !!phantom;
36
- } catch (error) {
36
+ } catch {
37
37
  return false;
38
38
  }
39
39
  }
@@ -2,7 +2,7 @@ import {
2
2
  APP_PROVIDER_NOT_FOUND,
3
3
  PHANTOM_NOT_DETECTED,
4
4
  isInstalled
5
- } from "../chunk-RGKAWEP4.mjs";
5
+ } from "../chunk-5OS2MTDZ.mjs";
6
6
 
7
7
  // src/auto-confirm/getProvider.ts
8
8
  function getProvider() {
@@ -17,7 +17,7 @@ function isInstalled() {
17
17
  try {
18
18
  const phantom = window?.phantom;
19
19
  return !!phantom;
20
- } catch (error) {
20
+ } catch {
21
21
  return false;
22
22
  }
23
23
  }
@@ -4,7 +4,7 @@ import {
4
4
  __privateAdd,
5
5
  __privateMethod,
6
6
  isInstalled
7
- } from "./chunk-RGKAWEP4.mjs";
7
+ } from "./chunk-5OS2MTDZ.mjs";
8
8
 
9
9
  // src/ethereum/siwe.ts
10
10
  var ADDRESS_REGEX = /^0x[a-fA-F0-9]{40}$/;
@@ -183,7 +183,7 @@ var InjectedEthereumStrategy = class {
183
183
  method: onlyIfTrusted ? "eth_accounts" : "eth_requestAccounts"
184
184
  });
185
185
  return accounts;
186
- } catch (_) {
186
+ } catch {
187
187
  return void 0;
188
188
  }
189
189
  }
@@ -198,7 +198,7 @@ var InjectedEthereumStrategy = class {
198
198
  try {
199
199
  const accounts = await provider.request({ method: "eth_accounts" });
200
200
  return accounts || [];
201
- } catch (_) {
201
+ } catch {
202
202
  return [];
203
203
  }
204
204
  }
@@ -376,7 +376,7 @@ async function connect({ onlyIfTrusted = false } = {}) {
376
376
  triggerEvent("connect", accounts);
377
377
  return accounts;
378
378
  }
379
- } catch (error) {
379
+ } catch {
380
380
  }
381
381
  if (onlyIfTrusted) {
382
382
  throw new Error("No trusted connection available.");
@@ -387,7 +387,7 @@ async function connect({ onlyIfTrusted = false } = {}) {
387
387
  triggerEvent("connect", accounts);
388
388
  return accounts;
389
389
  }
390
- } catch (error) {
390
+ } catch {
391
391
  }
392
392
  throw new Error("Failed to connect to Phantom.");
393
393
  }
@@ -549,7 +549,7 @@ var Ethereum = class {
549
549
  triggerEvent("chainChanged", chainId);
550
550
  });
551
551
  }
552
- } catch (error) {
552
+ } catch {
553
553
  }
554
554
  }
555
555
  };
@@ -170,7 +170,7 @@ function isInstalled() {
170
170
  try {
171
171
  const phantom = window?.phantom;
172
172
  return !!phantom;
173
- } catch (error) {
173
+ } catch {
174
174
  return false;
175
175
  }
176
176
  }
@@ -229,7 +229,7 @@ var InjectedEthereumStrategy = class {
229
229
  method: onlyIfTrusted ? "eth_accounts" : "eth_requestAccounts"
230
230
  });
231
231
  return accounts;
232
- } catch (_) {
232
+ } catch {
233
233
  return void 0;
234
234
  }
235
235
  }
@@ -244,7 +244,7 @@ var InjectedEthereumStrategy = class {
244
244
  try {
245
245
  const accounts = await provider.request({ method: "eth_accounts" });
246
246
  return accounts || [];
247
- } catch (_) {
247
+ } catch {
248
248
  return [];
249
249
  }
250
250
  }
@@ -422,7 +422,7 @@ async function connect({ onlyIfTrusted = false } = {}) {
422
422
  triggerEvent("connect", accounts);
423
423
  return accounts;
424
424
  }
425
- } catch (error) {
425
+ } catch {
426
426
  }
427
427
  if (onlyIfTrusted) {
428
428
  throw new Error("No trusted connection available.");
@@ -433,7 +433,7 @@ async function connect({ onlyIfTrusted = false } = {}) {
433
433
  triggerEvent("connect", accounts);
434
434
  return accounts;
435
435
  }
436
- } catch (error) {
436
+ } catch {
437
437
  }
438
438
  throw new Error("Failed to connect to Phantom.");
439
439
  }
@@ -595,7 +595,7 @@ var Ethereum = class {
595
595
  triggerEvent("chainChanged", chainId);
596
596
  });
597
597
  }
598
- } catch (error) {
598
+ } catch {
599
599
  }
600
600
  }
601
601
  };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  createEthereumPlugin,
3
3
  createSiweMessage
4
- } from "../chunk-YVP5ANEI.mjs";
4
+ } from "../chunk-DAXQQQVE.mjs";
5
5
  import "../chunk-WUKYLWAZ.mjs";
6
- import "../chunk-RGKAWEP4.mjs";
6
+ import "../chunk-5OS2MTDZ.mjs";
7
7
  export {
8
8
  createEthereumPlugin,
9
9
  createSiweMessage
package/dist/index.js CHANGED
@@ -46,7 +46,7 @@ function isInstalled() {
46
46
  try {
47
47
  const phantom = window?.phantom;
48
48
  return !!phantom;
49
- } catch (error) {
49
+ } catch {
50
50
  return false;
51
51
  }
52
52
  }
@@ -243,7 +243,7 @@ var InjectedEthereumStrategy = class {
243
243
  method: onlyIfTrusted ? "eth_accounts" : "eth_requestAccounts"
244
244
  });
245
245
  return accounts;
246
- } catch (_) {
246
+ } catch {
247
247
  return void 0;
248
248
  }
249
249
  }
@@ -258,7 +258,7 @@ var InjectedEthereumStrategy = class {
258
258
  try {
259
259
  const accounts = await provider.request({ method: "eth_accounts" });
260
260
  return accounts || [];
261
- } catch (_) {
261
+ } catch {
262
262
  return [];
263
263
  }
264
264
  }
@@ -436,7 +436,7 @@ async function connect({ onlyIfTrusted = false } = {}) {
436
436
  triggerEvent("connect", accounts);
437
437
  return accounts;
438
438
  }
439
- } catch (error) {
439
+ } catch {
440
440
  }
441
441
  if (onlyIfTrusted) {
442
442
  throw new Error("No trusted connection available.");
@@ -447,7 +447,7 @@ async function connect({ onlyIfTrusted = false } = {}) {
447
447
  triggerEvent("connect", accounts);
448
448
  return accounts;
449
449
  }
450
- } catch (error) {
450
+ } catch {
451
451
  }
452
452
  throw new Error("Failed to connect to Phantom.");
453
453
  }
@@ -609,7 +609,7 @@ var Ethereum = class {
609
609
  triggerEvent("chainChanged", chainId);
610
610
  });
611
611
  }
612
- } catch (error) {
612
+ } catch {
613
613
  }
614
614
  }
615
615
  };
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createEthereumPlugin,
3
3
  createSiweMessage
4
- } from "./chunk-YVP5ANEI.mjs";
4
+ } from "./chunk-DAXQQQVE.mjs";
5
5
  import "./chunk-WUKYLWAZ.mjs";
6
6
  import {
7
7
  isInstalled
8
- } from "./chunk-RGKAWEP4.mjs";
8
+ } from "./chunk-5OS2MTDZ.mjs";
9
9
 
10
10
  // src/extension/plugin.ts
11
11
  var extension = {
@@ -46,7 +46,7 @@ function isInstalled() {
46
46
  try {
47
47
  const phantom = window?.phantom;
48
48
  return !!phantom;
49
- } catch (error) {
49
+ } catch {
50
50
  return false;
51
51
  }
52
52
  }
@@ -103,7 +103,7 @@ var InjectedSolanaStrategy = class {
103
103
  try {
104
104
  const result = await provider.connect({ onlyIfTrusted });
105
105
  return result.publicKey.toString();
106
- } catch (_) {
106
+ } catch {
107
107
  return void 0;
108
108
  }
109
109
  }
@@ -263,7 +263,7 @@ async function connect({ onlyIfTrusted = false } = {}) {
263
263
  triggerEvent("connect", address);
264
264
  return address;
265
265
  }
266
- } catch (error) {
266
+ } catch {
267
267
  }
268
268
  if (onlyIfTrusted) {
269
269
  throw new Error("No trusted connection available.");
@@ -274,7 +274,7 @@ async function connect({ onlyIfTrusted = false } = {}) {
274
274
  triggerEvent("connect", address);
275
275
  return address;
276
276
  }
277
- } catch (error) {
277
+ } catch {
278
278
  }
279
279
  throw new Error("Failed to connect to Phantom.");
280
280
  }
@@ -414,7 +414,7 @@ var Solana = class {
414
414
  }
415
415
  });
416
416
  }
417
- } catch (error) {
417
+ } catch {
418
418
  }
419
419
  }
420
420
  };
@@ -5,7 +5,7 @@ import {
5
5
  __privateAdd,
6
6
  __privateMethod,
7
7
  isInstalled
8
- } from "../chunk-RGKAWEP4.mjs";
8
+ } from "../chunk-5OS2MTDZ.mjs";
9
9
 
10
10
  // src/solana/strategies/injected.ts
11
11
  var MAX_RETRIES = 6;
@@ -59,7 +59,7 @@ var InjectedSolanaStrategy = class {
59
59
  try {
60
60
  const result = await provider.connect({ onlyIfTrusted });
61
61
  return result.publicKey.toString();
62
- } catch (_) {
62
+ } catch {
63
63
  return void 0;
64
64
  }
65
65
  }
@@ -219,7 +219,7 @@ async function connect({ onlyIfTrusted = false } = {}) {
219
219
  triggerEvent("connect", address);
220
220
  return address;
221
221
  }
222
- } catch (error) {
222
+ } catch {
223
223
  }
224
224
  if (onlyIfTrusted) {
225
225
  throw new Error("No trusted connection available.");
@@ -230,7 +230,7 @@ async function connect({ onlyIfTrusted = false } = {}) {
230
230
  triggerEvent("connect", address);
231
231
  return address;
232
232
  }
233
- } catch (error) {
233
+ } catch {
234
234
  }
235
235
  throw new Error("Failed to connect to Phantom.");
236
236
  }
@@ -370,7 +370,7 @@ var Solana = class {
370
370
  }
371
371
  });
372
372
  }
373
- } catch (error) {
373
+ } catch {
374
374
  }
375
375
  }
376
376
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phantom/browser-injected-sdk",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/phantom/phantom-connect-sdk",
@@ -41,20 +41,20 @@
41
41
  "build": "rimraf ./dist && tsup src/index.ts src/solana/index.ts src/auto-confirm/index.ts src/ethereum/index.ts --format cjs,esm --dts",
42
42
  "build:watch": "rimraf ./dist && tsup src/index.ts src/solana/index.ts src/auto-confirm/index.ts src/ethereum/index.ts --format cjs,esm --dts --watch",
43
43
  "dev": "rimraf ./dist && tsup src/index.ts src/solana/index.ts src/auto-confirm/index.ts src/ethereum/index.ts --format cjs,esm --dts --watch",
44
- "lint": "tsc --noEmit && eslint --cache . --ext .ts,.tsx",
44
+ "lint": "tsc --noEmit && eslint --cache .",
45
45
  "check-types": "tsc --noEmit",
46
46
  "test": "jest",
47
47
  "prettier": "prettier --write \"src/**/*.{ts,tsx}\""
48
48
  },
49
49
  "dependencies": {
50
- "@phantom/chain-interfaces": "^2.0.1",
51
- "@phantom/constants": "^2.0.1",
52
- "@phantom/sdk-types": "^2.0.1"
50
+ "@phantom/chain-interfaces": "^2.0.2",
51
+ "@phantom/constants": "^2.0.2",
52
+ "@phantom/sdk-types": "^2.0.2"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@jest/fake-timers": "^29.7.0",
56
56
  "@types/jest": "^29.5.14",
57
- "eslint": "8.53.0",
57
+ "eslint": "10.2.1",
58
58
  "jest": "^29.7.0",
59
59
  "jest-environment-jsdom": "^29.7.0",
60
60
  "prettier": "^3.5.2",