UNPKG

@coin-voyage/paykit

Version:

Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.

21 lines 918 B
import { jsx as _jsx } from "react/jsx-runtime"; import { SuiBaseProvider } from "@coin-voyage/crypto/sui/base-provider"; import { SuiExternalContext } from "@coin-voyage/crypto/sui/external-context"; import { useSuiClientContext } from "@mysten/dapp-kit"; import { useAppContext } from "../../components/contexts/app/index"; export function useInSuiContext() { try { const externalSuiContext = useSuiClientContext(); return Boolean(externalSuiContext.config); } catch { return false; } } export function SuiProvider({ children }) { const inSUIContext = useInSuiContext(); const appContext = useAppContext(); const config = appContext.walletConfig?.sui; return inSUIContext ? (_jsx(SuiExternalContext.Provider, { value: inSUIContext, children: children })) : (_jsx(SuiBaseProvider, { config: config, children: children })); } //# sourceMappingURL=provider.js.map