Skip to content

Commit

Permalink
Bump @metamask/permission-controller, @metamask/json-rpc-engine, and …
Browse files Browse the repository at this point in the history
…resolve type issues
  • Loading branch information
Mrtenz committed Nov 15, 2023
1 parent d62df31 commit b3f294c
Show file tree
Hide file tree
Showing 41 changed files with 100 additions and 113 deletions.
2 changes: 1 addition & 1 deletion packages/examples/packages/bip32/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@metamask/key-tree": "^9.0.0",
"@metamask/rpc-errors": "^6.1.0",
"@metamask/snaps-sdk": "workspace:^",
"@metamask/utils": "^8.1.0",
"@metamask/utils": "^8.2.1",
"@noble/ed25519": "^1.6.0",
"@noble/secp256k1": "^1.7.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/bip32/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "WhJFBstL9IJJd0Ux7btR1Z8r0XWbj5YishuvEvFMOGg=",
"shasum": "c3u/Z2xy1ChWDv4R+OHTAVLeSoT/K/yv9E+q2GAsric=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/bip44/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@metamask/key-tree": "^9.0.0",
"@metamask/rpc-errors": "^6.1.0",
"@metamask/snaps-sdk": "workspace:^",
"@metamask/utils": "^8.1.0",
"@metamask/utils": "^8.2.1",
"@noble/bls12-381": "^1.2.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/bip44/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "C29vT/9mP49PTrRtusdJw5smO0ecTzfqLqSp6H8BFss=",
"shasum": "odIxViYr4MKCR186MZNWbIHBROIRxFDuIGm9BgC0g1E=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "i+9LL7V79dw3wBOggmY9Y7THI/+rBZ/zPPnkABKgj4o=",
"shasum": "zSRV7ANPdAasmu7vz1kK4qVgvkr0A9avdnbl2YOmEt0=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/browserify/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "M1Vsw951ghBzNDpmEXAkM6w4h7nvdrAVFmSWTwY6o0w=",
"shasum": "eWo1790cKa+CBbwuxJEZV9uif9o8YMNbgIBL/MOAEFs=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/cronjobs/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "0ohHC8w3k2q7o2dTOS400GWDJ4wTGzMwxy9Mv+aJWBA=",
"shasum": "N4HEF5jf+USMjSvrxCYsRJBk9/tEk60CEV44F+RJwUk=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/dialogs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@metamask/eslint-config-typescript": "^12.1.0",
"@metamask/snaps-cli": "workspace:^",
"@metamask/snaps-jest": "workspace:^",
"@metamask/utils": "^8.1.0",
"@metamask/utils": "^8.2.1",
"@swc/core": "1.3.78",
"@swc/jest": "^0.2.26",
"@typescript-eslint/eslint-plugin": "^5.42.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/dialogs/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "jBfn7CLEYqgwEpovyhSbbKpqZn4Aset/OH5B8H/xh4c=",
"shasum": "2MlMpD+BND5lUkK5tSuCAODaVSpmMoWDgI6a9+h/1ZI=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/ethereum-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@metamask/rpc-errors": "^6.1.0",
"@metamask/snaps-sdk": "workspace:^",
"@metamask/utils": "^8.1.0"
"@metamask/utils": "^8.2.1"
},
"devDependencies": {
"@jest/globals": "^29.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "h2kl7pefimDcWYtzO1uJypryY/R1DMY1r8srOcf7vEo=",
"shasum": "JamXkbyRI0N4mxwl+4Jh8gClxAaV0vuN+itg6GUe9kY=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/ethers-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@metamask/eslint-config-typescript": "^12.1.0",
"@metamask/snaps-cli": "workspace:^",
"@metamask/snaps-jest": "workspace:^",
"@metamask/utils": "^8.1.0",
"@metamask/utils": "^8.2.1",
"@swc/core": "1.3.78",
"@swc/jest": "^0.2.26",
"@typescript-eslint/eslint-plugin": "^5.42.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/ethers-js/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "uYIzvvgiBof8L55BT8SxeNvyTxaQTddpSCBdGsnhX9o=",
"shasum": "67kh8YEtQfNVOHu3kd9n+qXpF9ZVdpnx0STiujWMpIE=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/get-entropy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@metamask/rpc-errors": "^6.1.0",
"@metamask/snaps-sdk": "workspace:^",
"@metamask/utils": "^8.1.0",
"@metamask/utils": "^8.2.1",
"@noble/bls12-381": "^1.2.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/get-entropy/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "yjwzM13BqYnrORG5fMAwPqKg0AkqOw1ORzMW11rQUow=",
"shasum": "W/NHJ/KLYc9HpHVmqdvR5uUFMvn6GtfdN60kA2297xo=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/get-file/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "0LYVuy8axHCCii9kBjsl6e0o/NNGe3d2hFysfOJzDYc=",
"shasum": "oWWVuhP57M7eMdQDjQjWCMbqrFSasG2mLRujokA/t7A=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/home-page/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "f/FPnBBrf7xtfCZ6gmGIld+adQWw9HgdyBxBuyExZEU=",
"shasum": "QkxvGv1BjV0FiuIERffTlLiMO6dAyMRJXeBL913oHHM=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@metamask/key-tree": "^9.0.0",
"@metamask/rpc-errors": "^6.1.0",
"@metamask/snaps-sdk": "workspace:^",
"@metamask/utils": "^8.1.0",
"@metamask/utils": "^8.2.1",
"@noble/hashes": "^1.3.1"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "LZufdDPSA1HuHRurCd990EdjT+WJuvfhZD83wu2aReo=",
"shasum": "o2/58wR76g4dkM2I+hoM+U/NCXku9TNBkeKyWWNATF0=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@metamask/key-tree": "^9.0.0",
"@metamask/rpc-errors": "^6.1.0",
"@metamask/snaps-sdk": "workspace:^",
"@metamask/utils": "^8.1.0",
"@metamask/utils": "^8.2.1",
"@noble/curves": "^1.1.0",
"async-mutex": "^0.4.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "MlJXaPgiKAf0xp2gTT9QcvmnpTsJaWe/iKxDkxHKzco=",
"shasum": "DMRI1Ol2xCVZGTnotA3rDkMOY8xtrSC3aXzGBdcdknQ=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/json-rpc/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "Jy7ti30LfK+D/PnqwMP0gfSv4wl90uD/7uw4CjwqdzQ=",
"shasum": "7IPnXEhnhheYHC3CiD0l4mxPM5NGkQ7sFlDQ3PqCFNg=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "We6P7J0mnspgTg2sfUd/waz+7a/H7D8CTVMv/bJHWp8=",
"shasum": "CawaMvDVaOdsD/Ok0HCRaSzK0HCZx2OZ+zxXap+0GiM=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/localization/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "CZ9MGbtCRoCDFdTnXUqvCTQ8EDyLIShPZx+1McdEmRc=",
"shasum": "BIGk91bhL/TBvXKHZOIsaSMb6RUFrkbidlAdFOQRChk=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/manage-state/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "/DLQuCstxX0u9plxLCfLh8zie27BDYPpLmmQPcmeLyE=",
"shasum": "lliQFLB2uFZTWoJ1oU9/HYPWQHqQXlphski2+r4gg84=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/network-access/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@metamask/rpc-errors": "^6.1.0",
"@metamask/snaps-sdk": "workspace:^",
"@metamask/utils": "^8.1.0"
"@metamask/utils": "^8.2.1"
},
"devDependencies": {
"@jest/globals": "^29.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "oplXlD/xpRmd5pI+oICXVnJFO6W2F2GfQ+5jrjN+1vQ=",
"shasum": "xFIJoHi+TEN35mtXOYHJ29sECnSt8a7wIUWsUBd+AbM=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "dpTZVsprFi9syfWE77+nZYLY0+VYG4xrD05jBK9o/Mg=",
"shasum": "AJvmSmfd184z7yFXizADKAl2u6uFewRlZNp64YCm7I0=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "pz2anh4qgBRGblX95JRXkklGAAfMPFAy+skx0n0ZUFU=",
"shasum": "5WLPlvIQOejXtGA3NBR41AsyVYj1zjAD6N2NJFJY5ek=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"dependencies": {
"@metamask/snaps-sdk": "workspace:^",
"@metamask/utils": "^8.1.0"
"@metamask/utils": "^8.2.1"
},
"devDependencies": {
"@jest/globals": "^29.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "agDxMEIAYv6V9aPUqPXk68YwcLRexyb69I1lbaY4HHs=",
"shasum": "yGCIViDXf/YsS9eI9R46xg4GhMwqf9212A88uxsA4MY=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/wasm/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "AMnwjxTjpz1sEo8xl3fzvambLqqcnTibH2X2gYqlUao=",
"shasum": "Ur4GT3eiORpx5oBr1uXjEwpuuq6nKRM/l6i3grQngWY=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "zMHd1+9t3nvir16x/DxaeuA+18tZiBkRX9Y2TLJoTks=",
"shasum": "DaZwfsFRkjore7b7QqWWWxDaGo2IV4GzHqoUjHZ6m6Q=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/snaps-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
"dependencies": {
"@metamask/approval-controller": "^4.1.0",
"@metamask/base-controller": "^3.2.0",
"@metamask/json-rpc-engine": "^7.1.1",
"@metamask/json-rpc-engine": "^7.3.0",
"@metamask/object-multiplex": "^1.2.0",
"@metamask/permission-controller": "^5.0.0",
"@metamask/permission-controller": "^5.0.1",
"@metamask/phishing-controller": "^7.0.0",
"@metamask/post-message-stream": "^7.0.0",
"@metamask/rpc-errors": "^6.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-execution-environments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"lint:dependencies": "depcheck"
},
"dependencies": {
"@metamask/json-rpc-engine": "^7.1.1",
"@metamask/json-rpc-engine": "^7.3.0",
"@metamask/object-multiplex": "^1.2.0",
"@metamask/post-message-stream": "^7.0.0",
"@metamask/providers": "^13.0.0",
Expand Down
26 changes: 12 additions & 14 deletions packages/snaps-execution-environments/src/common/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Json, JsonRpcSuccess } from '@metamask/utils';
import {
assertStruct,
JsonRpcIdStruct,
JsonRpcRequestStruct,
JsonRpcParamsStruct,
JsonRpcSuccessStruct,
JsonRpcVersionStruct,
JsonStruct,
} from '@metamask/utils';
import type { Infer } from 'superstruct';
Expand All @@ -17,20 +18,18 @@ import {
literal,
nullable,
object,
omit,
optional,
record,
string,
tuple,
union,
} from 'superstruct';

export const JsonRpcRequestWithoutIdStruct = assign(
omit(JsonRpcRequestStruct, ['id']),
object({
id: optional(JsonRpcIdStruct),
}),
);
export const JsonRpcRequestWithoutIdStruct = object({
jsonrpc: optional(JsonRpcVersionStruct),
method: string(),
params: optional(JsonRpcParamsStruct),
});

export type JsonRpcRequestWithoutId = Infer<
typeof JsonRpcRequestWithoutIdStruct
Expand Down Expand Up @@ -180,12 +179,11 @@ export function assertIsOnNameLookupRequestArguments(
);
}

