UNPKG

@ordao/privy-react-orclient

Version:

"Helpers for using orclient with privy and react"

13 lines (12 loc) 654 B
import { jsx as _jsx } from "react/jsx-runtime"; import { createContext } from 'react'; import { useUserWallet } from '../useUserWallet.js'; import { useOrclientWithBackup } from '../useOrclient'; export const OrclientContext = createContext({ orclient: undefined }); export function OrclientProvider({ children, deployment, backupProviderURL, orclientConfig, timeout }) { const userWallet = useUserWallet(); const value = useOrclientWithBackup(backupProviderURL, deployment, userWallet, orclientConfig, timeout); const Provider = OrclientContext.Provider; return (_jsx(Provider, { value: { orclient: value }, children: children })); } ;