Skip to content

Commit

Permalink
add changes for connect
Browse files Browse the repository at this point in the history
  • Loading branch information
joaniefromtheblock committed Sep 12, 2024
1 parent f8c3685 commit c27a96d
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 2 deletions.
13 changes: 13 additions & 0 deletions wallet/how-to/use-non-evm-networks/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
description: Interact with users' accounts on non-EVM networks
---

# Use non-EVM networks
You can connect to non-EVM networks and interact with users' accounts on these networks using MetaMask Snaps.

## Non-EVM networks

Non-EVM networks are blockchain networks that are not compatible with the Ethereum Virtual Machine (EVM).

Non-EVM dapps and MetaMask can't directly interact with each other.
By connecting to dedicated non-EVM Snaps, you can extend the functionality of MetaMask and integrate non-EVM networks into your existing MetaMask workflow.
Original file line number Diff line number Diff line change
@@ -1,6 +1,87 @@
---
description: Connect
description: Connect your Starknet account to MetaMask
sidebar_position: 1
---

# Connect
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

# Connect your Starknet account to MetaMask

To connect your dapp to the Starknet network in MetaMask, you can use the `get-starknet` library.
This library simplifies the process of connecting to the Starknet Snap, allowing you to interact with users' Starknet accounts in MetaMask.
`get-starknet` also enables dapps to interact with other wallets in the Starknet ecosystem.

## Prerequisites

- [MetaMask installed](https://metamask.io/download/)
- 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/)
- A JavaScript or TypeScript project set up

## Add `get-starknet` to your project

Add both the [`get-starknet`](https://github.com/MetaMask/snaps/tree/main/packages/create-snap) library and the latest version of the `starknet.js` library to your project's dependencies:

- [MetaMask installed](https://metamask.io/download/)
- 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/)
- A JavaScript or TypeScript project set up


## Connect using `get-starknet`

### 1. Add `get-starknet` to your project

Add the [`get-starknet`](https://github.com/MetaMask/snaps/tree/main/packages/create-snap) library and the latest version of the `starknet.js` library to your project's dependencies:

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

```bash
yarn add get-starknet starknet@next
```

</TabItem>

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

```bash
npm install get-starknet starknet@next
```

</TabItem>

</Tabs>

### 2. Start the Snap

From the root of the created project, install the project dependencies:

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

```bash
yarn start
```

</TabItem>

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

```bash
npm start
```

</TabItem>

</Tabs>

### 3. Connect to the Snap

On the dapp, select **Connect**. The MetaMask extension displays and prompts you to approve the Snap's permissions.
After it is connected, select **Send message** to display a custom message within a confirmation
dialog in MetaMask.
9 changes: 9 additions & 0 deletions wallet/how-to/use-non-evm-networks/starknet-snap/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
sidebar_position: 1
sidebar_label: Starknet
description: Learn about how Starknet Snap connects to MetaMask using `get-starknet`.
tags:
- Snaps
- non-EVM
---

2 comments on commit c27a96d

@Alkhtri77
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Alkhtri77
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello help me plaes

Please sign in to comment.