Skip to content

Commit

Permalink
Fix Snaps parameters in dapp API section (MetaMask#1380)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikBolding authored Jul 3, 2024
1 parent 545062f commit 94ad9a2
Showing 1 changed file with 16 additions and 22 deletions.
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

0 comments on commit 94ad9a2

Please sign in to comment.