@omnisat/lasereyes 0.0.64 → 0.0.66
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 +22 -12
- package/dist/index.mjs +22 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -797,7 +797,7 @@ var LaserEyesProvider = ({
|
|
|
797
797
|
if (provider !== UNISAT && provider !== WIZZ && !library) {
|
|
798
798
|
return;
|
|
799
799
|
}
|
|
800
|
-
const lib = window.unisat;
|
|
800
|
+
const lib = provider === WIZZ ? window.wizz : window.unisat;
|
|
801
801
|
lib.getAccounts().then((accounts2) => {
|
|
802
802
|
handleAccountsChanged(accounts2);
|
|
803
803
|
});
|
|
@@ -1260,7 +1260,8 @@ var LaserEyesProvider = ({
|
|
|
1260
1260
|
);
|
|
1261
1261
|
return phantomAccountsParsed;
|
|
1262
1262
|
} else if (provider === WIZZ) {
|
|
1263
|
-
|
|
1263
|
+
const lib = window.wizz;
|
|
1264
|
+
return yield lib.requestAccounts();
|
|
1264
1265
|
} else {
|
|
1265
1266
|
throw new Error("The connected wallet doesn't support this method..");
|
|
1266
1267
|
}
|
|
@@ -1336,7 +1337,8 @@ var LaserEyesProvider = ({
|
|
|
1336
1337
|
}
|
|
1337
1338
|
return MAINNET;
|
|
1338
1339
|
} else if (provider === WIZZ) {
|
|
1339
|
-
const
|
|
1340
|
+
const lib = window.wizz;
|
|
1341
|
+
const wizzNetwork = yield lib == null ? void 0 : lib.getNetwork();
|
|
1340
1342
|
return getNetworkForWizz(wizzNetwork);
|
|
1341
1343
|
}
|
|
1342
1344
|
return (_b = config == null ? void 0 : config.network) != null ? _b : MAINNET;
|
|
@@ -1356,11 +1358,12 @@ var LaserEyesProvider = ({
|
|
|
1356
1358
|
setNetwork(network2);
|
|
1357
1359
|
yield getBalance();
|
|
1358
1360
|
} else if (provider === WIZZ) {
|
|
1361
|
+
const lib = window.wizz;
|
|
1359
1362
|
if (network2 === FRACTAL_TESTNET || network2 === FRACTAL_MAINNET) {
|
|
1360
|
-
return yield
|
|
1363
|
+
return yield lib.switchNetwork(WIZZ_MAINNET);
|
|
1361
1364
|
}
|
|
1362
1365
|
const wantedNetwork = getNetworkForWizz(network2);
|
|
1363
|
-
yield
|
|
1366
|
+
yield lib == null ? void 0 : lib.switchNetwork(wantedNetwork);
|
|
1364
1367
|
setNetwork(network2);
|
|
1365
1368
|
yield getBalance();
|
|
1366
1369
|
} else {
|
|
@@ -1384,7 +1387,8 @@ var LaserEyesProvider = ({
|
|
|
1384
1387
|
} else if (provider === OKX) {
|
|
1385
1388
|
return yield library == null ? void 0 : library.getPublicKey();
|
|
1386
1389
|
} else if (provider === WIZZ) {
|
|
1387
|
-
|
|
1390
|
+
const lib = window.wizz;
|
|
1391
|
+
return yield lib == null ? void 0 : lib.getPublicKey();
|
|
1388
1392
|
} else {
|
|
1389
1393
|
throw new Error("The connected wallet doesn't support this method..");
|
|
1390
1394
|
}
|
|
@@ -1427,7 +1431,8 @@ var LaserEyesProvider = ({
|
|
|
1427
1431
|
setBalance(bal);
|
|
1428
1432
|
return bal;
|
|
1429
1433
|
} else if (provider === WIZZ) {
|
|
1430
|
-
const
|
|
1434
|
+
const lib = window.wizz;
|
|
1435
|
+
const balanceResponse = yield lib.getBalance();
|
|
1431
1436
|
const bal = balanceResponse.total;
|
|
1432
1437
|
setBalance(bal);
|
|
1433
1438
|
return bal;
|
|
@@ -1447,7 +1452,8 @@ var LaserEyesProvider = ({
|
|
|
1447
1452
|
} else if (provider === OKX) {
|
|
1448
1453
|
return yield library.getInscriptions(0, 10);
|
|
1449
1454
|
} else if (provider === WIZZ) {
|
|
1450
|
-
|
|
1455
|
+
const lib = window.wizz;
|
|
1456
|
+
return yield lib.getInscriptions(0, 10);
|
|
1451
1457
|
} else {
|
|
1452
1458
|
throw new Error("The connected wallet doesn't support this method..");
|
|
1453
1459
|
}
|
|
@@ -1465,7 +1471,8 @@ var LaserEyesProvider = ({
|
|
|
1465
1471
|
if (!library)
|
|
1466
1472
|
throw new Error("Library not found");
|
|
1467
1473
|
if (provider === UNISAT) {
|
|
1468
|
-
const
|
|
1474
|
+
const lib = window.unisat;
|
|
1475
|
+
const txId = yield lib == null ? void 0 : lib.sendBitcoin(to, amount);
|
|
1469
1476
|
if (!txId)
|
|
1470
1477
|
throw new Error("Transaction failed");
|
|
1471
1478
|
return txId;
|
|
@@ -1552,7 +1559,8 @@ var LaserEyesProvider = ({
|
|
|
1552
1559
|
}
|
|
1553
1560
|
}
|
|
1554
1561
|
} else if (provider === WIZZ) {
|
|
1555
|
-
const
|
|
1562
|
+
const lib = window.unisat;
|
|
1563
|
+
const txId = yield lib == null ? void 0 : lib.sendBitcoin(to, amount);
|
|
1556
1564
|
if (txId) {
|
|
1557
1565
|
return txId;
|
|
1558
1566
|
} else {
|
|
@@ -1634,7 +1642,8 @@ var LaserEyesProvider = ({
|
|
|
1634
1642
|
const binaryString = String.fromCharCode(...response.signature);
|
|
1635
1643
|
return btoa(binaryString);
|
|
1636
1644
|
} else if (provider === WIZZ) {
|
|
1637
|
-
|
|
1645
|
+
const lib = window.wizz;
|
|
1646
|
+
return yield lib == null ? void 0 : lib.signMessage(message);
|
|
1638
1647
|
} else {
|
|
1639
1648
|
throw new Error("The connected wallet doesn't support this method..");
|
|
1640
1649
|
}
|
|
@@ -1934,7 +1943,8 @@ var LaserEyesProvider = ({
|
|
|
1934
1943
|
};
|
|
1935
1944
|
}
|
|
1936
1945
|
} else if (provider === WIZZ) {
|
|
1937
|
-
const
|
|
1946
|
+
const lib = window.wizz;
|
|
1947
|
+
const signedPsbt = yield lib == null ? void 0 : lib.signPsbt(psbtHex, {
|
|
1938
1948
|
autoFinalized: finalize,
|
|
1939
1949
|
broadcast: false
|
|
1940
1950
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -702,7 +702,7 @@ var LaserEyesProvider = ({
|
|
|
702
702
|
if (provider !== UNISAT && provider !== WIZZ && !library) {
|
|
703
703
|
return;
|
|
704
704
|
}
|
|
705
|
-
const lib = window.unisat;
|
|
705
|
+
const lib = provider === WIZZ ? window.wizz : window.unisat;
|
|
706
706
|
lib.getAccounts().then((accounts2) => {
|
|
707
707
|
handleAccountsChanged(accounts2);
|
|
708
708
|
});
|
|
@@ -1165,7 +1165,8 @@ var LaserEyesProvider = ({
|
|
|
1165
1165
|
);
|
|
1166
1166
|
return phantomAccountsParsed;
|
|
1167
1167
|
} else if (provider === WIZZ) {
|
|
1168
|
-
|
|
1168
|
+
const lib = window.wizz;
|
|
1169
|
+
return yield lib.requestAccounts();
|
|
1169
1170
|
} else {
|
|
1170
1171
|
throw new Error("The connected wallet doesn't support this method..");
|
|
1171
1172
|
}
|
|
@@ -1241,7 +1242,8 @@ var LaserEyesProvider = ({
|
|
|
1241
1242
|
}
|
|
1242
1243
|
return MAINNET;
|
|
1243
1244
|
} else if (provider === WIZZ) {
|
|
1244
|
-
const
|
|
1245
|
+
const lib = window.wizz;
|
|
1246
|
+
const wizzNetwork = yield lib == null ? void 0 : lib.getNetwork();
|
|
1245
1247
|
return getNetworkForWizz(wizzNetwork);
|
|
1246
1248
|
}
|
|
1247
1249
|
return (_b = config == null ? void 0 : config.network) != null ? _b : MAINNET;
|
|
@@ -1261,11 +1263,12 @@ var LaserEyesProvider = ({
|
|
|
1261
1263
|
setNetwork(network2);
|
|
1262
1264
|
yield getBalance();
|
|
1263
1265
|
} else if (provider === WIZZ) {
|
|
1266
|
+
const lib = window.wizz;
|
|
1264
1267
|
if (network2 === FRACTAL_TESTNET || network2 === FRACTAL_MAINNET) {
|
|
1265
|
-
return yield
|
|
1268
|
+
return yield lib.switchNetwork(WIZZ_MAINNET);
|
|
1266
1269
|
}
|
|
1267
1270
|
const wantedNetwork = getNetworkForWizz(network2);
|
|
1268
|
-
yield
|
|
1271
|
+
yield lib == null ? void 0 : lib.switchNetwork(wantedNetwork);
|
|
1269
1272
|
setNetwork(network2);
|
|
1270
1273
|
yield getBalance();
|
|
1271
1274
|
} else {
|
|
@@ -1289,7 +1292,8 @@ var LaserEyesProvider = ({
|
|
|
1289
1292
|
} else if (provider === OKX) {
|
|
1290
1293
|
return yield library == null ? void 0 : library.getPublicKey();
|
|
1291
1294
|
} else if (provider === WIZZ) {
|
|
1292
|
-
|
|
1295
|
+
const lib = window.wizz;
|
|
1296
|
+
return yield lib == null ? void 0 : lib.getPublicKey();
|
|
1293
1297
|
} else {
|
|
1294
1298
|
throw new Error("The connected wallet doesn't support this method..");
|
|
1295
1299
|
}
|
|
@@ -1332,7 +1336,8 @@ var LaserEyesProvider = ({
|
|
|
1332
1336
|
setBalance(bal);
|
|
1333
1337
|
return bal;
|
|
1334
1338
|
} else if (provider === WIZZ) {
|
|
1335
|
-
const
|
|
1339
|
+
const lib = window.wizz;
|
|
1340
|
+
const balanceResponse = yield lib.getBalance();
|
|
1336
1341
|
const bal = balanceResponse.total;
|
|
1337
1342
|
setBalance(bal);
|
|
1338
1343
|
return bal;
|
|
@@ -1352,7 +1357,8 @@ var LaserEyesProvider = ({
|
|
|
1352
1357
|
} else if (provider === OKX) {
|
|
1353
1358
|
return yield library.getInscriptions(0, 10);
|
|
1354
1359
|
} else if (provider === WIZZ) {
|
|
1355
|
-
|
|
1360
|
+
const lib = window.wizz;
|
|
1361
|
+
return yield lib.getInscriptions(0, 10);
|
|
1356
1362
|
} else {
|
|
1357
1363
|
throw new Error("The connected wallet doesn't support this method..");
|
|
1358
1364
|
}
|
|
@@ -1370,7 +1376,8 @@ var LaserEyesProvider = ({
|
|
|
1370
1376
|
if (!library)
|
|
1371
1377
|
throw new Error("Library not found");
|
|
1372
1378
|
if (provider === UNISAT) {
|
|
1373
|
-
const
|
|
1379
|
+
const lib = window.unisat;
|
|
1380
|
+
const txId = yield lib == null ? void 0 : lib.sendBitcoin(to, amount);
|
|
1374
1381
|
if (!txId)
|
|
1375
1382
|
throw new Error("Transaction failed");
|
|
1376
1383
|
return txId;
|
|
@@ -1457,7 +1464,8 @@ var LaserEyesProvider = ({
|
|
|
1457
1464
|
}
|
|
1458
1465
|
}
|
|
1459
1466
|
} else if (provider === WIZZ) {
|
|
1460
|
-
const
|
|
1467
|
+
const lib = window.unisat;
|
|
1468
|
+
const txId = yield lib == null ? void 0 : lib.sendBitcoin(to, amount);
|
|
1461
1469
|
if (txId) {
|
|
1462
1470
|
return txId;
|
|
1463
1471
|
} else {
|
|
@@ -1539,7 +1547,8 @@ var LaserEyesProvider = ({
|
|
|
1539
1547
|
const binaryString = String.fromCharCode(...response.signature);
|
|
1540
1548
|
return btoa(binaryString);
|
|
1541
1549
|
} else if (provider === WIZZ) {
|
|
1542
|
-
|
|
1550
|
+
const lib = window.wizz;
|
|
1551
|
+
return yield lib == null ? void 0 : lib.signMessage(message);
|
|
1543
1552
|
} else {
|
|
1544
1553
|
throw new Error("The connected wallet doesn't support this method..");
|
|
1545
1554
|
}
|
|
@@ -1839,7 +1848,8 @@ var LaserEyesProvider = ({
|
|
|
1839
1848
|
};
|
|
1840
1849
|
}
|
|
1841
1850
|
} else if (provider === WIZZ) {
|
|
1842
|
-
const
|
|
1851
|
+
const lib = window.wizz;
|
|
1852
|
+
const signedPsbt = yield lib == null ? void 0 : lib.signPsbt(psbtHex, {
|
|
1843
1853
|
autoFinalized: finalize,
|
|
1844
1854
|
broadcast: false
|
|
1845
1855
|
});
|