Skip to main content

wallet_getSnaps

MetaMaskSnaps

Returns the IDs of the dapp's permitted Snaps and some relevant metadata.

Params

(0)

Result

(GetSnapsResult)

An object mapping the IDs of permitted Snaps to their metadata.

id
object
id
string

The ID of the Snap.

initialPermissions
object

The initial permissions of the Snap, which will be requested when the Snap is installed.

version
string

The version of the Snap.

enabled
boolean

Indicates whether the Snap is enabled.

blocked
boolean

Indicates whether the Snap is blocked.

Example

Request

await window.ethereum.request({
"method": "wallet_getSnaps",
"params": []
});

Result

{
"npm:@metamask/example-snap": {
"version": "1.0.0",
"id": "npm:@metamask/example-snap",
"enabled": true,
"blocked": false
}
}

Request

await window.ethereum.request({
"method": "wallet_getSnaps",
"params": []
});