Skip to content

Commit

Permalink
Merge branch 'main' into feat-remove-rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
TrofimovAnton85 authored Oct 22, 2024
2 parents 6b60b54 + 0fb5f67 commit 968d975
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"extends": "stylelint-config-standard",
"rules": {
"selector-class-pattern": null
"selector-class-pattern": null,
"selector-pseudo-class-no-unknown": [true, {
"ignorePseudoClasses": ["global"]
}]
}
}
11 changes: 6 additions & 5 deletions snaps/features/custom-name-resolution.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The following example implements a very basic resolution from Unstoppable Domain
Ethereum addresses in `onNameLookup`:

```typescript title="index.ts"
import type { OnNameLookupHandler } from "@metamask/snaps-types"
import type { OnNameLookupHandler } from "@metamask/snaps-sdk"

const UNSTOPPABLE_API_KEY = "xxx"

Expand All @@ -64,7 +64,7 @@ export const onNameLookup: OnNameLookupHandler = async (request) => {
)
const data = await response.json()
const resolvedAddress = data.records["crypto.ETH.address"]
if (address) {
if (resolvedAddress) {
return {
resolvedAddresses: [
{ resolvedAddress, protocol: "Unstoppable Domains", domainName: domain },
Expand All @@ -78,9 +78,10 @@ export const onNameLookup: OnNameLookupHandler = async (request) => {
```

:::note
The response from the `onNameLookup` handler includes a `domainName` property. This can
be used to do fuzzy matching on domain names, by returning the domain that was resolved rather than
the one that was passed in.

The `onNameLookup` handler response includes a `domainName` property.
You can use this property to perform fuzzy matching on domain names, by having the handler return the resolved domain rather than the one provided in the request.

:::

## Example
Expand Down
4 changes: 2 additions & 2 deletions src/theme/DocSidebarItem/index.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.flaskOnly > a.menu__link::after,
.flaskOnly > .menu__list-item-collapsible > a.menu__link::after {
.flaskOnly :global(a.menu__link::after),
.flaskOnly :global(.menu__list-item-collapsible a.menu__link::after) {
content: "Flask";
margin-left: 0.5em;
background-color: var(--mm-flask-background-color);
Expand Down
4 changes: 2 additions & 2 deletions wallet/connect/wallet-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ You can clone the repository and run the example locally using `npm i && npm run

After connecting to MetaMask directly, you can:

- [Detect, add, and switch networks](../how-to/manage-networks).
- [Detect, add, and switch networks](/wallet/how-to/manage-networks).
- [Send transactions](../how-to/send-transactions.md).
- [Sign data](../how-to/sign-data/index.md).
- [Display tokens, contract methods, and icons in MetaMask](../how-to/display).
- [Display tokens, contract methods, and icons in MetaMask](/wallet/how-to/display).

0 comments on commit 968d975

Please sign in to comment.