@privy-io/react-auth 2.6.2 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/farcaster.js +1 -1
- package/dist/cjs/getEmbeddedConnectedWallet-DTU4T9TJ.js +1 -0
- package/dist/cjs/index.js +1 -5
- package/dist/cjs/internal-context-HesndSYh.js +1 -0
- package/dist/cjs/privy-provider-CWADob3g.js +27 -0
- package/dist/cjs/smart-wallets-Dsq1trqs.js +1 -0
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/ui.js +2 -2
- package/dist/cjs/useActiveWallet-D5FyaqZJ.js +1 -0
- package/dist/cjs/useFundWallet-BsBuslJV.js +1 -0
- package/dist/dts/farcaster.d.mts +1 -1
- package/dist/dts/farcaster.d.ts +1 -1
- package/dist/dts/index.d.mts +12 -8
- package/dist/dts/index.d.ts +12 -8
- package/dist/dts/smart-wallets.d.mts +1 -1
- package/dist/dts/smart-wallets.d.ts +1 -1
- package/dist/dts/solana.d.mts +6 -6
- package/dist/dts/solana.d.ts +6 -6
- package/dist/dts/{types-CcosPsy6.d.mts → types-CsAGoXth.d.mts} +9 -9
- package/dist/dts/{types-CcosPsy6.d.ts → types-CsAGoXth.d.ts} +9 -9
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/dts/{useSolanaWallets-BHduxJmW.d.mts → useSolanaWallets-CFgYdjDv.d.mts} +18 -1
- package/dist/dts/{useSolanaWallets-BHduxJmW.d.ts → useSolanaWallets-CFgYdjDv.d.ts} +18 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/farcaster.mjs +1 -1
- package/dist/esm/getEmbeddedConnectedWallet-CSSBWE2p.mjs +1 -0
- package/dist/esm/index.mjs +1 -5
- package/dist/esm/{internal-context-CL_EG4e1.mjs → internal-context-O3TPYUku.mjs} +1 -1
- package/dist/esm/privy-provider-u_cmfixS.mjs +27 -0
- package/dist/esm/smart-wallets-vK26EMrU.mjs +1 -0
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/ui.mjs +2 -2
- package/dist/esm/useActiveWallet-Cwj5v4eK.mjs +1 -0
- package/dist/esm/useFundWallet-BPk4tVPS.mjs +1 -0
- package/package.json +4 -4
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-pmGmvR1q.js +0 -22
- package/dist/cjs/getEmbeddedConnectedWallet-CGj_I0cc.js +0 -2
- package/dist/cjs/importWallet-Du1BO6qb.js +0 -1
- package/dist/cjs/internal-context-D5TgeQk8.js +0 -1
- package/dist/cjs/prepareFundingModalData-C2_ED32S.js +0 -1
- package/dist/cjs/smart-wallets-CoYci1bf.js +0 -1
- package/dist/cjs/useActiveWallet-CaLK0Ao4.js +0 -1
- package/dist/cjs/useFundWallet-92y-LJjK.js +0 -1
- package/dist/esm/AwaitingEvmToSolBridgingScreen-DnBONxHo.mjs +0 -22
- package/dist/esm/getEmbeddedConnectedWallet-Cyt02rK3.mjs +0 -2
- package/dist/esm/importWallet-Bqr-aqzk.mjs +0 -1
- package/dist/esm/prepareFundingModalData-Bkg2jc5P.mjs +0 -1
- package/dist/esm/smart-wallets-KrlR2oLu.mjs +0 -1
- package/dist/esm/useActiveWallet-SKrFBYMY.mjs +0 -1
- package/dist/esm/useFundWallet-BvMwnH48.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useRef as e,useState as t,useCallback as n}from"react";import{http as r,createPublicClient as a}from"viem";import{l as i,e as s,ak as o,c,k as l,j as d,ar as p,au as u,at as y,as as m}from"./privy-provider-u_cmfixS.mjs";import{a as g,u as h}from"./internal-context-O3TPYUku.mjs";import{g as f}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{createSmartAccountClient as w}from"permissionless";import{toThirdwebSmartAccount as I,toLightSmartAccount as P,toBiconomySmartAccount as v,toEcdsaKernelSmartAccount as W,toSafeSmartAccount as F}from"permissionless/accounts";import{createPimlicoClient as x}from"permissionless/clients/pimlico";import{toCoinbaseSmartAccount as C,entryPoint06Address as T,entryPoint07Address as G}from"viem/account-abstraction";import{THIRDWEB as M,COINBASE_SMART_WALLET as O,LIGHT_ACCOUNT as S,BICONOMY as U,KERNEL as b,SAFE as A}from"@privy-io/js-sdk-core";let D={address:T,version:"0.6"},V={address:G,version:"0.7"},N=({owner:e,smartWalletType:t,publicClient:n})=>{switch(t){case A:return F({client:n,entryPoint:V,owners:[e],version:"1.4.1"});case b:return W({client:n,version:"0.3.1",entryPoint:V,owners:[e]});case U:return v({client:n,owners:[e],entryPoint:D});case S:return P({client:n,entryPoint:D,owner:e,version:"1.1.0"});case O:return async function({client:e,owner:t}){let[n]=await t.request({method:"eth_accounts"});if(!n)throw Error("Unable to request embedded owner for eth_accounts");return await C({client:e,owners:[{type:"local",source:"privy",address:n,sign:async({hash:e})=>await t.request({method:"secp256k1_sign",params:[e]})}]})}({client:n,owner:e});case M:return I({client:n,entryPoint:V,owner:e});default:throw Error(`Invalid smart account type: ${t}.`)}},$=["rpc.zerodev.app","public.pimlico.io","api.pimlico.io"];const _=({calls:e,chain:t,maxPriorityFeePerGas:n,maxFeePerGas:r,nonce:a})=>e.map((e=>({to:e.to||void 0,data:e.data,value:e.value,chainId:t.id,nonce:a,maxFeePerGas:r,maxPriorityFeePerGas:n}))),B=async({chain:e,paymasterContext:t,embeddedWallet:n,user:s,smartWalletsConfig:o,rpcConfig:c,privyAppId:l})=>{if(!o?.enabled||!s||!n)return;let d=await n.getEthereumProvider(),p=o?.configuredNetworks.find((t=>t.chainId===`eip155:${e.id}`));if(!p)throw new g(`The chain ${e.name} (eip155:${e.id}) must be configured in the smart wallet configuration in your dashboard`);let u=s.smartWallet?.smartWalletType??o.smartWalletType,y=i(e,c,l),m=a({chain:e,transport:r(y)}),h=t??p.paymasterContext,f=await(async({owner:e,smartWalletType:t,chain:n,publicClient:a,bundlerUrl:i,paymasterUrl:s,paymasterContext:o})=>{let c=await N({owner:e,smartWalletType:t,publicClient:a}),l=x({transport:r(i),entryPoint:c.entryPoint}),d=s?x({transport:r(s),entryPoint:c.entryPoint}):void 0;return w({account:c,chain:n,paymaster:d,paymasterContext:o,bundlerTransport:r(i),userOperation:{estimateFeesPerGas:async()=>{if($.some((e=>i.includes(e))))return await l.getUserOperationGasPrice().then((e=>e.fast));{let e=await a.estimateFeesPerGas(),t=i.includes("api.developer.coinbase.com")?175n:150n;return{...e,maxFeePerGas:e.maxFeePerGas*t/100n,maxPriorityFeePerGas:e.maxPriorityFeePerGas*t/100n}}}}})})({owner:d,smartWalletType:u,chain:e,publicClient:m,paymasterContext:h,...p});if(!f)throw new g(`Failed to create smart wallet client for chain ${e.name} (eip155:${e.id})`);return f},j=({clientConfig:r,smartWalletsConfig:a})=>{let{hideWalletUIs:i,openPrivyModal:w,appId:I,isHeadlessSigning:P}=h(),v=s(),{setModalData:W}=o(),{user:F}=c(),{chains:x}=s(),{chainId:C,clients:T,setChainId:G,chainIdState:M}=(()=>{let n=e(),[r,a]=t();return{clients:e({}),setChainId:e=>{n.current=e,a(e)},chainId:n,chainIdState:r}})(),O=x.find((e=>e.id===M)),{wallets:S}=l(),U=f(S),b=d(F),A=n((async()=>C.current),[C]),D=n((async({id:e})=>{if(!T.current[e]){let t=await B({chain:x.find((t=>t.id===e)),embeddedWallet:U,user:F,paymasterContext:r?.paymasterContext,smartWalletsConfig:a,rpcConfig:v.rpcConfig,privyAppId:I});t&&(T.current[e]=t)}G(e)}),[x,r,S,F,a]);return{wrapSmartAccountClient:e=>{T.current[e.chain.id]=e,M||G(e.chain.id);return{...e,sendTransaction:async(e,t)=>{let n=T.current[C.current];if(!n)throw new g(`Smart wallet client for chain (eip155:${C.current}) not found`);if(delete e.account,P({showWalletUIs:t?.uiOptions?.showWalletUIs}))return i.current=!0,await n.sendTransaction(e).finally((()=>i.current=!1));let r=[];"calls"in e&&void 0!==e.calls?r=[...e.calls]:"to"in e&&(r=[{to:e.to,value:e.value||BigInt(0),data:e.data||"0x"}]);let a=async()=>{if(!n.paymaster)return!1;let{paymasterAndData:t,paymasterData:a}=await n.prepareUserOperation({calls:r,maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0});return Number(t??a??0)>0};return new Promise((async(s,o)=>{i.current=!0;let{entropyId:c,entropyIdVerifier:l}=p(F);W({connectWallet:{recoveryMethod:b.recoveryMethod,connectingWalletAddress:b.address,entropyId:c,entropyIdVerifier:l,onCompleteNavigateTo:u,onFailure:()=>{}},sendTransaction:{transactionRequests:_({calls:r,chain:n.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),transactingWalletIndex:0,transactingWalletAddress:n.account.address,entropyId:c,entropyIdVerifier:l,getIsSponsored:a,signOnly:!1,onConfirm:()=>n.sendTransaction(e),onSuccess:e=>s(e.hash),onFailure:o,uiOptions:t?.uiOptions??{}}}),w(y)})).finally((()=>{i.current=!1}))},signMessage:async(e,t)=>{let n=T.current[C.current];if(!n)throw new g(`Smart wallet client for chain (eip155:${C.current}) not found`);return P({showWalletUIs:t?.uiOptions?.showWalletUIs})?(i.current=!0,await n.signMessage(e).finally((()=>i.current=!1))):new Promise((async(r,a)=>{let{entropyId:s,entropyIdVerifier:o}=p(F);i.current=!0,W({connectWallet:{recoveryMethod:b.recoveryMethod,connectingWalletAddress:b.address,entropyId:s,entropyIdVerifier:o,onCompleteNavigateTo:m,onFailure:()=>{}},signMessage:{method:"personal_sign",data:"string"==typeof e.message?e.message:e.message.raw.toString(),confirmAndSign:()=>n.signMessage(e),onSuccess:e=>r(e),onFailure:a,uiOptions:t?.uiOptions??{}}}),w(y)})).finally((()=>{i.current=!1}))},signTypedData:async(e,t)=>{let n=T.current[C.current];if(!n)throw new g(`Smart wallet client for chain (eip155:${C.current}) not found`);return delete e.account,P({showWalletUIs:t?.uiOptions?.showWalletUIs})?(i.current=!0,await n.signTypedData(e).finally((()=>i.current=!1))):new Promise((async(r,a)=>{i.current=!0;let{entropyId:s,entropyIdVerifier:o}=p(F);W({connectWallet:{recoveryMethod:b.recoveryMethod,connectingWalletAddress:b.address,entropyId:s,entropyIdVerifier:o,onCompleteNavigateTo:m,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>n.signTypedData(e),onSuccess:e=>r(e),onFailure:a,uiOptions:t?.uiOptions??{}}}),w(y)})).finally((()=>{i.current=!1}))},getChainId:A,chain:O,switchChain:D}}}},k=()=>{let{hideWalletUIs:e,openPrivyModal:t,isHeadlessSigning:n}=h(),{setModalData:r}=o(),{user:a}=c(),i=d(a);return{wrapSmartAccountClientWithUIs:s=>({...s,sendTransaction:async(o,c)=>{if(n({showWalletUIs:c?.uiOptions?.showWalletUIs}))return e.current=!0,await s.sendTransaction(o).finally((()=>e.current=!1));let l=[];"calls"in o&&void 0!==o.calls?l=[...o.calls]:"to"in o&&(l=[{to:o.to,value:o.value||BigInt(0),data:o.data||"0x"}]);let d=async()=>{if(!s.paymaster)return!1;let{paymasterAndData:e,paymasterData:t}=await s.prepareUserOperation({calls:l,maxFeePerGas:o.maxFeePerGas,maxPriorityFeePerGas:o.maxPriorityFeePerGas,nonce:o.nonce?BigInt(o.nonce):void 0});return Number(e??t??0)>0};return new Promise((async(n,m)=>{e.current=!0;let{entropyId:g,entropyIdVerifier:h}=p(a);r({connectWallet:{recoveryMethod:i.recoveryMethod,connectingWalletAddress:i.address,entropyId:g,entropyIdVerifier:h,onCompleteNavigateTo:u,onFailure:()=>{}},sendTransaction:{transactionRequests:_({calls:l,chain:s.chain,maxPriorityFeePerGas:o.maxPriorityFeePerGas,maxFeePerGas:o.maxFeePerGas,nonce:o.nonce?BigInt(o.nonce):void 0}),transactingWalletIndex:0,transactingWalletAddress:s.account.address,entropyId:g,entropyIdVerifier:h,getIsSponsored:d,signOnly:!1,onConfirm:()=>s.sendTransaction(o),onSuccess:e=>n(e.hash),onFailure:m,uiOptions:c?.uiOptions??{}}}),t(y)})).finally((()=>{e.current=!1}))},signMessage:async(o,c)=>n({showWalletUIs:c?.uiOptions?.showWalletUIs})?(e.current=!0,await s.signMessage(o).finally((()=>e.current=!1))):new Promise((async(n,l)=>{let{entropyId:d,entropyIdVerifier:u}=p(a);e.current=!0,r({connectWallet:{recoveryMethod:i.recoveryMethod,connectingWalletAddress:i.address,entropyId:d,entropyIdVerifier:u,onCompleteNavigateTo:m,onFailure:()=>{}},signMessage:{method:"personal_sign",data:"string"==typeof o.message?o.message:o.message.raw.toString(),confirmAndSign:()=>s.signMessage(o),onSuccess:e=>n(e),onFailure:l,uiOptions:c?.uiOptions??{}}}),t(y)})).finally((()=>{e.current=!1})),signTypedData:async(o,c)=>n({showWalletUIs:c?.uiOptions?.showWalletUIs})?(e.current=!0,await s.signTypedData(o).finally((()=>e.current=!1))):new Promise((async(n,l)=>{e.current=!0;let{entropyId:d,entropyIdVerifier:u}=p(a);r({connectWallet:{recoveryMethod:i.recoveryMethod,connectingWalletAddress:i.address,entropyId:d,entropyIdVerifier:u,onCompleteNavigateTo:m,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:o,confirmAndSign:()=>s.signTypedData(o),onSuccess:e=>n(e),onFailure:l,uiOptions:c?.uiOptions??{}}}),t(y)})).finally((()=>{e.current=!1}))})}};export{j as a,_ as c,B as g,k as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{useContext as e,useState as i,useEffect as r,createContext as t}from"react";import{e as n,k as c,c as a}from"./privy-provider-u_cmfixS.mjs";import{u as l,a as s,n as m}from"./internal-context-O3TPYUku.mjs";import{g as p}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{u as h,g as d,a as u}from"./smart-wallets-vK26EMrU.mjs";import"mipd";import"react-device-detect";import"viem/utils";import"viem";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/js-sdk-core";import"@marsidev/react-turnstile";import"styled-components";import"tinycolor2";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@heroicons/react/24/outline/WalletIcon";import"zustand";import"@walletconnect/ethereum-provider";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import"@heroicons/react/24/solid/DocumentCheckIcon";import"@heroicons/react/24/solid/XCircleIcon";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/LockClosedIcon";import"@heroicons/react/24/outline/PencilSquareIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/LockClosedIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"qrcode";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"@heroicons/react/24/outline/CalendarIcon";import"@headlessui/react";import"@heroicons/react/24/outline/CheckCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"@heroicons/react/24/outline/CreditCardIcon";import"@heroicons/react/24/outline/QrCodeIcon";import"@heroicons/react/24/solid/ArrowsRightLeftIcon";import"@heroicons/react/24/outline/GlobeAltIcon";import"ofetch";import"@heroicons/react/24/outline";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/outline/CloudArrowUpIcon";import"@heroicons/react/24/outline/NoSymbolIcon";import"@heroicons/react/24/outline/ClockIcon";import"@heroicons/react/24/outline/TrashIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/solid/ShieldCheckIcon";import"js-cookie";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";let C=/*#__PURE__*/t({client:void 0,getClientForChain:m});const g=({config:e,children:i})=>/*#__PURE__*/o(v,{children:/*#__PURE__*/o(y,{config:e,children:/*#__PURE__*/o(W,{children:i})})}),I=()=>{let{client:o,getClientForChain:i}=e(C);return{client:o,getClientForChain:i}};let f=/*#__PURE__*/t({config:void 0}),w=()=>{let{config:o}=e(f);return{config:o}},v=({children:e})=>{let[t,n]=i(void 0),{client:c}=l();return r((()=>{!t&&c&&(async()=>{try{if(!c)return void console.warn("No client found");let o=await c.getSmartWalletsConfig();n(o)}catch(o){console.warn("Error generating smart wallet config: ",o)}})()}),[!!c]),/*#__PURE__*/o(f.Provider,{value:{config:t},children:e})},y=({config:e,children:t})=>{let{config:m}=w(),{appId:u}=l(),{chains:C,defaultChain:g,rpcConfig:I}=n(),{wallets:f}=c(),{user:v}=a(),[y,W]=i(),{wrapSmartAccountClientWithUIs:b}=h(),S=p(f);r((()=>{(async()=>{if(!m?.enabled)return;let o=m.configuredNetworks.find((o=>o.chainId===`eip155:${g.id}`))?g:C.find((o=>m.configuredNetworks.map((o=>o.chainId)).includes(`eip155:${o.id}`)));if(!o)throw new s("Could not find smart wallets chain configurations for any Privy client configured chains. Please configure smart wallets for your chains in the Privy dashboard.");W(await d({chain:o,privyAppId:u,paymasterContext:e?.paymasterContext,rpcConfig:I,embeddedWallet:S,user:v,smartWalletsConfig:m}))})()}),[!!m?.enabled,!!v?.smartWallet,!!S]);/*#__PURE__*/return o(k.Provider,{value:{client:y,config:e,getClientForChain:async({id:o})=>{let i=p(f),r=await d({chain:C.find((e=>e.id===o)),privyAppId:u,paymasterContext:e?.paymasterContext,rpcConfig:I,embeddedWallet:i,user:v,smartWalletsConfig:m});if(!r)throw new s(`Failed to create smart wallet client for chain id: ${o}`);return b(r)}},children:t})},k=/*#__PURE__*/t({client:void 0,config:void 0,getClientForChain:m}),W=({children:i})=>{let{client:t,config:n,getClientForChain:c}=(()=>{let{client:o,config:i,getClientForChain:r}=e(k);return{client:o,config:i,getClientForChain:r}})(),{config:s}=w(),{wrapSmartAccountClient:m}=u({clientConfig:n,smartWalletsConfig:s}),{user:p}=a(),{generateSiweMessageForSmartWallet:h,linkSmartWallet:d,hideWalletUIs:g}=l();return r((()=>{(async()=>{if(t&&p&&!p?.smartWallet&&s?.enabled)try{let o=await h({address:t.account.address,chainId:`eip155:${t.chain.id}`});g.current=!0;let e=await t.signMessage({message:o});await d({signature:e,message:o,smartWalletType:s.smartWalletType})}catch(o){console.error("Error creating smart wallet:",o)}finally{g.current=!1}})()}),[!!t,!!p?.smartWallet,!!s?.enabled]),/*#__PURE__*/o(C.Provider,{value:{client:p?.smartWallet&&t?m(t):void 0,getClientForChain:c},children:i})};export{g as SmartWalletsProvider,I as useSmartWallets};
|
package/dist/esm/solana.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isWalletAdapterCompatibleStandardWallet as o}from"@solana/wallet-adapter-base";import{StandardWalletAdapter as e}from"@solana/wallet-standard-wallet-adapter-base";import{getWallets as r}from"@wallet-standard/app";import{
|
|
1
|
+
import{isWalletAdapterCompatibleStandardWallet as o}from"@solana/wallet-adapter-base";import{StandardWalletAdapter as e}from"@solana/wallet-standard-wallet-adapter-base";import{getWallets as r}from"@wallet-standard/app";import{ah as t,c as i,g as n,ai as c,aj as a,e as s,f as l,ak as p,u as m,al as h}from"./privy-provider-u_cmfixS.mjs";export{am as useSendTransaction,an as useSignMessage,D as useSolanaWallets}from"./privy-provider-u_cmfixS.mjs";import{useCallback as d}from"react";import{u as I}from"./internal-context-O3TPYUku.mjs";import{t as C}from"./useFundWallet-BPk4tVPS.mjs";export{u as useFundWallet}from"./useFundWallet-BPk4tVPS.mjs";import"react/jsx-runtime";import"mipd";import"react-device-detect";import"viem/utils";import"viem";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/js-sdk-core";import"@marsidev/react-turnstile";import"styled-components";import"tinycolor2";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@heroicons/react/24/outline/WalletIcon";import"zustand";import"@walletconnect/ethereum-provider";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import"@heroicons/react/24/solid/DocumentCheckIcon";import"@heroicons/react/24/solid/XCircleIcon";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/LockClosedIcon";import"@heroicons/react/24/outline/PencilSquareIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/LockClosedIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"qrcode";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"@heroicons/react/24/outline/CalendarIcon";import"@headlessui/react";import"@heroicons/react/24/outline/CheckCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"@heroicons/react/24/outline/CreditCardIcon";import"@heroicons/react/24/outline/QrCodeIcon";import"@heroicons/react/24/solid/ArrowsRightLeftIcon";import"@heroicons/react/24/outline/GlobeAltIcon";import"ofetch";import"@heroicons/react/24/outline";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/outline/CloudArrowUpIcon";import"@heroicons/react/24/outline/NoSymbolIcon";import"@heroicons/react/24/outline/ClockIcon";import"@heroicons/react/24/outline/TrashIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/solid/ShieldCheckIcon";import"js-cookie";import"@solana/web3.js";const g=o=>{let e,{get:i,on:n}=r(),c=o?.shouldAutoConnect??!0,a=[],s=[];function l(...o){s=(a=a.concat(...w(o))).map((o=>new t(o,c))),e?.(s)}function p(...o){s=(a=a.filter((e=>o.some((o=>e.wallet===o))))).map((o=>new t(o,c))),e?.(s)}let m=[n("register",l),n("unregister",p)];return s=(a=w(i())).map((o=>new t(o,c))),{_setOnConnectorsUpdated:o=>{e=o},onMount:()=>{m[0]||(m[0]=n("register",l)),m[1]||(m[1]=n("unregister",p))},onUnmount:()=>{let o=m.pop();for(;o;)o(),o=m.pop()},get:()=>s}};let w=r=>r.filter(o).map((o=>new e({wallet:o})));const f=()=>{let{getAccessToken:o,user:e}=i(),{refreshSessionAndUser:r,initializeWalletProxy:t}=I(),a=n();return{importWallet:d((({privateKey:i})=>c({getAccessToken:o,user:e,initializeWalletProxy:t,refreshSessionAndUser:r,emitPrivyEvent:a},{privateKey:i,chainType:"solana"})),[e,o,r,t,a])}};var v=()=>a(C);function y(o){let e=s(),{getAccessToken:r,user:t}=l(),{setModalData:i}=p(),{isHeadlessSigning:c,openModal:a,walletProxy:u,recoverPrimaryWallet:d}=I(),C=n();return m("signSolanaTransaction",o),{signTransaction:async({transaction:o,connection:n,uiOptions:s,transactionOptions:l,address:p})=>{let{signedTransaction:m}=await h({appConfig:e,getAccessToken:r,isHeadlessSigning:c,emitPrivyEvent:C,setModalData:i,openModal:a,walletProxy:u,user:t,recoverPrimaryWallet:d},{transaction:o,connection:n,transactionOptions:l,uiOptions:s,address:p,signOnly:!0});return m}}}export{t as SolanaAdapterConnector,g as toSolanaWalletConnectors,f as useImportWallet,y as useSignTransaction,v as useSolanaFundingPlugin};
|