@omnisat/lasereyes 0.0.25 → 0.0.27
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 +11 -10
- package/dist/index.mjs +11 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -697,14 +697,16 @@ var LaserEyesProvider = ({
|
|
|
697
697
|
};
|
|
698
698
|
}, [library]);
|
|
699
699
|
(0, import_react.useEffect)(() => {
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
700
|
+
if (!isInitializing) {
|
|
701
|
+
const defaultWallet = localStorage == null ? void 0 : localStorage.getItem(
|
|
702
|
+
LOCAL_STORAGE_DEFAULT_WALLET
|
|
703
|
+
);
|
|
704
|
+
if (defaultWallet) {
|
|
705
|
+
setProvider(defaultWallet);
|
|
706
|
+
connect(defaultWallet);
|
|
707
|
+
}
|
|
706
708
|
}
|
|
707
|
-
}, []);
|
|
709
|
+
}, [isInitializing]);
|
|
708
710
|
const connectUnisat = (0, import_react.useCallback)(() => __async(void 0, null, function* () {
|
|
709
711
|
try {
|
|
710
712
|
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, UNISAT);
|
|
@@ -1652,7 +1654,7 @@ var LaserEyesProvider = ({
|
|
|
1652
1654
|
} else if (provider === LEATHER) {
|
|
1653
1655
|
const requestParams = {
|
|
1654
1656
|
hex: psbtHex,
|
|
1655
|
-
broadcast,
|
|
1657
|
+
broadcast: false,
|
|
1656
1658
|
network
|
|
1657
1659
|
};
|
|
1658
1660
|
const response = yield library == null ? void 0 : library.request(
|
|
@@ -1664,8 +1666,7 @@ var LaserEyesProvider = ({
|
|
|
1664
1666
|
const signed = bitcoin2.Psbt.fromHex(String(signedTx));
|
|
1665
1667
|
if (finalize && broadcast) {
|
|
1666
1668
|
const finalized = signed.finalizeAllInputs();
|
|
1667
|
-
const
|
|
1668
|
-
const txId = yield pushPsbt(extracted.toHex());
|
|
1669
|
+
const txId = yield pushPsbt(finalized.toHex());
|
|
1669
1670
|
return {
|
|
1670
1671
|
signedPsbtHex: signed.toHex(),
|
|
1671
1672
|
signedPsbtBase64: signed.toBase64(),
|
package/dist/index.mjs
CHANGED
|
@@ -620,14 +620,16 @@ var LaserEyesProvider = ({
|
|
|
620
620
|
};
|
|
621
621
|
}, [library]);
|
|
622
622
|
useEffect(() => {
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
623
|
+
if (!isInitializing) {
|
|
624
|
+
const defaultWallet = localStorage == null ? void 0 : localStorage.getItem(
|
|
625
|
+
LOCAL_STORAGE_DEFAULT_WALLET
|
|
626
|
+
);
|
|
627
|
+
if (defaultWallet) {
|
|
628
|
+
setProvider(defaultWallet);
|
|
629
|
+
connect(defaultWallet);
|
|
630
|
+
}
|
|
629
631
|
}
|
|
630
|
-
}, []);
|
|
632
|
+
}, [isInitializing]);
|
|
631
633
|
const connectUnisat = useCallback(() => __async(void 0, null, function* () {
|
|
632
634
|
try {
|
|
633
635
|
localStorage == null ? void 0 : localStorage.setItem(LOCAL_STORAGE_DEFAULT_WALLET, UNISAT);
|
|
@@ -1575,7 +1577,7 @@ var LaserEyesProvider = ({
|
|
|
1575
1577
|
} else if (provider === LEATHER) {
|
|
1576
1578
|
const requestParams = {
|
|
1577
1579
|
hex: psbtHex,
|
|
1578
|
-
broadcast,
|
|
1580
|
+
broadcast: false,
|
|
1579
1581
|
network
|
|
1580
1582
|
};
|
|
1581
1583
|
const response = yield library == null ? void 0 : library.request(
|
|
@@ -1587,8 +1589,7 @@ var LaserEyesProvider = ({
|
|
|
1587
1589
|
const signed = bitcoin2.Psbt.fromHex(String(signedTx));
|
|
1588
1590
|
if (finalize && broadcast) {
|
|
1589
1591
|
const finalized = signed.finalizeAllInputs();
|
|
1590
|
-
const
|
|
1591
|
-
const txId = yield pushPsbt(extracted.toHex());
|
|
1592
|
+
const txId = yield pushPsbt(finalized.toHex());
|
|
1592
1593
|
return {
|
|
1593
1594
|
signedPsbtHex: signed.toHex(),
|
|
1594
1595
|
signedPsbtBase64: signed.toBase64(),
|