@omnisat/lasereyes 0.0.65 → 0.0.67

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/index.js CHANGED
@@ -352,7 +352,7 @@ var createConfig = (config) => {
352
352
  };
353
353
 
354
354
  // src/providers/LaserEyesProvider.tsx
355
- var import_react = require("react");
355
+ var import_react = _toESM(require("react"));
356
356
  var bitcoin2 = __toESM(require("bitcoinjs-lib"));
357
357
 
358
358
  // src/consts/settings.ts
@@ -423,7 +423,7 @@ var initialWalletContext = {
423
423
  };
424
424
 
425
425
  // src/providers/LaserEyesProvider.tsx
426
- var import_usehooks_ts = require("usehooks-ts");
426
+ var import_usehooks_ts = _toESM(require("usehooks-ts"));
427
427
 
428
428
  // src/lib/helpers.ts
429
429
  var bitcoin = __toESM(require("bitcoinjs-lib"));
@@ -600,10 +600,10 @@ function delay(ms) {
600
600
  }
601
601
 
602
602
  // src/providers/LaserEyesProvider.tsx
603
- var import_sats_connect = require("sats-connect");
604
- var import_address = require("bitcoinjs-lib/src/address");
603
+ var import_sats_connect = _toESM(require("sats-connect"));
604
+ var import_address = _toESM(require("bitcoinjs-lib/src/address"));
605
605
  var import_axios2 = __toESM(require("axios"));
606
- var import_jsx_runtime = require("react/jsx-runtime");
606
+ var import_jsx_runtime = _toESM(require("react/jsx-runtime"));
607
607
  var LaserEyesContext = (0, import_react.createContext)(initialWalletContext);
