From 939ff498f9b751dd3a3eab2151c2cf7aee03a224 Mon Sep 17 00:00:00 2001 From: Daniel Rocha Date: Thu, 9 Nov 2023 17:05:11 +0100 Subject: [PATCH] docs: remove admonitions from documentation (#185) * docs: don't use broken admonitions GitHub's admonitions currently don't support relative links nor mobile. * chore: rename `evm-methods.md` file --- README.md | 14 +++++++------- docs/{evm_methods.md => evm-methods.md} | 13 +++++-------- docs/security.md | 8 ++++---- 3 files changed, 16 insertions(+), 19 deletions(-) rename docs/{evm_methods.md => evm-methods.md} (95%) diff --git a/README.md b/README.md index a6eb4e856..72744792c 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ 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). @@ -45,7 +45,7 @@ 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 @@ -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 @@ -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: @@ -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:** @@ -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. diff --git a/docs/evm_methods.md b/docs/evm-methods.md similarity index 95% rename from docs/evm_methods.md rename to docs/evm-methods.md index 0e3eeb196..554ebc600 100644 --- a/docs/evm_methods.md +++ b/docs/evm-methods.md @@ -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]. @@ -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] @@ -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: > diff --git a/docs/security.md b/docs/security.md index 726f61ffb..9bd5bf4c4 100644 --- a/docs/security.md +++ b/docs/security.md @@ -139,10 +139,10 @@ async submitRequest(request: KeyringRequest): Promise { } ``` -> [!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.