UNPKG

@web3auth/modal

Version:

Multi chain wallet aggregator for web3Auth

14 lines (11 loc) 452 B
import { WalletInitializationError } from '@web3auth/no-modal'; import { useContext } from 'react'; import { Web3AuthInnerContext } from '../context/Web3AuthInnerContext.js'; const useWeb3AuthInner = () => { const context = useContext(Web3AuthInnerContext); if (!context) { throw WalletInitializationError.fromCode(1000, "usage of useWeb3Auth not wrapped in `Web3AuthContextProvider`."); } return context; }; export { useWeb3AuthInner };