608
608
  var useLaserEyes = () => {
609
609
  return (0, import_react.useContext)(LaserEyesContext);
@@ -798,7 +798,9 @@ var LaserEyesProvider = ({
798
798
  return;
799
799
  }
800
800
  const lib = provider === WIZZ ? window.wizz : window.unisat;
801
- lib.getAccounts().then((accounts2) => {
801
+ if (!lib)
802
+ return;
803
+ lib == null ? void 0 : lib.getAccounts().then((accounts2) => {
802
804
  handleAccountsChanged(accounts2);
803
805
  });
804
806
  lib.on("accountsChanged", handleAccountsChanged);
@@ -1471,7 +1473,8 @@ var LaserEyesProvider = ({
1471
1473
  if (!library)
1472
1474
  throw new Error("Library not found");
1473
1475
  if (provider === UNISAT) {
1474
- const txId = yield library == null ? void 0 : library.sendBitcoin(to, amount);
1476
+ const lib = window.unisat;
1477
+ const txId = yield lib == null ? void 0 : lib.sendBitcoin(to, amount);
1475
1478
  if (!txId)
1476
1479
  throw new Error("Transaction failed");
1477
1480
  return txId;
@@ -1558,7 +1561,8 @@ var LaserEyesProvider = ({
1558
1561
  }
1559
1562
  }
1560
1563
  } else if (provider === WIZZ) {
1561
- const txId = yield library == null ? void 0 : library.sendBitcoin(to, amount);
1564
+ const lib = window.unisat;
1565
+ const txId = yield lib == null ? void 0 : lib.sendBitcoin(to, amount);
1562
1566
  if (txId) {
1563
1567
  return txId;
1564
1568
  } else {
@@ -2036,7 +2040,7 @@ var LaserEyesProvider = ({
2036
2040
  };
2037
2041
 
2038
2042
  // src/icons/oyl.tsx
2039
- var import_jsx_runtime2 = require("react/jsx-runtime");
2043
+ var import_jsx_runtime2 = _toESM(require("react/jsx-runtime"));
2040
2044
  var OylLogo = (_a) => {
2041
2045
  var _b = _a, {
2042
2046
  size = 42,
@@ -2116,7 +2120,7 @@ var OylLogo = (_a) => {
2116
2120
  };
2117
2121
 
2118
2122
  // src/icons/leather.tsx
2119
- var import_jsx_runtime3 = require("react/jsx-runtime");
2123
+ var import_jsx_runtime3 = _toESM(require("react/jsx-runtime"));
2120
2124
  var LeatherLogo = (_a) => {
2121
2125
  var _b = _a, {
2122
2126
  size = 42,
@@ -2176,7 +2180,7 @@ var LeatherLogo = (_a) => {
2176
2180
  };
2177
2181
 
2178
2182
  // src/icons/phantom.tsx
2179
- var import_jsx_runtime4 = require("react/jsx-runtime");
2183
+ var import_jsx_runtime4 = _toESM(require("react/jsx-runtime"));
2180
2184
  var PhantomLogo = (_a) => {
2181
2185
  var _b = _a, {
2182
2186
  size = 42,
@@ -2258,7 +2262,7 @@ var PhantomLogo = (_a) => {
2258
2262
  };
2259
2263
 
2260
2264
  // src/icons/xverse.tsx
2261
- var import_jsx_runtime5 = require("react/jsx-runtime");
2265
+ var import_jsx_runtime5 = _toESM(require("react/jsx-runtime"));
2262
2266
  var XverseLogo = (_a) => {
2263
2267
  var _b = _a, {
2264
2268
  size = 42,
@@ -2310,7 +2314,7 @@ var XverseLogo = (_a) => {
2310
2314
  };
2311
2315
 
2312
2316
  // src/icons/unisat.tsx
2313
- var import_jsx_runtime6 = require("react/jsx-runtime");
2317
+ var import_jsx_runtime6 = _toESM(require("react/jsx-runtime"));
2314
2318
  var UnisatLogo = (_a) => {
2315
2319
  var _b = _a, {
2316
2320
  size = 42,
@@ -2422,7 +2426,7 @@ var UnisatLogo = (_a) => {
2422
2426
  };
2423
2427
 
2424
2428
  // src/icons/wizz.tsx
2425
- var import_jsx_runtime7 = require("react/jsx-runtime");
2429
+ var import_jsx_runtime7 = _toESM(require("react/jsx-runtime"));
2426
2430
  var WizzLogo = (_a) => {
2427
2431
  var _b = _a, {
2428
2432
  size = 42,
@@ -2493,7 +2497,7 @@ var WizzLogo = (_a) => {
2493
2497
  };
2494
2498
 
2495
2499
  // src/icons/okx.tsx
2496
- var import_jsx_runtime8 = require("react/jsx-runtime");
2500
+ var import_jsx_runtime8 = _toESM(require("react/jsx-runtime"));
2497
2501
  var OkxLogo = (_a) => {
2498
2502
  var _b = _a, {
2499
2503
  size = 42,
@@ -2535,7 +2539,7 @@ var OkxLogo = (_a) => {
2535
2539
  };
2536
2540
 
2537
2541
  // src/icons/magiceden.tsx
2538
- var import_jsx_runtime9 = require("react/jsx-runtime");
2542
+ var import_jsx_runtime9 = _toESM(require("react/jsx-runtime"));
2539
2543
  var MagicEdenLogo = (_a) => {
2540
2544
  var _b = _a, {
2541
2545
  size = 42,
@@ -2608,7 +2612,7 @@ var MagicEdenLogo = (_a) => {
2608
2612
  };
2609
2613
 
2610
2614
  // src/icons/walletIcon.tsx
2611
- var import_jsx_runtime10 = require("react/jsx-runtime");
2615
+ var import_jsx_runtime10 = _toESM(require("react/jsx-runtime"));
2612
2616
  var WalletIcon = ({
2613
2617
  size,
2614
2618
  className,
package/dist/index.mjs CHANGED
@@ -703,7 +703,9 @@ var LaserEyesProvider = ({
703
703
  return;
704
704
  }
705
705
  const lib = provider === WIZZ ? window.wizz : window.unisat;
706
- lib.getAccounts().then((accounts2) => {
706
+ if (!lib)
707
+ return;
708
+ lib == null ? void 0 : lib.getAccounts().then((accounts2) => {
707
709
  handleAccountsChanged(accounts2);
708
710
  });
709
711
  lib.on("accountsChanged", handleAccountsChanged);
@@ -1376,7 +1378,8 @@ var LaserEyesProvider = ({
1376
1378
  if (!library)
1377
1379
  throw new Error("Library not found");
1378
1380
  if (provider === UNISAT) {
1379
- const txId = yield library == null ? void 0 : library.sendBitcoin(to, amount);
1381
+ const lib = window.unisat;
1382
+ const txId = yield lib == null ? void 0 : lib.sendBitcoin(to, amount);
1380
1383
  if (!txId)
1381
1384
  throw new Error("Transaction failed");
1382
1385
  return txId;
@@ -1463,7 +1466,8 @@ var LaserEyesProvider = ({
1463
1466
  }
1464
1467
  }
1465
1468
  } else if (provider === WIZZ) {
1466
- const txId = yield library == null ? void 0 : library.sendBitcoin(to, amount);
1469
+ const lib = window.unisat;
1470
+ const txId = yield lib == null ? void 0 : lib.sendBitcoin(to, amount);
1467
1471
  if (txId) {
1468
1472
  return txId;
1469
1473
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnisat/lasereyes",
3
- "version": "0.0.65",
3
+ "version": "0.0.67",
4
4
  "sideEffects": false,
5
5
  "private": false,
6
6
  "license": "MIT",