@ordao/privy-react-orclient
Version:
"Helpers for using orclient with privy and react"
13 lines (12 loc) • 676 B
JavaScript
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, backupProviderURLs, orclientConfig, timeout }) {
const userWallet = useUserWallet();
const { orclient, rpcError } = useOrclientWithBackup(backupProviderURLs, deployment, userWallet, orclientConfig, timeout);
const Provider = OrclientContext.Provider;
return (_jsx(Provider, { value: { orclient, rpcError }, children: children }));
}
;