@omnisat/lasereyes 0.0.15 → 0.0.16
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.d.ts +0 -3
- package/dist/index.js +1 -52
- package/dist/index.mjs +2 -53
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -110,9 +110,6 @@ type LaserEyesContextType = {
|
|
|
110
110
|
txId?: string;
|
|
111
111
|
} | undefined>;
|
|
112
112
|
pushPsbt: (tx: string) => Promise<string | undefined>;
|
|
113
|
-
inscribe: (content: any) => Promise<string | undefined>;
|
|
114
|
-
isCreatingCommit: boolean;
|
|
115
|
-
isInscribing: boolean;
|
|
116
113
|
};
|
|
117
114
|
type Config = {
|
|
118
115
|
network: typeof MAINNET | typeof TESTNET | typeof REGTEST;
|
package/dist/index.js
CHANGED
|
@@ -531,7 +531,6 @@ var LaserEyesContext = (0, import_react.createContext)(initialWalletContext);
|
|
|
531
531
|
var useLaserEyes = () => {
|
|
532
532
|
return (0, import_react.useContext)(LaserEyesContext);
|
|
533
533
|
};
|
|
534
|
-
var DeSCRIBE_API_URL = "http://localhost:3000/api";
|
|
535
534
|
var LaserEyesProvider = ({
|
|
536
535
|
children,
|
|
537
536
|
config
|
|
@@ -1685,53 +1684,6 @@ var LaserEyesProvider = ({
|
|
|
1685
1684
|
throw error;
|
|
1686
1685
|
}
|
|
1687
1686
|
});
|
|
1688
|
-
const [isCreatingCommit, setIsCreatingCommit] = (0, import_react.useState)(false);
|
|
1689
|
-
const [isInscribing, setIsInscribing] = (0, import_react.useState)(false);
|
|
1690
|
-
const inscribe = (content) => __async(void 0, null, function* () {
|
|
1691
|
-
var _a;
|
|
1692
|
-
try {
|
|
1693
|
-
console.log("inscribing!");
|
|
1694
|
-
if (!library)
|
|
1695
|
-
throw new Error("Library not found");
|
|
1696
|
-
if (!paymentAddress)
|
|
1697
|
-
throw new Error("Payment address not found");
|
|
1698
|
-
if (!paymentPublicKey)
|
|
1699
|
-
throw new Error("Payment public key not found");
|
|
1700
|
-
setIsCreatingCommit(true);
|
|
1701
|
-
const commitResponse = yield import_axios2.default.post(`${DeSCRIBE_API_URL}/create-inscription`, {
|
|
1702
|
-
content,
|
|
1703
|
-
paymentAddress,
|
|
1704
|
-
paymentPublicKey,
|
|
1705
|
-
feeRate: 10,
|
|
1706
|
-
mimeType: "text/plain;charset=utf-8"
|
|
1707
|
-
}).then((res) => res.data).finally(() => setIsCreatingCommit(false));
|
|
1708
|
-
const signedResponse = yield signPsbt(commitResponse.psbtHex, true, true);
|
|
1709
|
-
if (!signedResponse)
|
|
1710
|
-
throw new Error("Error signing PSBT");
|
|
1711
|
-
if (!signedResponse.txId)
|
|
1712
|
-
throw new Error("Error pushing PSBT");
|
|
1713
|
-
const { txId: commitTxId } = signedResponse;
|
|
1714
|
-
setIsInscribing(true);
|
|
1715
|
-
let txId;
|
|
1716
|
-
try {
|
|
1717
|
-
txId = yield import_axios2.default.post(`${DeSCRIBE_API_URL}/inscribe`, {
|
|
1718
|
-
content,
|
|
1719
|
-
mimeType: "text/plain;charset=utf-8",
|
|
1720
|
-
ordinalAddress: address2,
|
|
1721
|
-
commitTxId
|
|
1722
|
-
}).then((res) => res.data).finally(() => setIsInscribing(false));
|
|
1723
|
-
} catch (e) {
|
|
1724
|
-
throw e;
|
|
1725
|
-
}
|
|
1726
|
-
if (!txId)
|
|
1727
|
-
throw new Error("Error inscribing");
|
|
1728
|
-
return txId;
|
|
1729
|
-
} catch (error) {
|
|
1730
|
-
if (error instanceof import_axios2.AxiosError && ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data)) {
|
|
1731
|
-
throw new Error(error.response.data);
|
|
1732
|
-
}
|
|
1733
|
-
}
|
|
1734
|
-
});
|
|
1735
1687
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1736
1688
|
LaserEyesContext.Provider,
|
|
1737
1689
|
{
|
|
@@ -1767,10 +1719,7 @@ var LaserEyesProvider = ({
|
|
|
1767
1719
|
sendBTC,
|
|
1768
1720
|
signPsbt,
|
|
1769
1721
|
pushPsbt,
|
|
1770
|
-
signMessage
|
|
1771
|
-
inscribe,
|
|
1772
|
-
isCreatingCommit,
|
|
1773
|
-
isInscribing
|
|
1722
|
+
signMessage
|
|
1774
1723
|
},
|
|
1775
1724
|
children
|
|
1776
1725
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -447,13 +447,12 @@ import {
|
|
|
447
447
|
signTransaction
|
|
448
448
|
} from "sats-connect";
|
|
449
449
|
import { fromOutputScript } from "bitcoinjs-lib/src/address";
|
|
450
|
-
import axios2
|
|
450
|
+
import axios2 from "axios";
|
|
451
451
|
import { jsx } from "react/jsx-runtime";
|
|
452
452
|
var LaserEyesContext = createContext(initialWalletContext);
|
|
453
453
|
var useLaserEyes = () => {
|
|
454
454
|
return useContext(LaserEyesContext);
|
|
455
455
|
};
|
|
456
|
-
var DeSCRIBE_API_URL = "http://localhost:3000/api";
|
|
457
456
|
var LaserEyesProvider = ({
|
|
458
457
|
children,
|
|
459
458
|
config
|
|
@@ -1607,53 +1606,6 @@ var LaserEyesProvider = ({
|
|
|
1607
1606
|
throw error;
|
|
1608
1607
|
}
|
|
1609
1608
|
});
|
|
1610
|
-
const [isCreatingCommit, setIsCreatingCommit] = useState(false);
|
|
1611
|
-
const [isInscribing, setIsInscribing] = useState(false);
|
|
1612
|
-
const inscribe = (content) => __async(void 0, null, function* () {
|
|
1613
|
-
var _a;
|
|
1614
|
-
try {
|
|
1615
|
-
console.log("inscribing!");
|
|
1616
|
-
if (!library)
|
|
1617
|
-
throw new Error("Library not found");
|
|
1618
|
-
if (!paymentAddress)
|
|
1619
|
-
throw new Error("Payment address not found");
|
|
1620
|
-
if (!paymentPublicKey)
|
|
1621
|
-
throw new Error("Payment public key not found");
|
|
1622
|
-
setIsCreatingCommit(true);
|
|
1623
|
-
const commitResponse = yield axios2.post(`${DeSCRIBE_API_URL}/create-inscription`, {
|
|
1624
|
-
content,
|
|
1625
|
-
paymentAddress,
|
|
1626
|
-
paymentPublicKey,
|
|
1627
|
-
feeRate: 10,
|
|
1628
|
-
mimeType: "text/plain;charset=utf-8"
|
|
1629
|
-
}).then((res) => res.data).finally(() => setIsCreatingCommit(false));
|
|
1630
|
-
const signedResponse = yield signPsbt(commitResponse.psbtHex, true, true);
|
|
1631
|
-
if (!signedResponse)
|
|
1632
|
-
throw new Error("Error signing PSBT");
|
|
1633
|
-
if (!signedResponse.txId)
|
|
1634
|
-
throw new Error("Error pushing PSBT");
|
|
1635
|
-
const { txId: commitTxId } = signedResponse;
|
|
1636
|
-
setIsInscribing(true);
|
|
1637
|
-
let txId;
|
|
1638
|
-
try {
|
|
1639
|
-
txId = yield axios2.post(`${DeSCRIBE_API_URL}/inscribe`, {
|
|
1640
|
-
content,
|
|
1641
|
-
mimeType: "text/plain;charset=utf-8",
|
|
1642
|
-
ordinalAddress: address2,
|
|
1643
|
-
commitTxId
|
|
1644
|
-
}).then((res) => res.data).finally(() => setIsInscribing(false));
|
|
1645
|
-
} catch (e) {
|
|
1646
|
-
throw e;
|
|
1647
|
-
}
|
|
1648
|
-
if (!txId)
|
|
1649
|
-
throw new Error("Error inscribing");
|
|
1650
|
-
return txId;
|
|
1651
|
-
} catch (error) {
|
|
1652
|
-
if (error instanceof AxiosError && ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data)) {
|
|
1653
|
-
throw new Error(error.response.data);
|
|
1654
|
-
}
|
|
1655
|
-
}
|
|
1656
|
-
});
|
|
1657
1609
|
return /* @__PURE__ */ jsx(
|
|
1658
1610
|
LaserEyesContext.Provider,
|
|
1659
1611
|
{
|
|
@@ -1689,10 +1641,7 @@ var LaserEyesProvider = ({
|
|
|
1689
1641
|
sendBTC,
|
|
1690
1642
|
signPsbt,
|
|
1691
1643
|
pushPsbt,
|
|
1692
|
-
signMessage
|
|
1693
|
-
inscribe,
|
|
1694
|
-
isCreatingCommit,
|
|
1695
|
-
isInscribing
|
|
1644
|
+
signMessage
|
|
1696
1645
|
},
|
|
1697
1646
|
children
|
|
1698
1647
|
}
|