useBitcoin Hook
The useBitcoin hook is a part of the Zky Toolkit that allows you to interact with Bitcoin-related functionalities, including signing messages, signing PSBTs, and sending Bitcoin transfers.
import { useBitcoin } from "@kondor-finance/zky-toolkit";
const ExampleComponent = () => {
const { signMessage, signPsbt, sendTransfer } = useBitcoin();
const handleSendTransfer = () => {
sendTransfer(2N3FqSKBPmM6XUxSftdAmVASt4jmFGdPygF, "100000")
.then((txId) => {
console.log("Transaction successful with ID:", txId);
})
.catch((error) => {
console.error("Failed to send transaction:", error);
});
};
return (
<button onClick={handleSendTransfer}>
Send Bitcoin
</button>
);
};
Installation and Setup
Last updated