UNPKG

@roochnetwork/rooch-sdk-kit

Version:
28 lines (24 loc) 846 B
// src/hooks/wallet/useWalletStore.ts import { useContext } from "react"; import { useStore } from "zustand"; // src/provider/walletProvider.tsx import { useCallback, createContext, useEffect, useRef } from "react"; import { BitcoinAddress } from "@roochnetwork/rooch-sdk"; import { jsx } from "react/jsx-runtime"; var WalletContext = createContext(null); // src/hooks/wallet/useWalletStore.ts function useWalletStore(selector) { const store = useContext(WalletContext); if (!store) { throw new Error("Could not find WalletContext. Ensure that you have set up the WalletProvider."); } return useStore(store, selector); } // src/hooks/wallet/useCurrentAddress.ts function useCurrentAddress() { return useWalletStore((state) => state.currentAddress); } export { useCurrentAddress }; //# sourceMappingURL=useCurrentAddress.js.map