Skip to content

Commit

Permalink
Update documentation on name resolution matchers
Browse files Browse the repository at this point in the history
  • Loading branch information
ziad-saab committed Sep 9, 2024
1 parent 8b45b73 commit 67d5a05
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 12 additions & 0 deletions snaps/features/custom-name-resolution.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ For example, to resolve Ethereum Mainnet domains, add the following to your Snap
}
```

If you're only targetting specific TLDs or schemes, you can use the `matchers` property to reduce
overhead by specifying the TLDs and schemes you support. For example:

```json title="snap.manifest.json"
"initialPermissions": {
"endowment:name-lookup": {
"chains": ["eip155:1"],
"matchers": { "tlds": ["crypto"] }
}
}
```

### 2. Implement custom name resolution

Expose an [`onNameLookup`](../reference/entry-points.md#onnamelookup) entry point, which receives a
Expand Down
3 changes: 0 additions & 3 deletions snaps/reference/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ Specify this permission in the manifest file as follows:

### `endowment:name-lookup`

:::flaskOnly
:::

To provide [custom name resolution](../features/custom-name-resolution.md), a Snap must request the
`endowment:name-lookup` permission.
This permission grants the Snap read-only access to user input or an address by exporting the
Expand Down

0 comments on commit 67d5a05

Please sign in to comment.