UNPKG

@privy-io/react-auth

Version:

React client for the Privy Auth API

2 lines (1 loc) 691 B
import{g as e}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{useContext as r,createContext as t}from"react";const a=e=>{if("ethereum"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier"};if("solana"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"solana-address-verifier"};throw Error("Failed to get account entropy details")},i=(r,t)=>{if(t?.imported)return a(t);let i=e(r);if(!i)throw Error("Failed to find primary wallet");return a(i)},o=/*#__PURE__*/t(null);function n(){let e=r(o);return null===e?(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1}):e}export{o as U,i as g,a as t,n as u};