Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
docs: remove admonitions from documentation (#185)
Browse files Browse the repository at this point in the history
* docs: don't use broken admonitions

GitHub's admonitions currently don't support relative links nor mobile.

* chore: rename `evm-methods.md` file
  • Loading branch information
danroc authored Nov 9, 2023
1 parent a735faf commit 939ff49
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ npm install @metamask/keyring-api

## Account Snaps

> **:point_up: Important**: Before implementing your Snap, please make sure to
> :point_up: **Important**: Before implementing your Snap, please make sure to
> read the [security recommendations](./docs/security.md) and the [architecture
> document](./docs/architecture.md).
Starting with MetaMask 11.4, Snaps can implement the Keyring API. This allows
users to manage their accounts in a more flexible way, and enables developers
to build new types of accounts.

> **:pencil: Note:** You can also build MetaMask from [source][extension-repo]
> :pencil2: **Note:** You can also build MetaMask from [source][extension-repo]
> from the `develop` branch.
Follow these steps to implement the Keyring API in your Snap. Please note that
Expand All @@ -62,14 +62,14 @@ these instruction assume that you are already familiar with the process of
}
```

> **:point_up: Important**: Ensure that your keyring implements the [methods
> :point_up: **Important**: Ensure that your keyring implements the [methods
> called by MetaMask][exposed-methods], otherwise some features may not
> work.
2. **Handle requests submitted by MetaMask:**

MetaMask will submit requests through the `submitRequest` method of your the
Keyring API (check the supported [EVM methods](./docs/evm_methods.md)). Here
Keyring API (check the supported [EVM methods](./docs/evm-methods.md)). Here
is an example of request:

```json
Expand Down Expand Up @@ -178,7 +178,7 @@ these instruction assume that you are already familiar with the process of

MetaMask will return an error if the request does not exist.

> **:pencil: Note:** This only applies to Snaps that implement the
> :pencil2: **Note:** This only applies to Snaps that implement the
> [asynchronous transaction flow][async-flow].

5. When a request is rejected:
Expand All @@ -196,7 +196,7 @@ these instruction assume that you are already familiar with the process of

MetaMask will return an error if the request does not exist.

> **:pencil: Note:** This only applies to Snaps that implement the
> :pencil2: **Note:** This only applies to Snaps that implement the
> [asynchronous transaction flow][async-flow].

4. **Expose the Keyring API:**
Expand Down Expand Up @@ -283,7 +283,7 @@ implementation:
emitSnapKeyringEvent(snap, KeyringEvent.RequestRejected, { id: request.id });
```

> **:point_up: Important**: For all events above, MetaMask may return an error
> :point_up: **Important**: For all events above, MetaMask may return an error
> indicating that the event was not handled, possibly because it contains
> invalid arguments.

Expand Down
13 changes: 5 additions & 8 deletions docs/evm_methods.md → docs/evm-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
Here we document the methods that an account Snap may implement to support
requests originated from dapps.

> [!NOTE]
> The methods described here may have different returns values than the ones
> :pencil2: **Note:** The methods described here may differ from the ones
> defined in the [Ethereum JSON-RPC Specification][execution-api] or in
> [MetaMask's API Reference][metamask-api-reference].
Expand Down Expand Up @@ -51,9 +50,8 @@ Adds support to [`personal_sign`][personal-sign].

Adds support to [`eth_sign`][eth-sign].

> [!WARNING]
> Please read the following articles to understand the risks of using this
> method and its differences with `personal_sign`:
> :warning: **Warning:** Please read the following articles to understand the
> risks of using this method and its differences with `personal_sign`:
>
> - [What is 'eth_sign' and why is it a risk?][eth-sign-risk]
> - [Sign data (MetaMask Docs)][sign-data]
Expand Down Expand Up @@ -229,9 +227,8 @@ Adds support to [`eth_sendTransaction`][eth-send-transaction].

Adds support to [`eth_signtypeddata_v4`][eth-sign-typed-data].

> [!NOTE]
> You can also implement support for `eth_signTypedData_v1` and
> `eth_signTypedData_v3`, but they are [deprecated](#deprecated-methods).
> :pencil2: **Note:** You can also implement support for `eth_signTypedData_v1`
> and `eth_signTypedData_v3`, but they are [deprecated](#deprecated-methods).
>
> In summary, the differences between the versions are:
>
Expand Down
8 changes: 4 additions & 4 deletions docs/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ async submitRequest(request: KeyringRequest): Promise<SubmitRequestResponse> {
}
```

> [!IMPORTANT]
> Only HTTPS URLs are allowed in the `url` field, and the provided URL will be
> checked against a [list of blocked domains][eth-phishing-detect]. However,
> for development purposes, HTTP URLs are allowed on Flask.
> :point_up: **Important:** Only HTTPS URLs are allowed in the `url` field, and
> the provided URL will be checked against a [list of blocked
> domains][eth-phishing-detect]. However, for development purposes, HTTP URLs
> are allowed on Flask.
>
> We also enforce that the redirect URL links to a page within one of the
> allowed origins present in the Snap's manifest.
Expand Down

0 comments on commit 939ff49

Please sign in to comment.