From 8501a8bf3e64c47bd56dbd3f20079305a952b249 Mon Sep 17 00:00:00 2001 From: Alexandra Tran Date: Thu, 19 Sep 2024 20:34:55 -0700 Subject: [PATCH] Edit About get-starknet --- ...{architecture.md => about-get-starknet.md} | 46 ++++++++++++------- .../use-non-evm-networks/starknet/index.md | 4 +- 2 files changed, 31 insertions(+), 19 deletions(-) rename wallet/how-to/use-non-evm-networks/starknet/{architecture.md => about-get-starknet.md} (54%) diff --git a/wallet/how-to/use-non-evm-networks/starknet/architecture.md b/wallet/how-to/use-non-evm-networks/starknet/about-get-starknet.md similarity index 54% rename from wallet/how-to/use-non-evm-networks/starknet/architecture.md rename to wallet/how-to/use-non-evm-networks/starknet/about-get-starknet.md index e26a08f7c5..fa100e27c1 100644 --- a/wallet/how-to/use-non-evm-networks/starknet/architecture.md +++ b/wallet/how-to/use-non-evm-networks/starknet/about-get-starknet.md @@ -1,30 +1,37 @@ --- -description: How `get-starknet` interacts with MetaMask. -sidebar_position: 2 +description: Learn about how `get-starknet` interacts with MetaMask. +sidebar_position: 8 --- # About `get-starknet` -`get-starknet` is a library that simplifies Starknet network interactions. -It works with the Starknet Snap to extend the functionality of MetaMask and enable dapps to interact with users' Starknet accounts in MetaMask. +[`get-starknet`](https://github.com/starknet-io/get-starknet) is a library that simplifies Starknet +network interactions. +It works with the [Starknet Snap](https://snaps.metamask.io/snap/npm/consensys/starknet-snap/) to +enable dapps to interact with users' Starknet accounts in MetaMask. -When you integrate `get-starknet` into your dapp, it creates a `WalletAccount` object. `WalletAccount` acts as a connection between dapps and MetaMask and provides a way to manage Starknet interactions. - -This allows users to send Starknet transactions, sign Starknet messages, and manage Starknet accounts within MetaMask, and this functionality can be extended to multiple wallets. +When you integrate `get-starknet` into your dapp, it creates a `WalletAccount` object, which acts as +the connection between the dapp and MetaMask, and manages Starknet interactions. +This allows users to send Starknet transactions, sign Starknet messages, and manage Starknet +accounts within MetaMask, and this functionality can be extended to multiple wallets in the Starknet +ecosystem. ## How `get-starknet` and MetaMask interact A dapp with `get-starknet` installed interacts with MetaMask as follows: -1. The dapp uses `get-starknet` to request the user connect to MetaMask. If the user doesn't have the Starknet Snap installed, MetaMask automatically prompts the user to connect and approve the addition. +1. The dapp uses `get-starknet` to request the user connect to MetaMask. + MetaMask automatically requests the user to add the Starknet Snap, if it's not already present. -1. After the dapp is connected to MetaMask and the Starknet Snap, `get-starknet` receives a Starknet Windows Object (SWO), which represents the MetaMask wallet with Starknet functionality. +1. After the dapp is connected to MetaMask and the Starknet Snap, `get-starknet` receives a Starknet + Windows Object (SWO), which represents the MetaMask wallet with Starknet functionality. -1. `get-starknet` creates a [`WalletAccount`](http://starknetjs.com/docs/guides/walletAccount/) instance. This instance manages the Starknet account within MetaMask. +1. `get-starknet` creates a [`WalletAccount`](http://starknetjs.com/docs/guides/walletAccount/) instance. + This instance manages the Starknet account within MetaMask. ```mermaid sequenceDiagram - participant dapp as dapp + participant dapp as Dapp participant get as get-starknet participant mm as MetaMask participant Snap as Starknet Snap @@ -56,11 +63,16 @@ sequenceDiagram get->>dapp: Notify change ``` -The `get-starknet` library offers several key features that improve how dapps interact with the Starknet network through MetaMask: +The `get-starknet` library offers several features that improve how dapps interact with the Starknet +network through MetaMask: - The `WalletAccount` uses a specified provider to access data from the Starknet network. -- For transactions, `get-starknet` prepares the data and sends it to MetaMask for signing through the Starknet Snap. -- `get-starknet` enables the dapp to create contract instances connected to the `WalletAccount`, allowing smart contract functions to be invoked, with MetaMask handling the signatures. -- `get-starknet` sets up listeners for account and network changes in MetaMask, so the dapp can subscribe and update its state accordingly. -- `get-starknet` can request network changes through MetaMask, allowing users to switch between Starknet networks, such as Mainnet or Sepolia testnet. -- `get-starknet` can also request MetaMask to display specific tokens, improving the user experience. \ No newline at end of file +- For transactions, `get-starknet` prepares the data and sends it to MetaMask for signing through + the Starknet Snap. +- `get-starknet` enables the dapp to create contract instances connected to the `WalletAccount`, + allowing smart contract functions to be invoked, with MetaMask handling the signatures. +- `get-starknet` sets up listeners for account and network changes in MetaMask, so the dapp can + subscribe and update its state accordingly. +- `get-starknet` can request network changes through MetaMask, allowing users to switch between + Starknet networks, such as Mainnet and Sepolia testnet. +- `get-starknet` can also request MetaMask to display specific tokens, improving the user experience. diff --git a/wallet/how-to/use-non-evm-networks/starknet/index.md b/wallet/how-to/use-non-evm-networks/starknet/index.md index ba17dd0cbf..ea5e968d2a 100644 --- a/wallet/how-to/use-non-evm-networks/starknet/index.md +++ b/wallet/how-to/use-non-evm-networks/starknet/index.md @@ -37,11 +37,11 @@ The [`wallet_invokeSnap`](/snaps/reference/wallet-api-for-snaps/#wallet_invokesn :::warning Important We recommend using the `get-starknet` library for most use cases due to its ease of configuration -and multi-wallet support. +and multi-wallet support. +Learn more [about how `get-starknet` interacts with MetaMask](about-get-starknet.md). ::: - ## Supported methods Once connected to the Starknet Snap, your dapp can call