Skip to content

Commit

Permalink
Add Snap error wrappers of JSON-RPC errors (#1924)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrtenz authored Nov 14, 2023
1 parent 1a14e3d commit 27fe061
Show file tree
Hide file tree
Showing 24 changed files with 1,007 additions and 13 deletions.
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": "3PiDzz7GdMsESG/6ZAJqFjn2Li8oaCvw2i3k+IFooXs=",
"shasum": "WhJFBstL9IJJd0Ux7btR1Z8r0XWbj5YishuvEvFMOGg=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
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": "/o2NevZCcocYbJaDzVkOJFDCozfyUDVYhv+EUJoJBGY=",
"shasum": "C29vT/9mP49PTrRtusdJw5smO0ecTzfqLqSp6H8BFss=",
"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": "5QcNsKW2OCV+Oi5jv0adqdorGJlrRXk6b2N8ggNKfJg=",
"shasum": "0ohHC8w3k2q7o2dTOS400GWDJ4wTGzMwxy9Mv+aJWBA=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
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": "gBlp/vQeFAxBYBB+ZtKp544lvphaUGnPdlZT3TcRYtM=",
"shasum": "jBfn7CLEYqgwEpovyhSbbKpqZn4Aset/OH5B8H/xh4c=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
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": "mwQVVwVq4B6u9x7VMmCQ2w2bREK0sWHcK+siAjs7e+c=",
"shasum": "uYIzvvgiBof8L55BT8SxeNvyTxaQTddpSCBdGsnhX9o=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
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": "adrLao09LcOWwhlW+YfcJOdGyHgb4ap2JwhKCl+HWkM=",
"shasum": "yjwzM13BqYnrORG5fMAwPqKg0AkqOw1ORzMW11rQUow=",
"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": "EhHC32ZDU+SWvnUAcm2ibsZdqfwlr4h+mAvmCqyPPK0=",
"shasum": "f/FPnBBrf7xtfCZ6gmGIld+adQWw9HgdyBxBuyExZEU=",
"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": "T1KWaOynwxjLUrArL2JV/bLUqbkdVVq0gDFXekbfISA=",
"shasum": "MlJXaPgiKAf0xp2gTT9QcvmnpTsJaWe/iKxDkxHKzco=",
"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": "UiUa8rv9kqEP4DEs59e7ctxlOmv0fc39HXxU96FAozc=",
"shasum": "We6P7J0mnspgTg2sfUd/waz+7a/H7D8CTVMv/bJHWp8=",
"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": "7BU7O6zjdNfdXzdxaMrMWkBasBATeJdW2gvzaOKn4ik=",
"shasum": "/DLQuCstxX0u9plxLCfLh8zie27BDYPpLmmQPcmeLyE=",
"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": "7B1tbfkFvZZrfCQ6BOE13svMJpUnCAz01rm8ey5N37Y=",
"shasum": "dpTZVsprFi9syfWE77+nZYLY0+VYG4xrD05jBK9o/Mg=",
"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": "Kfj87CBq4qcjYQywETQ4ORayuEjZO+QeQWJ3aQnZgUA=",
"shasum": "agDxMEIAYv6V9aPUqPXk68YwcLRexyb69I1lbaY4HHs=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,19 @@
"external:../snaps-sdk/src/ui/index.ts": true
}
},
"external:../snaps-sdk/src/internals/error-wrappers.ts": {
"packages": {
"external:../snaps-sdk/src/errors.ts": true
}
},
"external:../snaps-sdk/src/internals/errors.ts": {
"packages": {
"@metamask/utils": true
}
},
"external:../snaps-sdk/src/internals/index.ts": {
"packages": {
"external:../snaps-sdk/src/internals/error-wrappers.ts": true,
"external:../snaps-sdk/src/internals/errors.ts": true,
"external:../snaps-sdk/src/internals/helpers.ts": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,19 @@
"external:../snaps-sdk/src/ui/index.ts": true
}
},
"external:../snaps-sdk/src/internals/error-wrappers.ts": {
"packages": {
"external:../snaps-sdk/src/errors.ts": true
}
},
"external:../snaps-sdk/src/internals/errors.ts": {
"packages": {
"@metamask/utils": true
}
},
"external:../snaps-sdk/src/internals/index.ts": {
"packages": {
"external:../snaps-sdk/src/internals/error-wrappers.ts": true,
"external:../snaps-sdk/src/internals/errors.ts": true,
"external:../snaps-sdk/src/internals/helpers.ts": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,19 @@
"external:../snaps-sdk/src/ui/index.ts": true
}
},
"external:../snaps-sdk/src/internals/error-wrappers.ts": {
"packages": {
"external:../snaps-sdk/src/errors.ts": true
}
},
"external:../snaps-sdk/src/internals/errors.ts": {
"packages": {
"@metamask/utils": true
}
},
"external:../snaps-sdk/src/internals/index.ts": {
"packages": {
"external:../snaps-sdk/src/internals/error-wrappers.ts": true,
"external:../snaps-sdk/src/internals/errors.ts": true,
"external:../snaps-sdk/src/internals/helpers.ts": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,19 @@
"external:../snaps-sdk/src/ui/index.ts": true
}
},
"external:../snaps-sdk/src/internals/error-wrappers.ts": {
"packages": {
"external:../snaps-sdk/src/errors.ts": true
}
},
"external:../snaps-sdk/src/internals/errors.ts": {
"packages": {
"@metamask/utils": true
}
},
"external:../snaps-sdk/src/internals/index.ts": {
"packages": {
"external:../snaps-sdk/src/internals/error-wrappers.ts": true,
"external:../snaps-sdk/src/internals/errors.ts": true,
"external:../snaps-sdk/src/internals/helpers.ts": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,19 @@
"external:../snaps-sdk/src/ui/index.ts": true
}
},
"external:../snaps-sdk/src/internals/error-wrappers.ts": {
"packages": {
"external:../snaps-sdk/src/errors.ts": true
}
},
"external:../snaps-sdk/src/internals/errors.ts": {
"packages": {
"@metamask/utils": true
}
},
"external:../snaps-sdk/src/internals/index.ts": {
"packages": {
"external:../snaps-sdk/src/internals/error-wrappers.ts": true,
"external:../snaps-sdk/src/internals/errors.ts": true,
"external:../snaps-sdk/src/internals/helpers.ts": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,19 @@
"external:../snaps-sdk/src/ui/index.ts": true
}
},
"external:../snaps-sdk/src/internals/error-wrappers.ts": {
"packages": {
"external:../snaps-sdk/src/errors.ts": true
}
},
"external:../snaps-sdk/src/internals/errors.ts": {
"packages": {
"@metamask/utils": true
}
},
"external:../snaps-sdk/src/internals/index.ts": {
"packages": {
"external:../snaps-sdk/src/internals/error-wrappers.ts": true,
"external:../snaps-sdk/src/internals/errors.ts": true,
"external:../snaps-sdk/src/internals/helpers.ts": true
}
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"dependencies": {
"@metamask/key-tree": "^9.0.0",
"@metamask/providers": "^13.0.0",
"@metamask/rpc-errors": "^6.1.0",
"@metamask/utils": "^8.1.0",
"is-svg": "^4.4.0",
"superstruct": "^1.0.3"
Expand All @@ -48,7 +49,6 @@
"@metamask/eslint-config-jest": "^12.1.0",
"@metamask/eslint-config-nodejs": "^12.1.0",
"@metamask/eslint-config-typescript": "^12.1.0",
"@metamask/rpc-errors": "^6.1.0",
"@swc/cli": "^0.1.62",
"@swc/core": "1.3.78",
"@swc/jest": "^0.2.26",
Expand Down
Loading

0 comments on commit 27fe061

Please sign in to comment.