@coin-voyage/paykit
Version:
Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.
26 lines • 797 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
/**
* This provider is responsible for handling reusable web3 logic across the app.
*/
import React from "react";
import { useWalletConnectUri } from "../../../hooks/useWalletConnectUri";
const Web3Context = React.createContext({
connect: {
getUri: () => "",
},
});
export const Web3ContextProvider = ({ enabled, children, }) => {
const { uri: walletConnectUri } = useWalletConnectUri({
enabled,
});
const value = {
connect: {
getUri: () => {
return walletConnectUri;
},
},
};
return _jsx(Web3Context.Provider, { value: value, children: children });
};
export const useWeb3 = () => React.useContext(Web3Context);
//# sourceMappingURL=index.js.map