Skip to content

Commit

Permalink
docs(1367): tidy up for tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
m4sterbunny committed Jul 10, 2024
1 parent c3a9e47 commit b5d6bbe
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 12 deletions.
27 changes: 22 additions & 5 deletions snaps/learn/tutorials/gas-estimation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ description: Create a Snap that estimates gas fees.
sidebar_position: 1
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Create a Snap to estimate gas fees

This tutorial walks you through creating a Snap that estimates gas fees.
Expand All @@ -24,21 +27,28 @@ Create a new Snap project using the
[`@metamask/create-snap`](https://github.com/MetaMask/snaps/tree/main/packages/create-snap)
starter kit by running:

<Tabs>
<TabItem value="yarn" label="yarn" default>

```bash
yarn create @metamask/snap gas-estimation-snap
```

or
</TabItem>
<TabItem value="npx" label="npx" >

```bash
npx @metamask/create-snap gas-estimation-snap
```

or
</TabItem>
<TabItem value="npm" label="npm" >

```bash
npm create @metamask/snap gas-estimation-snap
```
</TabItem>
</Tabs>


Next, `cd` into the `gas-estimation-snap` project directory and run:

Expand All @@ -47,18 +57,25 @@ yarn install
```

This initializes your development environment with the required dependencies.
You may get a warning similar to the following:

<details>
<summary>Did you get a warning?</summary>
<div>
You may get a warning such as:

```bash
@lavamoat/allow-scripts has detected dependencies without configuration. explicit configuration required.
run "allow-scripts auto" to automatically populate the configuration.
```

You can resolve this error by running the following command:
You can resolve this error by running:

```bash
yarn run allow-scripts auto
```
</div>
</details>


### 2. Add a custom icon

Expand Down
30 changes: 23 additions & 7 deletions snaps/learn/tutorials/transaction-insights.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ description: Create a Snap that provides transaction insights.
sidebar_position: 2
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Create a Snap to calculate gas fee percentages

This tutorial walks you through creating a Snap that calculates the percentage of gas fees that
Expand All @@ -28,41 +31,54 @@ Create a new Snap project using the
[`@metamask/create-snap`](https://github.com/MetaMask/snaps/tree/main/packages/create-snap)
starter kit by running:

<Tabs>
<TabItem value="yarn" label="yarn" default>

```bash
yarn create @metamask/snap transaction-insights-snap
```

or
</TabItem>
<TabItem value="npx" label="npx" >

```bash
npx @metamask/create-snap transaction-insights-snap
```

or
</TabItem>
<TabItem value="npm" label="npm" >

```bash
npm create @metamask/snap transaction-insights-snap
```
</TabItem>
</Tabs>

Next, `cd` into the `transaction-insights-snap` project directory and run:

```bash
yarn install
```

This initializes your development environment with the required dependencies.
You may get a warning similar to the following:

<details>
<summary>Did you get a warning?</summary>
<div>
You may get a warning such as:

```bash
@lavamoat/allow-scripts has detected dependencies without configuration. explicit configuration required.
run "allow-scripts auto" to automatically populate the configuration.
```

You can resolve the issue by running the following command:
You can resolve the issue by running:

```bash
yarn run allow-scripts auto
```
```
</div>
</details>



### 2. Enable transaction insights and the Ethereum provider

Expand Down

0 comments on commit b5d6bbe

Please sign in to comment.