mirror of
https://github.com/rjNemo/epicNFT
synced 2026-06-10 03:36:40 +00:00
16 lines
397 B
JavaScript
16 lines
397 B
JavaScript
const getEth = () => {
|
|
const {ethereum} = window;
|
|
if (!ethereum) {
|
|
alert("Wallet not detected. Make sure you have Metamask extension installed and activated.");
|
|
}
|
|
return ethereum;
|
|
};
|
|
|
|
export const withEth = (f) => async (props) => {
|
|
try {
|
|
const ethereum = getEth();
|
|
await f(ethereum, props);
|
|
} catch (error) {
|
|
console.error(error);
|
|
}
|
|
};
|