Skip to content

Commit c259dec

Browse files
authored
Update code samples (#1388)
* update code samples * Update code samples * fix build * Adding spaces after comma and colon * Build * Build * Build * another pass and fix tables * another pass and fix tables * fix build * fix build * fix build * fix build * apply review suggestions * apply additional suggestions
1 parent 0040a5b commit c259dec

File tree

1,508 files changed

+16180
-14901
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,508 files changed

+16180
-14901
lines changed

.github/workflows/crowdin.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Crowdin Action
22

33
on:
44
push:
5-
path: [ "i18n/**" ]
6-
branches: [ main ]
5+
path: ["i18n/**"]
6+
branches: [main]
77

88
permissions: write-all
99

@@ -23,10 +23,10 @@ jobs:
2323
localization_branch_name: l10n_crowdin_translations
2424

2525
create_pull_request: true
26-
pull_request_title: 'New Crowdin translations'
27-
pull_request_body: 'New Crowdin pull request with translations'
28-
pull_request_base_branch_name: 'main'
26+
pull_request_title: "New Crowdin translations"
27+
pull_request_body: "New Crowdin pull request with translations"
28+
pull_request_base_branch_name: "main"
2929
env:
3030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3131
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
32-
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
32+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

.yarn/releases/yarn-3.4.1.cjs

+1-1
Large diffs are not rendered by default.

CONTRIBUTING.md

+20-18
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ guide in some places.
1212
- [Style guide](#style-guide)
1313
- [Add images](#add-images)
1414
- [Format Markdown and MDX](#format-markdown-and-mdx)
15-
- [Live code blocks](#live-code-blocks)
15+
- [Live code blocks](#live-code-blocks)
1616

1717
## Contribution workflow
1818

@@ -34,10 +34,10 @@ To contribute changes:
3434
2. [Clone](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)
3535
this repository to your computer and navigate into it.
3636

37-
```bash
38-
git clone https://github.com/MetaMask/metamask-docs.git
39-
cd metamask-docs
40-
```
37+
```bash
38+
git clone https://github.com/MetaMask/metamask-docs.git
39+
cd metamask-docs
40+
```
4141

4242
> **Note**: If you don't have write access to this repository, you must [fork the
4343
> repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo#forking-a-repository)
@@ -56,9 +56,9 @@ To contribute changes:
5656
We recommend including the issue number and a short description in the branch name (for example,
5757
`183-doc-cli-option`), which is a reminder to fix only one issue in a PR.
5858
59-
```bash
60-
git checkout -b <ISSUE-NUM>-<ISSUE-DESC>
61-
```
59+
```bash
60+
git checkout -b <ISSUE-NUM>-<ISSUE-DESC>
61+
```
6262
6363
> **Tip:** You can use a Git client such as [Fork](https://fork.dev/) instead of the command line.
6464
@@ -68,6 +68,7 @@ To contribute changes:
6868
and [format your Markdown correctly](https://docs-template.consensys.net/contribute/format-markdown).
6969

7070
> **Notes:**
71+
>
7172
> - All documentation content is located in the `wallet` and `snaps` directories.
7273
> - If you add a new documentation page, make sure to edit `wallet-sidebar.js` or
7374
> `snaps-sidebar.js` to add the page to the
@@ -81,27 +82,27 @@ To contribute changes:
8182
6. Add and commit your changes, briefly describing your changes in the commit message.
8283
Push your changes to the remote origin.
8384

84-
```bash
85-
git add .
86-
git commit -m "<COMMIT-MESSAGE>"
87-
git push origin
88-
```
85+
```bash
86+
git add .
87+
git commit -m "<COMMIT-MESSAGE>"
88+
git push origin
89+
```
8990

9091
7. On [this repository on GitHub](https://github.com/MetaMask/metamask-docs), you’ll see a banner
9192
prompting you to create a PR with your recent changes.
9293
Create a PR, describing your changes in detail.
9394
[Link the issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
9495
that your PR fixes by adding `fixes #<ISSUE-NUM>` to the PR description.
9596

96-
9. Specific reviewers are automatically requested when you submit a PR.
97+
8. Specific reviewers are automatically requested when you submit a PR.
9798
You can request additional reviewers in the right sidebar of your PR – for example, the original
9899
issue raiser.
99100
Make any required changes to your PR based on reviewer feedback, repeating steps 5–7.
100101

101102
9. After your PR is approved by two reviewers, all checks have passed, and your branch has no
102-
conflicts with the main branch, you can merge your PR.
103-
If you don't have merge access, a maintainer will merge your PR for you.
104-
You can delete the topic branch after your PR is merged.
103+
conflicts with the main branch, you can merge your PR.
104+
If you don't have merge access, a maintainer will merge your PR for you.
105+
You can delete the topic branch after your PR is merged.
105106

106107
## Preview locally
107108

@@ -160,8 +161,9 @@ If you need to test analytics events in your local development environment be su
160161
```bash
161162
export SEGMENT_ANALYTICS_KEY="<your key>"
162163
```
164+
163165
Then build the project in production mode using the following command:
164166

165167
```bash
166168
yarn build && yarn serve
167-
```
169+
```

README.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,31 @@ Build the documentation site locally using the following steps.
1919

2020
1. Clone the repository.
2121

22-
```bash
23-
git clone https://github.com/MetaMask/metamask-docs.git
24-
cd metamask-docs
25-
```
26-
27-
> **Note:** If you don't have write access to this repository, you must [fork the repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo#forking-a-repository) to your personal account and clone your forked repository instead. [Add an upstream remote](https://docs.github.com/en/get-started/quickstart/fork-a-repo#configuring-git-to-sync-your-fork-with-the-upstream-repository) to be able to pull from and push to the original repository.
28-
>
29-
> ```bash
30-
> git clone https://github.com/<YOUR-USERNAME>/metamask-docs.git
31-
> cd metamask-docs
32-
> git remote add upstream https://github.com/MetaMask/metamask-docs.git
33-
> ```
34-
22+
```bash
23+
git clone https://github.com/MetaMask/metamask-docs.git
24+
cd metamask-docs
25+
```
26+
27+
> **Note:** If you don't have write access to this repository, you must [fork the repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo#forking-a-repository) to your personal account and clone your forked repository instead. [Add an upstream remote](https://docs.github.com/en/get-started/quickstart/fork-a-repo#configuring-git-to-sync-your-fork-with-the-upstream-repository) to be able to pull from and push to the original repository.
28+
>
29+
> ```bash
30+
> git clone https://github.com/<YOUR-USERNAME>/metamask-docs.git
31+
> cd metamask-docs
32+
> git remote add upstream https://github.com/MetaMask/metamask-docs.git
33+
> ```
34+
3535
2. Install dependencies.
3636
37-
```bash
38-
yarn install
39-
```
40-
37+
```bash
38+
yarn install
39+
```
40+
4141
3. Start the development server.
4242

43-
```bash
44-
yarn start
45-
```
46-
47-
Once the server starts, you can view the documentation at `http://localhost:3000`.
43+
```bash
44+
yarn start
45+
```
46+
47+
Once the server starts, you can view the documentation at `http://localhost:3000`.
4848

4949
For more information on contributing to the documentation, see the [full contribution guidelines](CONTRIBUTING.md).

crowdin.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ files:
1313
- source: /services/**/*
1414
translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs/**/%original_file_name%
1515
- source: /docs/**/*
16-
translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs/**/%original_file_name%
16+
translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs/**/%original_file_name%

dashboard-sidebar.js

-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ const sidebar = {
1919
};
2020

2121
module.exports = sidebar;
22-

developer-tools/dashboard/get-started/create-api.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ To create an API key:
2828
1. Open the [Infura dashboard](https://infura.io/dashboard). Enter your login details, if required.
2929
1. Select **CREATE NEW API KEY**.
3030

31-
<div class="left-align-container">
32-
<div class="img-large">
33-
<img
34-
src={require('../../images/create_key.png').default}
35-
/>
36-
</div>
37-
</div>
31+
<div class="left-align-container">
32+
<div class="img-large">
33+
<img
34+
src={require("../../images/create_key.png").default}
35+
/>
36+
</div>
37+
</div>
38+
3839
1. From the pop-up window, provide a name, then click **CREATE**.
3940
1. Select the networks that you want your API key to access, and select **Save Changes**.
4041

@@ -49,5 +50,5 @@ We recommend the following best practices when creating your API keys:
4950
- Group API key endpoints by groups or individuals [sharing the API key](../how-to/project-sharing.md).
5051
- Limit the number of networks or services per API key only to the necessary endpoints.
5152
- Group the API key endpoints based on shared security considerations such as
52-
[allowlists](../how-to/secure-an-api/use-an-allowlist.md) or
53-
[key request volume limits](../how-to/secure-an-api/set-rate-limits.md).
53+
[allowlists](../how-to/secure-an-api/use-an-allowlist.md) or
54+
[key request volume limits](../how-to/secure-an-api/set-rate-limits.md).

developer-tools/dashboard/how-to/dashboard-stats.md

+15-14
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,27 @@ This data is crucial for optimizing your applications and ensuring they run smoo
1212
## Specify stats to view
1313

1414
1. In the top menu of the [Infura dashboard](https://app.infura.io/), select **Stats**.
15-
The stats page displays the total volume of requests sent to Infura over the specified time period.
16-
By default, data is shown from the last 24 hours from all Web3 API keys.
15+
The stats page displays the total volume of requests sent to Infura over the specified time period.
16+
By default, data is shown from the last 24 hours from all Web3 API keys.
1717

1818
2. To change the API key, make a selection from the API keys dropdown.
1919

2020
3. To change the stats time range, make a selection from the time dropdown.
21-
Time values are given in Coordinated Universal Time (UTC).
22-
For Web3 API usage, you can choose from the following options:
23-
- **Last 15 Minutes** - The last completed 15 minutes.
24-
This updates once a minute.
25-
- **Last 1 Hour** - The last fully completed hour, from 0 to 59 minutes and 59 seconds.
26-
- **Last 24 Hours** - The last fully completed 24 consecutive hours.
27-
This is the default.
28-
- **Last 7 Days** - The last fully completed seven consecutive days.
29-
A day appears once it has completed.
30-
- **Last 30 Days** - The last fully completed 30 days.
31-
A day appears once it has completed.
21+
Time values are given in Coordinated Universal Time (UTC).
22+
For Web3 API usage, you can choose from the following options:
23+
24+
- **Last 15 Minutes** - The last completed 15 minutes.
25+
This updates once a minute.
26+
- **Last 1 Hour** - The last fully completed hour, from 0 to 59 minutes and 59 seconds.
27+
- **Last 24 Hours** - The last fully completed 24 consecutive hours.
28+
This is the default.
29+
- **Last 7 Days** - The last fully completed seven consecutive days.
30+
A day appears once it has completed.
31+
- **Last 30 Days** - The last fully completed 30 days.
32+
A day appears once it has completed.
3233

3334
4. To view your IPFS usage, select **IPFS Usage** in the toggle in the top-right corner.
34-
You can choose to show data from the **Last 24 Hours** (default) or the **Last 7 Days**.
35+
You can choose to show data from the **Last 24 Hours** (default) or the **Last 7 Days**.
3536

3637
## Web3 stats charts
3738

developer-tools/dashboard/how-to/network-status.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ sidebar_position: 8
66
# View the network status
77

88
View the [Infura status page](https://status.infura.io/) to check for service outages and other incidents, as well as
9-
scheduled maintenance notices. You can also subscribe to status updates via email, SMS, webhook, Slack and Atom/RSS.
9+
scheduled maintenance notices. You can also subscribe to status updates via email, SMS, webhook, Slack, and Atom/RSS.
1010

1111
You can also select the **Status** link at the top of the Infura dashboard to view the status page.
1212

1313
<div class="left-align-container">
1414
<div class="img-medium">
1515
<img
16-
src={require('../../images/status-page.png').default}
16+
src={require("../../images/status-page.png").default}
1717
/>
1818
</div>
19-
</div>
19+
</div>

developer-tools/dashboard/how-to/project-sharing.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To share an API key:
1818
<div class="left-align-container">
1919
<div class="img-large">
2020
<img
21-
src={require('../../images/invite-member-button.png').default}
21+
src={require("../../images/invite-member-button.png").default}
2222
/>
2323
</div>
2424
</div>
@@ -82,7 +82,7 @@ You can view all keys that you own, and all keys shared with you, by selecting *
8282
<div class="left-align-container">
8383
<div class="img-large">
8484
<img
85-
src={require('../../images/update-role.png').default}
85+
src={require("../../images/update-role.png").default}
8686
/>
8787
</div>
8888
</div>
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"position": 3,
3-
"label": "Secure an API",
4-
"collapsible": true,
5-
"collapsed": true,
6-
"link": {
7-
"type": "generated-index",
8-
"slug": "dashboard/secure-an-api",
9-
"description": "This section provides information about how to secure your API key using Infura's security settings."
10-
}
11-
}
2+
"position": 3,
3+
"label": "Secure an API",
4+
"collapsible": true,
5+
"collapsed": true,
6+
"link": {
7+
"type": "generated-index",
8+
"slug": "dashboard/secure-an-api",
9+
"description": "This section provides information about how to secure your API key using Infura's security settings."
10+
}
11+
}

developer-tools/dashboard/how-to/secure-an-api/api-key-secret.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
description: Authenticate all requests to Infura with an API key secret.
33
---
44

5-
import Tabs from '@theme/Tabs';
6-
import TabItem from '@theme/TabItem';
5+
import Tabs from "@theme/Tabs";
6+
import TabItem from "@theme/TabItem";
77

88
# API key secret
99

@@ -34,7 +34,7 @@ In the API key's **Settings** tab, select **Require API Key secret for all reque
3434
<div class="left-align-container">
3535
<div class="img-large">
3636
<img
37-
src={require('../../../images/security-page.png').default}
37+
src={require("../../../images/security-page.png").default}
3838
/>
3939
</div>
4040
</div>
@@ -47,15 +47,15 @@ In the API key's **Settings** tab, select **Require API Key secret for all reque
4747
```bash
4848
curl --user :<YOUR-API-KEY-SECRET> \
4949
https://mainnet.infura.io/v3/<YOUR-API-KEY> \
50-
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
50+
-d '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}'
5151
```
5252

5353
</TabItem>
5454
<TabItem value="WebSocket" label="WebSocket" >
5555

5656
```bash
5757
wscat -c wss://mainnet.infura.io/ws/v3/<YOUR-API-KEY> --auth ":<YOUR-API-KEY-SECRET>"
58-
> {"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}
58+
> {"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1}
5959
```
6060

6161
</TabItem>

0 commit comments

Comments
 (0)