useZky Hook
The useZky hook is a utility provided by the Zky Toolkit that allows you to easily access information about the connected wallet, including addresses, connection status, and balances (both Bitcoin and
import { useZky } from "@kondor-finance/zky-toolkit";
export default function WalletInfo() {
const { addresses, publicKeys, connection, balance } = useZky();
return (
<div>
<h2>Wallet Information</h2>
<div>
<p><strong>Bitcoin Address:</strong> {addresses.btcAddress || "Not connected"}</p>
<p><strong>Ordinals Address:</strong> {addresses.ordinalsAddress || "Not connected"}</p>
<p><strong>EVM Address:</strong> {addresses.evmAddress || "Not connected"}</p>
<p><strong>Bitcoin Public Key:</strong> {publicKeys.btcPublicKey || "Not connected"}</p>
<p><strong>Ordinals Public Key:</strong> {publicKeys.ordinalsPublicKey || "Not connected"}</p>
<p><strong>EVM Public Key:</strong> {publicKeys.evmPublicKey || "Not connected"}</p>
</div>
<div>
<h3>Connection</h3>
<p><strong>Connected:</strong> {connection.isConnected ? "Yes" : "No"}</p>
<p><strong>Chain Name:</strong> {connection.chain.name || "Unknown"}</p>
</div>
<div>
<h3>Balances</h3>
<p><strong>Bitcoin Balance:</strong> {balance.btcBalance} sats</p>
<p><strong>{balance.evmBalance.chainName} Balance:</strong> {balance.evmBalance.balance.toString()} wei</p>
</div>
</div>
);
}
Last updated