Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Snaps parameters in dapp API section #1380

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 16 additions & 22 deletions snaps/reference/wallet-api-for-snaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,12 @@ An object mapping the IDs of permitted Snaps to their metadata:
```js
await window.ethereum.request({
"method": "wallet_requestSnaps",
"params": [
{
"npm:@metamask/example-snap": {},
"npm:fooSnap": {
"version": "^1.0.2"
}
"params": {
"npm:@metamask/example-snap": {},
"npm:foo-snap": {
"version": "^1.0.2"
}
]
}
});
```

Expand All @@ -129,7 +127,7 @@ await window.ethereum.request({
},
"npm:fooSnap": {
"version": "1.0.5",
"id": "npm:fooSnap",
"id": "npm:foo-snap",
"enabled": true,
"blocked": false
}
Expand Down Expand Up @@ -168,14 +166,12 @@ The result of the Snap method call.
```js
await window.ethereum.request({
"method": "wallet_snap",
"params": [
{
"snapId": "npm:@metamask/example-snap",
"request": {
"method": "hello"
}
"params": {
"snapId": "npm:@metamask/example-snap",
"request": {
"method": "hello"
}
]
}
});
```

Expand Down Expand Up @@ -218,14 +214,12 @@ The result of the Snap method call.
```js
await window.ethereum.request({
"method": "wallet_invokeSnap",
"params": [
{
"snapId": "npm:@metamask/example-snap",
"request": {
"method": "hello"
}
"params": {
"snapId": "npm:@metamask/example-snap",
"request": {
"method": "hello"
}
]
}
});
```

Expand Down