From f1f1d32ccdf2df21d803f24b8b1dfe7d09fd95a2 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Mon, 16 Oct 2023 11:05:18 +0200 Subject: [PATCH] Fix types and example snaps --- packages/examples/packages/bip32/snap.manifest.json | 2 +- packages/examples/packages/bip44/snap.manifest.json | 2 +- packages/examples/packages/dialogs/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/get-file/src/index.ts | 2 +- packages/examples/packages/get-locale/snap.manifest.json | 2 +- .../invoke-snap/packages/core-signer/snap.manifest.json | 2 +- packages/examples/packages/manage-state/snap.manifest.json | 2 +- packages/examples/packages/notifications/snap.manifest.json | 2 +- packages/rpc-methods/src/permitted/getFile.ts | 4 ++-- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/examples/packages/bip32/snap.manifest.json b/packages/examples/packages/bip32/snap.manifest.json index 47eba1e361..cdfbaeb340 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": "0MNF0tdM0XhgOK7bsA8JrDijeAQsb27l0AO6W0SG/gg=", + "shasum": "EdwnuHKiqsIz4f+l6nKY0wZaq8bni4a5YEs4p6375/c=", "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 adc6a69d17..73cd07518a 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": "mhiMYbYYXElNE36MQdgYI1hMsDAHENuOpCSvHLUrZmc=", + "shasum": "MVUJZIRIG1QLd6ZhFftNn5pFGTzvnd2D39K9UABBfhU=", "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 360a21e08f..82dc6717de 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": "FHU65YO8VkgoYoipofh4L8KO7t65j6Ff2XX4NcpCNzM=", + "shasum": "co2jtMEwsAvgoeQJjq51RbqWbFramRLf/eVToZvetEo=", "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 ab61aa9bd5..65bbcac0cd 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": "fpU8kfh2ldR4f2JLrS3fDFAq0EcpNntfagR7/1sm3PI=", + "shasum": "7t1AQR2GJYVsKreUSkmEDUx2xHZNHkyHZ6IKexPyhWA=", "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 5ac5ffa2ed..1acfe9acf4 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": "vHm3dYe/dASo+g4bVCv6zusOtu21K3C3Cocdh4V10/o=", + "shasum": "bnQfXShMxpKS2CIvqeRUuU4Par5ZwlmB+miXZ95jNLY=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/get-file/src/index.ts b/packages/examples/packages/get-file/src/index.ts index 74d19e30ef..885763df85 100644 --- a/packages/examples/packages/get-file/src/index.ts +++ b/packages/examples/packages/get-file/src/index.ts @@ -21,7 +21,7 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ request }) => { case 'getFile': { const fileInHexadecimal = await snap.request({ method: 'snap_getFile', - params: { path: './src/foo.json' }, + params: { path: './src/foo.json', encoding: 'hex' }, }); const bytes = hexToBytes(fileInHexadecimal); return JSON.parse(bytesToString(bytes)); diff --git a/packages/examples/packages/get-locale/snap.manifest.json b/packages/examples/packages/get-locale/snap.manifest.json index bc7f9268b2..50bbfbe5a9 100644 --- a/packages/examples/packages/get-locale/snap.manifest.json +++ b/packages/examples/packages/get-locale/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "+sFQRQvyN15I75BG+Xmh1arqcBB4u+d+kloY4NNyT4o=", + "shasum": "jKYiuKBqNaeeWsUi/TQp6OBh6UveiWiBb3NrL78L4V8=", "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 d67ffe0d26..3dceeb036b 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": "QSfR0IK/aod5Y8y7oJRZfA3iyX/VYnjY8Gy5tw8Hmy0=", + "shasum": "dDhGT/5cpuAv+fsSIinTSg0vo+r1l4Xb4WfypWEjyyM=", "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 7374ca5ef3..04d2df7bf4 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": "5AhJf+D5cchFzTQjuBChEwM/XL5ekkVqgEqF5epFM3s=", + "shasum": "TO6zLIG+k6OIa6iJ951A0R4kmQ28kT4A67Jaa87ElLY=", "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 f263b2a1e3..1a3742e808 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": "WMW0HotuQnSikUIvxcsAaqq+nvOm6utIX+EKIdxUN+A=", + "shasum": "1Hf1QF/WH3S6kjX7B0VDO0D8sj8WqcfvsK7NoeNrrFc=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/rpc-methods/src/permitted/getFile.ts b/packages/rpc-methods/src/permitted/getFile.ts index 73064b2bd4..3714da3136 100644 --- a/packages/rpc-methods/src/permitted/getFile.ts +++ b/packages/rpc-methods/src/permitted/getFile.ts @@ -30,7 +30,7 @@ const hookNames: MethodHooksObject = { export const getFileHandler: PermittedHandlerExport< GetFileHooks, - JsonRpcRequest, + GetFileArgs, string > = { methodNames: ['snap_getFile'], @@ -58,7 +58,7 @@ export type GetFileHooks = { * @returns Nothing. */ async function implementation( - req: JsonRpcRequest, + req: JsonRpcRequest, res: PendingJsonRpcResponse, _next: unknown, end: JsonRpcEngineEndCallback,