@roochnetwork/rooch-sdk-kit
Version:
Rooch SDK Kit
28 lines (24 loc) • 811 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);
}
// src/hooks/wallet/useWallets.ts
function useWallets() {
return useWalletStore((state) => state.wallets);
}
export {
useWallets
};
//# sourceMappingURL=useWallets.js.map