You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
export const onCronjob: OnCronjobHandler = async ({ request }) => {
const wallet = await Wallet.getCurrentWallet();
const mainnet_client = new Client("mainnet");
const engine = new NotificationEngine(mainnet_client, wallet);
switch (request.method) {
case 'NotificationEngine':{
console.log("notification check");
await engine.checkForNotifications();
return null;
}
default:
throw new Error('Method not found.');
}
};
Access encrypted state inside of a cronJob handler. If the extension is locked, then the extension will pop up a window for the user to unlock the extension. This is annoying because it will happen every time the cronJob fires. There are two solutions:
This section of code from
/snap/index.tsx
:Access encrypted state inside of a cronJob handler. If the extension is locked, then the extension will pop up a window for the user to unlock the extension. This is annoying because it will happen every time the cronJob fires. There are two solutions:
encrypted
parameter to false, but you should not store anything critical in that state: https://docs.metamask.io/snaps/reference/snaps-api/#snap_managestateThe text was updated successfully, but these errors were encountered: