From 954c72561524931c1e7faf68468f5ac1b8adb082 Mon Sep 17 00:00:00 2001 From: Joan E <153745173+joaniefromtheblock@users.noreply.github.com> Date: Wed, 4 Sep 2024 20:11:00 -0400 Subject: [PATCH] Update connect-to-starknet.md --- .../starknet-snap/connect-to-starknet.md | 55 ++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/wallet/how-to/use-non-evm-networks/starknet-snap/connect-to-starknet.md b/wallet/how-to/use-non-evm-networks/starknet-snap/connect-to-starknet.md index 07e5f8bf9b9..b3b30341648 100644 --- a/wallet/how-to/use-non-evm-networks/starknet-snap/connect-to-starknet.md +++ b/wallet/how-to/use-non-evm-networks/starknet-snap/connect-to-starknet.md @@ -1,6 +1,57 @@ --- -description: Connect +description: Connect your Starknet account to MetaMask sidebar_position: 1 --- -# Connect \ No newline at end of file +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.