@roochnetwork/rooch-sdk-kit
Version:
Rooch SDK Kit
23 lines (20 loc) • 707 B
JavaScript
// 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);
}
export {
useWalletStore
};
//# sourceMappingURL=useWalletStore.js.map