@omnisat/lasereyes 0.0.69 → 0.0.70
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 +34 -33
- package/dist/index.mjs +34 -33
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -899,19 +899,17 @@ var LaserEyesProvider = ({
|
|
|
899
899
|
try {
|
|
900
900
|
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, OYL);
|
|
901
901
|
const lib = window.oyl;
|
|
902
|
-
|
|
903
|
-
const
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
setPaymentAddress(
|
|
902
|
+
console.log({ lib });
|
|
903
|
+
const { nativeSegwit, taproot } = yield lib.getAddresses();
|
|
904
|
+
setAddress(taproot.address);
|
|
905
|
+
setPublicKey(taproot.publicKey);
|
|
906
|
+
setPaymentPublicKey(nativeSegwit.publicKey);
|
|
907
|
+
setPaymentAddress(nativeSegwit.address);
|
|
908
908
|
setLibrary(lib);
|
|
909
909
|
setProvider(OYL);
|
|
910
|
-
handleAccountsChanged(result);
|
|
911
910
|
setConnected(true);
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
});
|
|
911
|
+
const balance2 = yield lib == null ? void 0 : lib.getBalance();
|
|
912
|
+
setBalance(balance2 == null ? void 0 : balance2.total);
|
|
915
913
|
} catch (error) {
|
|
916
914
|
throw new Error(`Can't lasereyes to ${OYL} wallet`);
|
|
917
915
|
}
|
|
@@ -1413,10 +1411,10 @@ var LaserEyesProvider = ({
|
|
|
1413
1411
|
setBalance(bal);
|
|
1414
1412
|
return bal;
|
|
1415
1413
|
} else if (provider === OYL) {
|
|
1416
|
-
const
|
|
1417
|
-
const bal =
|
|
1418
|
-
setBalance(bal);
|
|
1419
|
-
return bal;
|
|
1414
|
+
const lib = window == null ? void 0 : window.oyl;
|
|
1415
|
+
const bal = yield lib.getBalance();
|
|
1416
|
+
setBalance(bal.total);
|
|
1417
|
+
return bal.total;
|
|
1420
1418
|
} else if (provider === MAGIC_EDEN) {
|
|
1421
1419
|
const bal = yield getBTCBalance(paymentAddress, network);
|
|
1422
1420
|
setBalance(bal);
|
|
@@ -1498,7 +1496,7 @@ var LaserEyesProvider = ({
|
|
|
1498
1496
|
}
|
|
1499
1497
|
}
|
|
1500
1498
|
} else if (provider === OYL) {
|
|
1501
|
-
const { psbtHex
|
|
1499
|
+
const { psbtHex } = yield createSendBtcPsbt(
|
|
1502
1500
|
address2,
|
|
1503
1501
|
paymentAddress,
|
|
1504
1502
|
to,
|
|
@@ -1601,8 +1599,13 @@ var LaserEyesProvider = ({
|
|
|
1601
1599
|
}
|
|
1602
1600
|
}
|
|
1603
1601
|
} else if (provider === OYL) {
|
|
1602
|
+
const lib = window == null ? void 0 : window.oyl;
|
|
1604
1603
|
const tempAddy = toSignAddress || paymentAddress;
|
|
1605
|
-
|
|
1604
|
+
const response = yield lib == null ? void 0 : lib.signMessage({
|
|
1605
|
+
address: tempAddy,
|
|
1606
|
+
message
|
|
1607
|
+
});
|
|
1608
|
+
return response.signature;
|
|
1606
1609
|
} else if (provider === MAGIC_EDEN) {
|
|
1607
1610
|
const tempAddy = toSignAddress || paymentAddress;
|
|
1608
1611
|
let signedMessage;
|
|
@@ -1776,22 +1779,18 @@ var LaserEyesProvider = ({
|
|
|
1776
1779
|
txId
|
|
1777
1780
|
};
|
|
1778
1781
|
} else if (provider === OYL) {
|
|
1779
|
-
const
|
|
1780
|
-
const
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
signedPsbtBase64: psbtSignedPsbt.toBase64(),
|
|
1792
|
-
txId: void 0
|
|
1793
|
-
};
|
|
1794
|
-
}
|
|
1782
|
+
const lib = window == null ? void 0 : window.oyl;
|
|
1783
|
+
const { psbt: psbt2, txid } = yield lib == null ? void 0 : lib.signPsbt({
|
|
1784
|
+
psbt: psbtHex,
|
|
1785
|
+
finalize,
|
|
1786
|
+
broadcast
|
|
1787
|
+
});
|
|
1788
|
+
const psbtSignedPsbt = bitcoin2.Psbt.fromHex(psbt2);
|
|
1789
|
+
return {
|
|
1790
|
+
signedPsbtHex: psbtSignedPsbt.toHex(),
|
|
1791
|
+
signedPsbtBase64: psbtSignedPsbt.toBase64(),
|
|
1792
|
+
txId: txid
|
|
1793
|
+
};
|
|
1795
1794
|
} else if (provider === MAGIC_EDEN) {
|
|
1796
1795
|
const toSignPsbt = bitcoin2.Psbt.fromBase64(String(psbtBase64), {
|
|
1797
1796
|
network: getBitcoinNetwork(network)
|
|
@@ -1979,7 +1978,9 @@ var LaserEyesProvider = ({
|
|
|
1979
1978
|
if (provider === UNISAT) {
|
|
1980
1979
|
return yield import_axios2.default.post(`${getMempoolSpaceUrl2(network)}/api/tx`, psbt).then((res) => res.data);
|
|
1981
1980
|
} else if (provider === OYL) {
|
|
1982
|
-
|
|
1981
|
+
const oylLib = window == null ? void 0 : window.oyl;
|
|
1982
|
+
const response = yield oylLib.pushPsbt({ psbt });
|
|
1983
|
+
return response.txid;
|
|
1983
1984
|
} else if (provider === OKX) {
|
|
1984
1985
|
return yield import_axios2.default.post(`${getMempoolSpaceUrl2(network)}/api/tx`, psbt).then((res) => res.data);
|
|
1985
1986
|
} else if (provider === MAGIC_EDEN) {
|
package/dist/index.mjs
CHANGED
|
@@ -804,19 +804,17 @@ var LaserEyesProvider = ({
|
|
|
804
804
|
try {
|
|
805
805
|
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, OYL);
|
|
806
806
|
const lib = window.oyl;
|
|
807
|
-
|
|
808
|
-
const
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
setPaymentAddress(
|
|
807
|
+
console.log({ lib });
|
|
808
|
+
const { nativeSegwit, taproot } = yield lib.getAddresses();
|
|
809
|
+
setAddress(taproot.address);
|
|
810
|
+
setPublicKey(taproot.publicKey);
|
|
811
|
+
setPaymentPublicKey(nativeSegwit.publicKey);
|
|
812
|
+
setPaymentAddress(nativeSegwit.address);
|
|
813
813
|
setLibrary(lib);
|
|
814
814
|
setProvider(OYL);
|
|
815
|
-
handleAccountsChanged(result);
|
|
816
815
|
setConnected(true);
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
});
|
|
816
|
+
const balance2 = yield lib == null ? void 0 : lib.getBalance();
|
|
817
|
+
setBalance(balance2 == null ? void 0 : balance2.total);
|
|
820
818
|
} catch (error) {
|
|
821
819
|
throw new Error(`Can't lasereyes to ${OYL} wallet`);
|
|
822
820
|
}
|
|
@@ -1318,10 +1316,10 @@ var LaserEyesProvider = ({
|
|
|
1318
1316
|
setBalance(bal);
|
|
1319
1317
|
return bal;
|
|
1320
1318
|
} else if (provider === OYL) {
|
|
1321
|
-
const
|
|
1322
|
-
const bal =
|
|
1323
|
-
setBalance(bal);
|
|
1324
|
-
return bal;
|
|
1319
|
+
const lib = window == null ? void 0 : window.oyl;
|
|
1320
|
+
const bal = yield lib.getBalance();
|
|
1321
|
+
setBalance(bal.total);
|
|
1322
|
+
return bal.total;
|
|
1325
1323
|
} else if (provider === MAGIC_EDEN) {
|
|
1326
1324
|
const bal = yield getBTCBalance(paymentAddress, network);
|
|
1327
1325
|
setBalance(bal);
|
|
@@ -1403,7 +1401,7 @@ var LaserEyesProvider = ({
|
|
|
1403
1401
|
}
|
|
1404
1402
|
}
|
|
1405
1403
|
} else if (provider === OYL) {
|
|
1406
|
-
const { psbtHex
|
|
1404
|
+
const { psbtHex } = yield createSendBtcPsbt(
|
|
1407
1405
|
address2,
|
|
1408
1406
|
paymentAddress,
|
|
1409
1407
|
to,
|
|
@@ -1506,8 +1504,13 @@ var LaserEyesProvider = ({
|
|
|
1506
1504
|
}
|
|
1507
1505
|
}
|
|
1508
1506
|
} else if (provider === OYL) {
|
|
1507
|
+
const lib = window == null ? void 0 : window.oyl;
|
|
1509
1508
|
const tempAddy = toSignAddress || paymentAddress;
|
|
1510
|
-
|
|
1509
|
+
const response = yield lib == null ? void 0 : lib.signMessage({
|
|
1510
|
+
address: tempAddy,
|
|
1511
|
+
message
|
|
1512
|
+
});
|
|
1513
|
+
return response.signature;
|
|
1511
1514
|
} else if (provider === MAGIC_EDEN) {
|
|
1512
1515
|
const tempAddy = toSignAddress || paymentAddress;
|
|
1513
1516
|
let signedMessage;
|
|
@@ -1681,22 +1684,18 @@ var LaserEyesProvider = ({
|
|
|
1681
1684
|
txId
|
|
1682
1685
|
};
|
|
1683
1686
|
} else if (provider === OYL) {
|
|
1684
|
-
const
|
|
1685
|
-
const
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
signedPsbtBase64: psbtSignedPsbt.toBase64(),
|
|
1697
|
-
txId: void 0
|
|
1698
|
-
};
|
|
1699
|
-
}
|
|
1687
|
+
const lib = window == null ? void 0 : window.oyl;
|
|
1688
|
+
const { psbt: psbt2, txid } = yield lib == null ? void 0 : lib.signPsbt({
|
|
1689
|
+
psbt: psbtHex,
|
|
1690
|
+
finalize,
|
|
1691
|
+
broadcast
|
|
1692
|
+
});
|
|
1693
|
+
const psbtSignedPsbt = bitcoin2.Psbt.fromHex(psbt2);
|
|
1694
|
+
return {
|
|
1695
|
+
signedPsbtHex: psbtSignedPsbt.toHex(),
|
|
1696
|
+
signedPsbtBase64: psbtSignedPsbt.toBase64(),
|
|
1697
|
+
txId: txid
|
|
1698
|
+
};
|
|
1700
1699
|
} else if (provider === MAGIC_EDEN) {
|
|
1701
1700
|
const toSignPsbt = bitcoin2.Psbt.fromBase64(String(psbtBase64), {
|
|
1702
1701
|
network: getBitcoinNetwork(network)
|
|
@@ -1884,7 +1883,9 @@ var LaserEyesProvider = ({
|
|
|
1884
1883
|
if (provider === UNISAT) {
|
|
1885
1884
|
return yield axios2.post(`${getMempoolSpaceUrl2(network)}/api/tx`, psbt).then((res) => res.data);
|
|
1886
1885
|
} else if (provider === OYL) {
|
|
1887
|
-
|
|
1886
|
+
const oylLib = window == null ? void 0 : window.oyl;
|
|
1887
|
+
const response = yield oylLib.pushPsbt({ psbt });
|
|
1888
|
+
return response.txid;
|
|
1888
1889
|
} else if (provider === OKX) {
|
|
1889
1890
|
return yield axios2.post(`${getMempoolSpaceUrl2(network)}/api/tx`, psbt).then((res) => res.data);
|
|
1890
1891
|
} else if (provider === MAGIC_EDEN) {
|