forked from MetaMask/metamask-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update instructions for creating a snap (MetaMask#745)
* update instructions for creating a snap snaps should be created using the CLI rather than cloning the repo.
- Loading branch information
Showing
5 changed files
with
23 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,8 @@ sidebar_position: 2 | |
# Snaps quickstart | ||
|
||
Get started with Snaps using the | ||
[Snaps template](https://github.com/MetaMask/template-snap-monorepo) built with TypeScript and React. | ||
[Create Snap CLI](https://github.com/MetaMask/snaps-monorepo/packages/create-snap). | ||
With the CLI, you can initialize a snap monorepo project built with TypeScript and React. | ||
|
||
## Prerequisites | ||
|
||
|
@@ -23,21 +24,19 @@ Get started with Snaps using the | |
|
||
## Create the project | ||
|
||
Use the Snaps template by | ||
[creating a new repository from the template](https://github.com/MetaMask/template-snap-monorepo/generate). | ||
|
||
[Clone the repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) | ||
using the command line: | ||
Create a new snap project using the Create Snap CLI by running the following command: | ||
|
||
```bash | ||
git clone [email protected]:<your-username>/template-snap-monorepo.git | ||
yarn create @metamask/snap your-snap-name | ||
# or... | ||
npm create @metamask/snap your-snap-name | ||
``` | ||
|
||
You can learn about the [anatomy of your snap project files](../concepts/anatomy.md). | ||
|
||
## Start the snap | ||
|
||
From the root of the repository, install the project dependencies using Yarn: | ||
From the root of the newly created project, install the project dependencies using Yarn: | ||
|
||
```shell | ||
yarn | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,8 @@ sidebar_position: 1 | |
# Create a gas estimation snap | ||
|
||
This tutorial walks you through creating a snap that estimates gas fees. | ||
The snap is based on the | ||
[Snaps template](https://github.com/MetaMask/template-snap-monorepo). | ||
It uses the `fetch` API to request information from the internet, and displays custom information in | ||
a confirmation dialog. | ||
The snap uses the `fetch` API to request information from the internet, and displays custom | ||
information in a confirmation dialog. | ||
|
||
## Prerequisites | ||
|
||
|
@@ -23,16 +21,12 @@ a confirmation dialog. | |
|
||
### 1. Set up the project | ||
|
||
Use the Snaps template by | ||
[creating a new repository from the template](https://github.com/MetaMask/template-snap-monorepo/generate). | ||
|
||
Give your project a new name, such as `gas-estimation-snap`. | ||
|
||
[Clone the repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) | ||
using the command line: | ||
Create a new snap project using the Create Snap CLI by running the following command: | ||
|
||
```bash | ||
git clone [email protected]:<your-username>/gas-estimation-snap.git | ||
yarn create @metamask/snap gas-estimation-snap | ||
# or... | ||
npm create @metamask/snap gas-estimation-snap | ||
``` | ||
|
||
To initialize your development environment with the required dependencies, in your project | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,7 @@ sidebar_position: 2 | |
|
||
This tutorial walks you through creating a snap that calculates the percentage of gas fees that | ||
a user would pay when creating a transaction. | ||
The snap is based on the | ||
[Snaps template](https://github.com/MetaMask/template-snap-monorepo), and it provides transaction | ||
insights in the MetaMask transaction window. | ||
The snap provides transaction insights in the MetaMask transaction window. | ||
|
||
## Prerequisites | ||
|
||
|
@@ -29,16 +27,12 @@ insights in the MetaMask transaction window. | |
|
||
### 1. Set up the project | ||
|
||
Use the Snaps template by | ||
[creating a new repository from the template](https://github.com/MetaMask/template-snap-monorepo/generate). | ||
|
||
Give your project a new name, such as `transaction-insights-snap`. | ||
|
||
[Clone the repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) | ||
using the command line: | ||
Create a new snap project using the Create Snap CLI by running the following command: | ||
|
||
```bash | ||
git clone [email protected]:<your-username>/transaction-insights-snap.git | ||
yarn create @metamask/snap transaction-insights-snap | ||
# or... | ||
npm create @metamask/snap transaction-insights-snap | ||
``` | ||
|
||
To initialize your development environment with the required dependencies, in your project | ||
|