useBtcConnect
Hook to connect and disconnect a BTC wallet and store the states in the BtcWalletProvider context.
💡
Note that BTC wallet connect returns a promise while disconnecting returns void. This is because BTC connecting only involves the connect side and the state is managed internally. Disconnecting does not interact with the wallet and just clears these internal states.
Usage
import { useBtcConnect } from '@dustlabs/profiles/btc';
const { isLoadingBtcConnect, handleConnect, handleDisconnect } = useBtcConnect();Return Value
{
isLoadingBtcConnect: boolean;
handleConnect: () => Promise<void>;
handleDisconnect: () => void;
}isLoadingBtcConnect
boolean
Loading state for connecting BTC wallet.
handleConnect
() => Promise<void>
Function to connect the wallet.
handleDisconnect
() => void
Function to disconnect the wallet.