From 042dde9c614d85df097bf98a4254c209ee17f1b9 Mon Sep 17 00:00:00 2001 From: Hassan Malik Date: Tue, 14 Jan 2025 11:25:54 -0500 Subject: [PATCH 1/3] add a way to test durations --- .../packages/bip32/snap.manifest.json | 2 +- .../packages/bip44/snap.manifest.json | 2 +- .../browserify-plugin/snap.manifest.json | 2 +- .../packages/browserify/snap.manifest.json | 2 +- .../packages/client-status/snap.manifest.json | 2 +- .../packages/cronjobs/snap.manifest.json | 2 +- .../examples/packages/cronjobs/src/index.ts | 21 +++++-- .../examples/packages/cronjobs/src/types.ts | 13 ++++- .../packages/dialogs/snap.manifest.json | 2 +- .../ethereum-provider/snap.manifest.json | 2 +- .../packages/ethers-js/snap.manifest.json | 2 +- .../packages/file-upload/snap.manifest.json | 2 +- .../packages/get-entropy/snap.manifest.json | 2 +- .../packages/get-file/snap.manifest.json | 2 +- .../packages/images/snap.manifest.json | 2 +- .../interactive-ui/snap.manifest.json | 2 +- .../consumer-signer/snap.manifest.json | 2 +- .../packages/core-signer/snap.manifest.json | 2 +- .../packages/json-rpc/snap.manifest.json | 2 +- .../packages/localization/snap.manifest.json | 2 +- .../packages/manage-state/snap.manifest.json | 2 +- .../network-access/snap.manifest.json | 2 +- .../packages/notifications/snap.manifest.json | 2 +- .../packages/preinstalled/snap.manifest.json | 2 +- .../packages/rollup-plugin/snap.manifest.json | 2 +- .../examples/packages/wasm/snap.manifest.json | 2 +- .../webpack-plugin/snap.manifest.json | 2 +- .../components/ScheduleBackgroundEvent.tsx | 58 ++++++++++++++++--- 28 files changed, 103 insertions(+), 39 deletions(-) diff --git a/packages/examples/packages/bip32/snap.manifest.json b/packages/examples/packages/bip32/snap.manifest.json index 8e4cb79a31..41dd9a95fc 100644 --- a/packages/examples/packages/bip32/snap.manifest.json +++ b/packages/examples/packages/bip32/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "ojW3Hm/UhUzUs35jVfoI9+xEsy0zoVLFzfZGZ3dgZeQ=", + "shasum": "IqWUM7iSg+nrJSYikr/aC3q3bSm6WlTcLQ45OTVkG9A=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/bip44/snap.manifest.json b/packages/examples/packages/bip44/snap.manifest.json index f044129c0e..24a542cf2b 100644 --- a/packages/examples/packages/bip44/snap.manifest.json +++ b/packages/examples/packages/bip44/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "kYRZmgdWbCe5U9mK1DBn4r1eh2VFI6TBolStHsYnwqQ=", + "shasum": "sOEC09390j3Swk29rbbSUC/xJdXcY+4J+yjWR027D1g=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/browserify-plugin/snap.manifest.json b/packages/examples/packages/browserify-plugin/snap.manifest.json index 9f578fd779..bb2d6d76c7 100644 --- a/packages/examples/packages/browserify-plugin/snap.manifest.json +++ b/packages/examples/packages/browserify-plugin/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "jyM2N8Y8sIxLacv1mwtPh41wGSt9lWsBNbFo9CSx7mM=", + "shasum": "0RVNrUD4z1+EaGY+/pYJff0D1QY8ZekIHzlppceGAz4=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/browserify/snap.manifest.json b/packages/examples/packages/browserify/snap.manifest.json index 0cc9ff36db..332a152ef8 100644 --- a/packages/examples/packages/browserify/snap.manifest.json +++ b/packages/examples/packages/browserify/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "qHCkTRpYoHUFtt9Dd0nxQyw7Eblv0e5znQ39NszlJOo=", + "shasum": "Aw+w2Wiy54F9iBymGscjK8GSV9Km3eXEA8l85pt+/10=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/client-status/snap.manifest.json b/packages/examples/packages/client-status/snap.manifest.json index e8b471c470..10f103a55c 100644 --- a/packages/examples/packages/client-status/snap.manifest.json +++ b/packages/examples/packages/client-status/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "arWIxnocunv/5esPgYG068vzZzyBxg/FcbiDILeyLCs=", + "shasum": "Yfok0ZJsaOLPeYw/d7rr2A+q2YSTnFsH/lyuQkPOy4k=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/cronjobs/snap.manifest.json b/packages/examples/packages/cronjobs/snap.manifest.json index bc19026b22..41c0370fa2 100644 --- a/packages/examples/packages/cronjobs/snap.manifest.json +++ b/packages/examples/packages/cronjobs/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "B0eoXOpzU2Cts5d42w11AdvgClmS/une3zXQ9vHnJgU=", + "shasum": "sPjBPTcb0g1o/xhWxWybs0NghAGflXxrv7JB7lRUxOc=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/cronjobs/src/index.ts b/packages/examples/packages/cronjobs/src/index.ts index e22d989580..4b77961eb7 100644 --- a/packages/examples/packages/cronjobs/src/index.ts +++ b/packages/examples/packages/cronjobs/src/index.ts @@ -6,7 +6,8 @@ import { panel, text, heading, MethodNotFoundError } from '@metamask/snaps-sdk'; import type { CancelNotificationParams, - ScheduleNotificationParams, + ScheduleNotificationParamsWithDate, + ScheduleNotificationParamsWithDuration, } from './types'; /** @@ -58,7 +59,8 @@ export const onCronjob: OnCronjobHandler = async ({ request }) => { * Handle incoming JSON-RPC requests from the dapp, sent through the * `wallet_invokeSnap` method. This handler handles three methods: * - * - `scheduleNotification`: Schedule a notification in the future. + * - `scheduleNotificationWithDate`: Schedule a notification in the future with the `date` param. + * - `scheduleNotificationWithDuration`: Schedule a notification in the future with the `duration` param. * - `cancelNotification`: Cancel a notification. * - `getBackgroundEvents`: Get the Snap's background events. * @@ -70,11 +72,22 @@ export const onCronjob: OnCronjobHandler = async ({ request }) => { */ export const onRpcRequest: OnRpcRequestHandler = async ({ request }) => { switch (request.method) { - case 'scheduleNotification': + case 'scheduleNotificationWithDate': return snap.request({ method: 'snap_scheduleBackgroundEvent', params: { - date: (request.params as ScheduleNotificationParams).date, + date: (request.params as ScheduleNotificationParamsWithDate).date, + request: { + method: 'fireNotification', + }, + }, + }); + case 'scheduleNotificationWithDuration': + return snap.request({ + method: 'snap_scheduleBackgroundEvent', + params: { + duration: (request.params as ScheduleNotificationParamsWithDuration) + .duration, request: { method: 'fireNotification', }, diff --git a/packages/examples/packages/cronjobs/src/types.ts b/packages/examples/packages/cronjobs/src/types.ts index c379c3fe4b..9a9ac7360f 100644 --- a/packages/examples/packages/cronjobs/src/types.ts +++ b/packages/examples/packages/cronjobs/src/types.ts @@ -1,12 +1,21 @@ /** - * The parameters for calling the `scheduleNotification` JSON-RPC method. + * The parameters for calling the `scheduleNotificationWithDate` JSON-RPC method. * * @property date - The ISO 8601 date of when the notification should be scheduled. */ -export type ScheduleNotificationParams = { +export type ScheduleNotificationParamsWithDate = { date: string; }; +/** + * The parameters for calling the `scheduleNotificationWithDuration` JSON-RPC method. + * + * @property duration - The ISO 8601 duration of when the notification should be scheduled. + */ +export type ScheduleNotificationParamsWithDuration = { + duration: string; +}; + /** * The parameters for calling the `cancelNotification` JSON-RPC method. * diff --git a/packages/examples/packages/dialogs/snap.manifest.json b/packages/examples/packages/dialogs/snap.manifest.json index 9ba7d3c293..3a342c3da1 100644 --- a/packages/examples/packages/dialogs/snap.manifest.json +++ b/packages/examples/packages/dialogs/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "6IGgmJV+Gc1jdmr4M+Gc0SHBfu2Ieuq3QFCIa5t7vYY=", + "shasum": "b/d4wvQNBpg1SFV4moeS0/J2wr+fIa4j9yHJtS1rAgs=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/ethereum-provider/snap.manifest.json b/packages/examples/packages/ethereum-provider/snap.manifest.json index 7424847493..3e41dcf8da 100644 --- a/packages/examples/packages/ethereum-provider/snap.manifest.json +++ b/packages/examples/packages/ethereum-provider/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "1QLc9RhVgpwxBu8FjPo5kZY61mpNoNAfkiAatq99Nc4=", + "shasum": "XalYVJppi0F1jj/Bsb+vcxFJnXNSXmYVDDFksjUbtlQ=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/ethers-js/snap.manifest.json b/packages/examples/packages/ethers-js/snap.manifest.json index ad366d1e4e..71a9545220 100644 --- a/packages/examples/packages/ethers-js/snap.manifest.json +++ b/packages/examples/packages/ethers-js/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "U4iQEpD4FcKBClMoFgESj8aVZy/io4bR3T3xC8D1J/c=", + "shasum": "MhoKeOSIHCiRkPw8y9I9qT2y4kJPkyF6pQnWcjiGMFc=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/file-upload/snap.manifest.json b/packages/examples/packages/file-upload/snap.manifest.json index d9960ea0d7..cf130dfdd3 100644 --- a/packages/examples/packages/file-upload/snap.manifest.json +++ b/packages/examples/packages/file-upload/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "U5/rIXgTqaoXVudqfJyK1cglKFXyLKKal+hj4mk+i0g=", + "shasum": "Z7FH9MPjp8UnfSOppsONs9RRy8WODxWlJaVYpjsQljo=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/get-entropy/snap.manifest.json b/packages/examples/packages/get-entropy/snap.manifest.json index 177ef7b231..36610a70c6 100644 --- a/packages/examples/packages/get-entropy/snap.manifest.json +++ b/packages/examples/packages/get-entropy/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "vFbFG/f0wOk+xcAypUssW9LJST38Ul9Oq4fZRaHq50E=", + "shasum": "S7AUuVRrm0gfmrSvMKUw3kSYRn32L01jnoe7BfWe5sk=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/get-file/snap.manifest.json b/packages/examples/packages/get-file/snap.manifest.json index 57183b0dcd..bd4005868a 100644 --- a/packages/examples/packages/get-file/snap.manifest.json +++ b/packages/examples/packages/get-file/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "IkhZaFe3JhsDGcjO+/2CettMLck0yQUby8I13U2BUpU=", + "shasum": "gmw15KG0gq0X558gXzsTsW4VaCEHZ6sTPFNDZBQkOuE=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/images/snap.manifest.json b/packages/examples/packages/images/snap.manifest.json index 0ac660a010..159c29a80f 100644 --- a/packages/examples/packages/images/snap.manifest.json +++ b/packages/examples/packages/images/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "qDnkVe1UEihxCX8jKtc5kU6Xsz2mszjC9abLo9gxyqQ=", + "shasum": "0Jazk7R5pgHAr/Bkjtyou9hKbU6on830QoPd/xUNTjE=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/interactive-ui/snap.manifest.json b/packages/examples/packages/interactive-ui/snap.manifest.json index 96a8738c8a..345e7fdd98 100644 --- a/packages/examples/packages/interactive-ui/snap.manifest.json +++ b/packages/examples/packages/interactive-ui/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "7hLctw66Qa64WB7Y1kdJnqQFIkPt5hYvdNj9l/00E78=", + "shasum": "s6tsVBfN4/TtsT7JbS1UmEWVPB7PI8NQIypShnd/QtQ=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/invoke-snap/packages/consumer-signer/snap.manifest.json b/packages/examples/packages/invoke-snap/packages/consumer-signer/snap.manifest.json index 5b9b23bf40..639a9349d2 100644 --- a/packages/examples/packages/invoke-snap/packages/consumer-signer/snap.manifest.json +++ b/packages/examples/packages/invoke-snap/packages/consumer-signer/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "G6qDbbY6gfcNXbwavYeLOcX5dZRXGrzR4OVtIMWizwg=", + "shasum": "O/2zzk/KOs7TsWahCpCrvEFchWxZOoBJD/z15XIcwZ0=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/invoke-snap/packages/core-signer/snap.manifest.json b/packages/examples/packages/invoke-snap/packages/core-signer/snap.manifest.json index 66e2bc1f8f..f7dd86b0cb 100644 --- a/packages/examples/packages/invoke-snap/packages/core-signer/snap.manifest.json +++ b/packages/examples/packages/invoke-snap/packages/core-signer/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "UMY4+tvOkzhxFhBE7v1hIpSANISaTCM6BcjwniuxKUc=", + "shasum": "Lvc41Dl6s6WrUAFPzW+1zXPetJHl/VdjcbZUWz3a8yw=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/json-rpc/snap.manifest.json b/packages/examples/packages/json-rpc/snap.manifest.json index 8b326402b7..2ad2b3bfee 100644 --- a/packages/examples/packages/json-rpc/snap.manifest.json +++ b/packages/examples/packages/json-rpc/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "4i/96yKvEMlwjGd6BvcuYwwGtol1YZEZTZ2dOcGOtxs=", + "shasum": "iU677cU5HW7d/k/j7RpkHvICgZTQlxCEc/J9BSkJ/x4=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/localization/snap.manifest.json b/packages/examples/packages/localization/snap.manifest.json index a1a192a81e..1578925e30 100644 --- a/packages/examples/packages/localization/snap.manifest.json +++ b/packages/examples/packages/localization/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "hE4IbH9CWs7QS8JnUWsReyG3TuZG9Z00/K2kCRsfID4=", + "shasum": "7rEm1NXOLRCnNpu7/C9YPb6W6vAi66y/VURliUF/0ek=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/manage-state/snap.manifest.json b/packages/examples/packages/manage-state/snap.manifest.json index 3bbbef315c..81701d6a99 100644 --- a/packages/examples/packages/manage-state/snap.manifest.json +++ b/packages/examples/packages/manage-state/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "9n3dGpYT/s9CwkwfGTkOgMA8jvrkLg9KVP2Y/KsrWkg=", + "shasum": "pO3d88b+ICS9lzGljWC2fI55J+3sOTqEQ6E4KfsSftQ=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/network-access/snap.manifest.json b/packages/examples/packages/network-access/snap.manifest.json index 603e3373ca..564c0e84bd 100644 --- a/packages/examples/packages/network-access/snap.manifest.json +++ b/packages/examples/packages/network-access/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "FLqA/O/vfM7Cbv07OMjLbf5wnJ6xiDVOicRc62DN6Dw=", + "shasum": "MtSGuVR6dxqOOlibd2vC6TWdgi5uh0hOjzVEFOcs/18=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/notifications/snap.manifest.json b/packages/examples/packages/notifications/snap.manifest.json index 6af0136d2a..3d6a7e2617 100644 --- a/packages/examples/packages/notifications/snap.manifest.json +++ b/packages/examples/packages/notifications/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "vgZf2fdTM9fTAFroi78267SHtaEeTJLTNa/hobO22s0=", + "shasum": "UqWI0OlG+BjAKDDtNXzx7IAUyTi25mKTgC19dBOz0ZU=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/preinstalled/snap.manifest.json b/packages/examples/packages/preinstalled/snap.manifest.json index 49760fc93a..77f04f28d3 100644 --- a/packages/examples/packages/preinstalled/snap.manifest.json +++ b/packages/examples/packages/preinstalled/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "i8jxIqiwe7OvwEP32oFIFKUu3EfnHnbFbyRXeqIKPiY=", + "shasum": "8LNrrjcUnqrNG4/+lFQJ17BXbVp0R9trWL1TcIa9hXE=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/rollup-plugin/snap.manifest.json b/packages/examples/packages/rollup-plugin/snap.manifest.json index b12a46527a..d418d5950e 100644 --- a/packages/examples/packages/rollup-plugin/snap.manifest.json +++ b/packages/examples/packages/rollup-plugin/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "9kEcCvm7AAgm49TqYDjUdiqLlnNqjfXipUgtI2ndBwQ=", + "shasum": "z2muYIw+KbJS1DymfW/DLtE59zV01n6EvQT9WQIogdI=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/wasm/snap.manifest.json b/packages/examples/packages/wasm/snap.manifest.json index 54f20a4082..492a5b308f 100644 --- a/packages/examples/packages/wasm/snap.manifest.json +++ b/packages/examples/packages/wasm/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "ZLNLyIw7vPg+geDBqmngSU6+92UjZPhG6on34Ij3+Nc=", + "shasum": "bXYFmE2ORLhf/s+DDVK9C8kA0Tbo9dOTtdZSF1u1vQQ=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/webpack-plugin/snap.manifest.json b/packages/examples/packages/webpack-plugin/snap.manifest.json index d990776378..b1b1f3bd47 100644 --- a/packages/examples/packages/webpack-plugin/snap.manifest.json +++ b/packages/examples/packages/webpack-plugin/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "l5ZrPChhTClz9FfuqCVCk95v7zwDzchZpWmHs/4Iji0=", + "shasum": "P3KkTe1VsmixCjeOIcxnqkQGN2WmqAe69e6Oy1IFqhc=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/test-snaps/src/features/snaps/cronjobs/components/ScheduleBackgroundEvent.tsx b/packages/test-snaps/src/features/snaps/cronjobs/components/ScheduleBackgroundEvent.tsx index 8eb11d7c81..8e34bbcb18 100644 --- a/packages/test-snaps/src/features/snaps/cronjobs/components/ScheduleBackgroundEvent.tsx +++ b/packages/test-snaps/src/features/snaps/cronjobs/components/ScheduleBackgroundEvent.tsx @@ -10,40 +10,82 @@ import { CRONJOBS_SNAP_PORT, CRONJOBS_SNAP_ID } from '../constants'; export const ScheduleBackgroundEvent: FunctionComponent = () => { const [date, setDate] = useState(''); + const [duration, setDuration] = useState(''); const [invokeSnap, { isLoading, data, error }] = useInvokeMutation(); - const handleChange = (event: ChangeEvent) => { + const handleDateChange = (event: ChangeEvent) => { setDate(event.target.value); }; - const handleSubmit = (event: FormEvent) => { + const handleDurationChange = (event: ChangeEvent) => { + setDuration(event.target.value); + }; + + const handleSubmitWithDate = (event: FormEvent) => { event.preventDefault(); invokeSnap({ snapId: getSnapId(CRONJOBS_SNAP_ID, CRONJOBS_SNAP_PORT), - method: 'scheduleNotification', + method: 'scheduleNotificationWithDate', params: { date, }, }).catch(logError); }; + const handleSubmitWithDuration = (event: FormEvent) => { + event.preventDefault(); + invokeSnap({ + snapId: getSnapId(CRONJOBS_SNAP_ID, CRONJOBS_SNAP_PORT), + method: 'scheduleNotificationWithDuration', + params: { + duration, + }, + }).catch(logError); + }; + return ( <> -
+ - Date (must be in IS8601 format) + Date (must be in ISO 8601 format) - +
+ +
+ + Duration (must be in ISO 8601 format) + + + +
From e2cc8469fef3c15b85e69cf9212e7c1670e410c5 Mon Sep 17 00:00:00 2001 From: Hassan Malik Date: Tue, 14 Jan 2025 11:34:57 -0500 Subject: [PATCH 2/3] rebuild --- packages/examples/packages/bip32/snap.manifest.json | 2 +- packages/examples/packages/bip44/snap.manifest.json | 2 +- packages/examples/packages/browserify-plugin/snap.manifest.json | 2 +- packages/examples/packages/browserify/snap.manifest.json | 2 +- packages/examples/packages/client-status/snap.manifest.json | 2 +- packages/examples/packages/cronjobs/snap.manifest.json | 2 +- packages/examples/packages/dialogs/snap.manifest.json | 2 +- packages/examples/packages/ethereum-provider/snap.manifest.json | 2 +- packages/examples/packages/ethers-js/snap.manifest.json | 2 +- packages/examples/packages/file-upload/snap.manifest.json | 2 +- packages/examples/packages/get-entropy/snap.manifest.json | 2 +- packages/examples/packages/get-file/snap.manifest.json | 2 +- packages/examples/packages/images/snap.manifest.json | 2 +- packages/examples/packages/interactive-ui/snap.manifest.json | 2 +- .../invoke-snap/packages/consumer-signer/snap.manifest.json | 2 +- .../invoke-snap/packages/core-signer/snap.manifest.json | 2 +- packages/examples/packages/json-rpc/snap.manifest.json | 2 +- packages/examples/packages/localization/snap.manifest.json | 2 +- packages/examples/packages/manage-state/snap.manifest.json | 2 +- packages/examples/packages/network-access/snap.manifest.json | 2 +- packages/examples/packages/notifications/snap.manifest.json | 2 +- packages/examples/packages/preinstalled/snap.manifest.json | 2 +- packages/examples/packages/rollup-plugin/snap.manifest.json | 2 +- packages/examples/packages/wasm/snap.manifest.json | 2 +- packages/examples/packages/webpack-plugin/snap.manifest.json | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/packages/examples/packages/bip32/snap.manifest.json b/packages/examples/packages/bip32/snap.manifest.json index 41dd9a95fc..8e4cb79a31 100644 --- a/packages/examples/packages/bip32/snap.manifest.json +++ b/packages/examples/packages/bip32/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "IqWUM7iSg+nrJSYikr/aC3q3bSm6WlTcLQ45OTVkG9A=", + "shasum": "ojW3Hm/UhUzUs35jVfoI9+xEsy0zoVLFzfZGZ3dgZeQ=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/bip44/snap.manifest.json b/packages/examples/packages/bip44/snap.manifest.json index 24a542cf2b..f044129c0e 100644 --- a/packages/examples/packages/bip44/snap.manifest.json +++ b/packages/examples/packages/bip44/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "sOEC09390j3Swk29rbbSUC/xJdXcY+4J+yjWR027D1g=", + "shasum": "kYRZmgdWbCe5U9mK1DBn4r1eh2VFI6TBolStHsYnwqQ=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/browserify-plugin/snap.manifest.json b/packages/examples/packages/browserify-plugin/snap.manifest.json index bb2d6d76c7..9f578fd779 100644 --- a/packages/examples/packages/browserify-plugin/snap.manifest.json +++ b/packages/examples/packages/browserify-plugin/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "0RVNrUD4z1+EaGY+/pYJff0D1QY8ZekIHzlppceGAz4=", + "shasum": "jyM2N8Y8sIxLacv1mwtPh41wGSt9lWsBNbFo9CSx7mM=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/browserify/snap.manifest.json b/packages/examples/packages/browserify/snap.manifest.json index 332a152ef8..0cc9ff36db 100644 --- a/packages/examples/packages/browserify/snap.manifest.json +++ b/packages/examples/packages/browserify/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "Aw+w2Wiy54F9iBymGscjK8GSV9Km3eXEA8l85pt+/10=", + "shasum": "qHCkTRpYoHUFtt9Dd0nxQyw7Eblv0e5znQ39NszlJOo=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/client-status/snap.manifest.json b/packages/examples/packages/client-status/snap.manifest.json index 10f103a55c..e8b471c470 100644 --- a/packages/examples/packages/client-status/snap.manifest.json +++ b/packages/examples/packages/client-status/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "Yfok0ZJsaOLPeYw/d7rr2A+q2YSTnFsH/lyuQkPOy4k=", + "shasum": "arWIxnocunv/5esPgYG068vzZzyBxg/FcbiDILeyLCs=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/cronjobs/snap.manifest.json b/packages/examples/packages/cronjobs/snap.manifest.json index 41c0370fa2..e2d37d178a 100644 --- a/packages/examples/packages/cronjobs/snap.manifest.json +++ b/packages/examples/packages/cronjobs/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "sPjBPTcb0g1o/xhWxWybs0NghAGflXxrv7JB7lRUxOc=", + "shasum": "UAyTtrfMx+qx9gS5oJzs9xHSUWHbftqIc0KbKq4JpQ0=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/dialogs/snap.manifest.json b/packages/examples/packages/dialogs/snap.manifest.json index 3a342c3da1..9ba7d3c293 100644 --- a/packages/examples/packages/dialogs/snap.manifest.json +++ b/packages/examples/packages/dialogs/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "b/d4wvQNBpg1SFV4moeS0/J2wr+fIa4j9yHJtS1rAgs=", + "shasum": "6IGgmJV+Gc1jdmr4M+Gc0SHBfu2Ieuq3QFCIa5t7vYY=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/ethereum-provider/snap.manifest.json b/packages/examples/packages/ethereum-provider/snap.manifest.json index 3e41dcf8da..7424847493 100644 --- a/packages/examples/packages/ethereum-provider/snap.manifest.json +++ b/packages/examples/packages/ethereum-provider/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "XalYVJppi0F1jj/Bsb+vcxFJnXNSXmYVDDFksjUbtlQ=", + "shasum": "1QLc9RhVgpwxBu8FjPo5kZY61mpNoNAfkiAatq99Nc4=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/ethers-js/snap.manifest.json b/packages/examples/packages/ethers-js/snap.manifest.json index 71a9545220..ad366d1e4e 100644 --- a/packages/examples/packages/ethers-js/snap.manifest.json +++ b/packages/examples/packages/ethers-js/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "MhoKeOSIHCiRkPw8y9I9qT2y4kJPkyF6pQnWcjiGMFc=", + "shasum": "U4iQEpD4FcKBClMoFgESj8aVZy/io4bR3T3xC8D1J/c=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/file-upload/snap.manifest.json b/packages/examples/packages/file-upload/snap.manifest.json index cf130dfdd3..d9960ea0d7 100644 --- a/packages/examples/packages/file-upload/snap.manifest.json +++ b/packages/examples/packages/file-upload/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "Z7FH9MPjp8UnfSOppsONs9RRy8WODxWlJaVYpjsQljo=", + "shasum": "U5/rIXgTqaoXVudqfJyK1cglKFXyLKKal+hj4mk+i0g=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/get-entropy/snap.manifest.json b/packages/examples/packages/get-entropy/snap.manifest.json index 36610a70c6..177ef7b231 100644 --- a/packages/examples/packages/get-entropy/snap.manifest.json +++ b/packages/examples/packages/get-entropy/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "S7AUuVRrm0gfmrSvMKUw3kSYRn32L01jnoe7BfWe5sk=", + "shasum": "vFbFG/f0wOk+xcAypUssW9LJST38Ul9Oq4fZRaHq50E=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/get-file/snap.manifest.json b/packages/examples/packages/get-file/snap.manifest.json index bd4005868a..57183b0dcd 100644 --- a/packages/examples/packages/get-file/snap.manifest.json +++ b/packages/examples/packages/get-file/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "gmw15KG0gq0X558gXzsTsW4VaCEHZ6sTPFNDZBQkOuE=", + "shasum": "IkhZaFe3JhsDGcjO+/2CettMLck0yQUby8I13U2BUpU=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/images/snap.manifest.json b/packages/examples/packages/images/snap.manifest.json index 159c29a80f..0ac660a010 100644 --- a/packages/examples/packages/images/snap.manifest.json +++ b/packages/examples/packages/images/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "0Jazk7R5pgHAr/Bkjtyou9hKbU6on830QoPd/xUNTjE=", + "shasum": "qDnkVe1UEihxCX8jKtc5kU6Xsz2mszjC9abLo9gxyqQ=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/interactive-ui/snap.manifest.json b/packages/examples/packages/interactive-ui/snap.manifest.json index 345e7fdd98..96a8738c8a 100644 --- a/packages/examples/packages/interactive-ui/snap.manifest.json +++ b/packages/examples/packages/interactive-ui/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "s6tsVBfN4/TtsT7JbS1UmEWVPB7PI8NQIypShnd/QtQ=", + "shasum": "7hLctw66Qa64WB7Y1kdJnqQFIkPt5hYvdNj9l/00E78=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/invoke-snap/packages/consumer-signer/snap.manifest.json b/packages/examples/packages/invoke-snap/packages/consumer-signer/snap.manifest.json index 639a9349d2..5b9b23bf40 100644 --- a/packages/examples/packages/invoke-snap/packages/consumer-signer/snap.manifest.json +++ b/packages/examples/packages/invoke-snap/packages/consumer-signer/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "O/2zzk/KOs7TsWahCpCrvEFchWxZOoBJD/z15XIcwZ0=", + "shasum": "G6qDbbY6gfcNXbwavYeLOcX5dZRXGrzR4OVtIMWizwg=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/invoke-snap/packages/core-signer/snap.manifest.json b/packages/examples/packages/invoke-snap/packages/core-signer/snap.manifest.json index f7dd86b0cb..66e2bc1f8f 100644 --- a/packages/examples/packages/invoke-snap/packages/core-signer/snap.manifest.json +++ b/packages/examples/packages/invoke-snap/packages/core-signer/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "Lvc41Dl6s6WrUAFPzW+1zXPetJHl/VdjcbZUWz3a8yw=", + "shasum": "UMY4+tvOkzhxFhBE7v1hIpSANISaTCM6BcjwniuxKUc=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/json-rpc/snap.manifest.json b/packages/examples/packages/json-rpc/snap.manifest.json index 2ad2b3bfee..8b326402b7 100644 --- a/packages/examples/packages/json-rpc/snap.manifest.json +++ b/packages/examples/packages/json-rpc/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "iU677cU5HW7d/k/j7RpkHvICgZTQlxCEc/J9BSkJ/x4=", + "shasum": "4i/96yKvEMlwjGd6BvcuYwwGtol1YZEZTZ2dOcGOtxs=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/localization/snap.manifest.json b/packages/examples/packages/localization/snap.manifest.json index 1578925e30..a1a192a81e 100644 --- a/packages/examples/packages/localization/snap.manifest.json +++ b/packages/examples/packages/localization/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "7rEm1NXOLRCnNpu7/C9YPb6W6vAi66y/VURliUF/0ek=", + "shasum": "hE4IbH9CWs7QS8JnUWsReyG3TuZG9Z00/K2kCRsfID4=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/manage-state/snap.manifest.json b/packages/examples/packages/manage-state/snap.manifest.json index 81701d6a99..3bbbef315c 100644 --- a/packages/examples/packages/manage-state/snap.manifest.json +++ b/packages/examples/packages/manage-state/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "pO3d88b+ICS9lzGljWC2fI55J+3sOTqEQ6E4KfsSftQ=", + "shasum": "9n3dGpYT/s9CwkwfGTkOgMA8jvrkLg9KVP2Y/KsrWkg=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/network-access/snap.manifest.json b/packages/examples/packages/network-access/snap.manifest.json index 564c0e84bd..603e3373ca 100644 --- a/packages/examples/packages/network-access/snap.manifest.json +++ b/packages/examples/packages/network-access/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "MtSGuVR6dxqOOlibd2vC6TWdgi5uh0hOjzVEFOcs/18=", + "shasum": "FLqA/O/vfM7Cbv07OMjLbf5wnJ6xiDVOicRc62DN6Dw=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/notifications/snap.manifest.json b/packages/examples/packages/notifications/snap.manifest.json index 3d6a7e2617..6af0136d2a 100644 --- a/packages/examples/packages/notifications/snap.manifest.json +++ b/packages/examples/packages/notifications/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "UqWI0OlG+BjAKDDtNXzx7IAUyTi25mKTgC19dBOz0ZU=", + "shasum": "vgZf2fdTM9fTAFroi78267SHtaEeTJLTNa/hobO22s0=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/preinstalled/snap.manifest.json b/packages/examples/packages/preinstalled/snap.manifest.json index 77f04f28d3..49760fc93a 100644 --- a/packages/examples/packages/preinstalled/snap.manifest.json +++ b/packages/examples/packages/preinstalled/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "8LNrrjcUnqrNG4/+lFQJ17BXbVp0R9trWL1TcIa9hXE=", + "shasum": "i8jxIqiwe7OvwEP32oFIFKUu3EfnHnbFbyRXeqIKPiY=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/rollup-plugin/snap.manifest.json b/packages/examples/packages/rollup-plugin/snap.manifest.json index d418d5950e..b12a46527a 100644 --- a/packages/examples/packages/rollup-plugin/snap.manifest.json +++ b/packages/examples/packages/rollup-plugin/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "z2muYIw+KbJS1DymfW/DLtE59zV01n6EvQT9WQIogdI=", + "shasum": "9kEcCvm7AAgm49TqYDjUdiqLlnNqjfXipUgtI2ndBwQ=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/wasm/snap.manifest.json b/packages/examples/packages/wasm/snap.manifest.json index 492a5b308f..54f20a4082 100644 --- a/packages/examples/packages/wasm/snap.manifest.json +++ b/packages/examples/packages/wasm/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "bXYFmE2ORLhf/s+DDVK9C8kA0Tbo9dOTtdZSF1u1vQQ=", + "shasum": "ZLNLyIw7vPg+geDBqmngSU6+92UjZPhG6on34Ij3+Nc=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/webpack-plugin/snap.manifest.json b/packages/examples/packages/webpack-plugin/snap.manifest.json index b1b1f3bd47..d990776378 100644 --- a/packages/examples/packages/webpack-plugin/snap.manifest.json +++ b/packages/examples/packages/webpack-plugin/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "P3KkTe1VsmixCjeOIcxnqkQGN2WmqAe69e6Oy1IFqhc=", + "shasum": "l5ZrPChhTClz9FfuqCVCk95v7zwDzchZpWmHs/4Iji0=", "location": { "npm": { "filePath": "dist/bundle.js", From 63dbffeb03b952bca64ba1776ac8dff0bed77bee Mon Sep 17 00:00:00 2001 From: Hassan Malik Date: Tue, 14 Jan 2025 16:47:43 -0500 Subject: [PATCH 3/3] update per review --- packages/examples/packages/cronjobs/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/examples/packages/cronjobs/src/index.ts b/packages/examples/packages/cronjobs/src/index.ts index 4b77961eb7..1aa24ad4d0 100644 --- a/packages/examples/packages/cronjobs/src/index.ts +++ b/packages/examples/packages/cronjobs/src/index.ts @@ -57,7 +57,7 @@ export const onCronjob: OnCronjobHandler = async ({ request }) => { /** * Handle incoming JSON-RPC requests from the dapp, sent through the - * `wallet_invokeSnap` method. This handler handles three methods: + * `wallet_invokeSnap` method. This handler handles four methods: * * - `scheduleNotificationWithDate`: Schedule a notification in the future with the `date` param. * - `scheduleNotificationWithDuration`: Schedule a notification in the future with the `duration` param.