const OkResponseStruct = assign(
JsonRpcSuccessStruct,
object({
result: OkStruct,
}),
);
const OkResponseStruct = object({
id: JsonRpcIdStruct,
jsonrpc: JsonRpcVersionStruct,
result: OkStruct,
});

const SnapRpcResponse = JsonRpcSuccessStruct;

Expand Down
4 changes: 2 additions & 2 deletions packages/snaps-rpc-methods/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"dependencies": {
"@metamask/key-tree": "^9.0.0",
"@metamask/permission-controller": "^5.0.0",
"@metamask/permission-controller": "^5.0.1",
"@metamask/rpc-errors": "^6.1.0",
"@metamask/snaps-sdk": "workspace:^",
"@metamask/snaps-utils": "workspace:^",
Expand All @@ -53,7 +53,7 @@
"@metamask/eslint-config-jest": "^12.1.0",
"@metamask/eslint-config-nodejs": "^12.1.0",
"@metamask/eslint-config-typescript": "^12.1.0",
"@metamask/json-rpc-engine": "^7.1.1",
"@metamask/json-rpc-engine": "^7.3.0",
"@swc/cli": "^0.1.62",
"@swc/core": "1.3.78",
"@swc/jest": "^0.2.26",
Expand Down
Loading

0 comments on commit b3f294c

Please sign in to comment.