-
-
Notifications
You must be signed in to change notification settings - Fork 968
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1130adf
commit 954c725
Showing
1 changed file
with
53 additions
and
2 deletions.
There are no files selected for viewing
55 changes: 53 additions & 2 deletions
55
wallet/how-to/use-non-evm-networks/starknet-snap/connect-to-starknet.md
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 |
---|---|---|
@@ -1,6 +1,57 @@ | ||
--- | ||
description: Connect | ||
description: Connect your Starknet account to MetaMask | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Connect | ||
import Tabs from "@theme/Tabs"; | ||
import TabItem from "@theme/TabItem"; | ||
import YoutubeEmbed from "@site/src/components/YoutubeEmbed"; | ||
|
||
# Connect your Starknet account to MetaMask | ||
|
||
Use `get-starknet` to connect your dapp to a user's Starknetwallet. | ||
Use the connect function. If a user connects their MetaMask wallet, you can then display their wallet address and other details in your dapp. | ||
|
||
## Prerequisites | ||
|
||
- [MetaMask Flask installed](install-flask.md) | ||
- A text editor (for example, [VS Code](https://code.visualstudio.com/)) | ||
- [Node](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) version 20.11 or later | ||
- [Yarn](https://yarnpkg.com/) or [npm]() | ||
|
||
## Create the project | ||
|
||
Create a new Snap project using the [`get-starknet`](https://github.com/MetaMask/snaps/tree/main/packages/create-snap) | ||
library by running: | ||
|
||
```bash | ||
yarn add get-starknet starknet@next | ||
``` | ||
|
||
or | ||
|
||
```bash | ||
npm install get-starknet starknet@next | ||
``` | ||
|
||
## Start the Snap | ||
|
||
From the root of the newly created project, install the project dependencies using Yarn: | ||
|
||
```shell | ||
yarn start | ||
``` | ||
|
||
or | ||
|
||
```shell | ||
yarn start | ||
``` | ||
|
||
## Connect to the Snap | ||
|
||
On the front-end dapp, select the **Connect** button and the MetaMask Flask extension pops up and | ||
requires you to approve the Snap's permissions. | ||
|
||
Once connected, select the **Send message** button to display a custom message within a confirmation | ||
dialog in MetaMask Flask. |