Skip to content

Commit 4a64f9b

Browse files
committed
copy edits
1 parent 1617eab commit 4a64f9b

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

wallet/how-to/use-non-evm-networks/starknet/about-get-starknet.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ sequenceDiagram
4242
mm->>Snap: Activate
4343
Snap-->>mm: Activated
4444
mm-->>get: Return SWO
45-
get->>get: Create WalletAccount
45+
get->>network: Create WalletAccount
4646
get-->>dapp: Connection established
4747
4848
dapp->>get: Read blockchain data
@@ -58,9 +58,6 @@ sequenceDiagram
5858
get->>network: Submit transaction
5959
network-->>get: Transaction result
6060
get-->>dapp: Transaction confirmation
61-
62-
mm->>get: Account/Network changed
63-
get->>dapp: Notify change
6461
```
6562

6663
The `get-starknet` library offers several features that improve how dapps interact with the Starknet

wallet/how-to/use-non-evm-networks/starknet/connect-to-starknet.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ A **Connect Wallet** button displays, which allows users to connect to MetaMask
191191
</TabItem>
192192
</Tabs>
193193
194+
The `get-starknet` library automatically handles MetaMask detection, connection, and the Starknet Snap addition.
195+
194196
## Connect using `wallet_invokeSnap`
195197
196198
Alternatively, you can manage the Snap invocation manually.
@@ -387,3 +389,5 @@ const ConnectWallet = () => {
387389
};
388390
export default ConnectWallet;
389391
```
392+
393+
To resolve connection issues when configuring your dapp with `wallet_invokeSnap`, refer to the [Troubleshoot](../troubleshoot) page.

wallet/how-to/use-non-evm-networks/starknet/create-a-simple-starknet-dapp.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -232,15 +232,15 @@ export default App
232232

233233
## 3. Display the balance and transfer an ERC-20 token
234234

235-
Now that you have set up the basics, let's go a step further and show how to display the balance of a specific ERC-20 token, such as STRK, and perform a transfer using the `WalletAccount` instance.
235+
After completing the basic setup, you can demonstrate how to display the balance of a specific ERC-20 token, for example STRK, and perform a transfer using the `WalletAccount` instance.
236236

237-
### 3.1. Setting Up the Contract
237+
### 3.1. Set up the contract
238238

239-
To interact with an ERC-20 contract, you'll need to create a contract instance from `starknet.js` using the `WalletAccount` instance. Assuming the ABI is loaded from a JSON file, here's how you would do it:
239+
To interact with an ERC-20 contract, you'll need to create a contract instance from `starknet.js` using the `WalletAccount` instance. Assuming the ABI (application binary interface) is loaded from a JSON file, the following code example demonstrates how to implement it:
240240

241241
```typescript
242242
import { Contract } from "starknet";
243-
import erc20Abi from "./erc20Abi.json"; // Assuming ABI is stored in this JSON file
243+
import erc20Abi from "./erc20Abi.json";
244244

245245
const tokenAddress = "0x049D36570D4e46f48e99674bd3fcc84644DdD6b96F7C741B1562B82f9e004dC7";
246246

@@ -249,7 +249,7 @@ const erc20 = new Contract(erc20Abi, tokenAddress, walletAccount);
249249

250250
### 3.2. Fetch the token balance
251251

252-
Once the contract is set up, you can call the `balanceOf` method to fetch the balance of the connected account:
252+
After the contract is set up, you can call the `balanceOf` method to fetch the balance of the connected account:
253253

254254
```typescript
255255
const balance = await erc20.balanceOf(walletAddress);
@@ -258,7 +258,7 @@ const formattedBalance = balance / Math.pow(10, 18);
258258

259259
### 3.3. Transfer tokens
260260

261-
To transfer tokens, populate the `transfer` method call and then execute the transaction using the `WalletAccount`. Here"s how you can do that:
261+
To transfer tokens, us the `transfer` method call and then execute the transaction using the `WalletAccount`:
262262

263263
```typescript
264264
import { Call } from "starknet";
@@ -335,18 +335,14 @@ function TokenBalanceAndTransfer({ walletAccount, tokenAddress }) {
335335
}
336336
```
337337

338-
### 3.5. ABI and contract address
339-
340-
The ABI (Application Binary Interface) for the ERC-20 contract can be found on the Voyager Explorer.
341-
342-
The contract address for STRK (an ERC-20 token) on Sepolia testnet is `0x049D36570D4e46f48e99674bd3fcc84644DdD6b96F7C741B1562B82f9e004dC7`.
343-
344338
## Next steps
345339

346-
In this section, we've shown how to extend your dapp by displaying the balance of an ERC-20 token like ETH and performing a token transfer. By creating a Contract instance with the WalletAccount, you can easily interact with smart contracts, fetch token balances, and execute transactions, enabling more complex functionality in your dapp.
340+
You've set up a basic Starknet dApp and successfully added features to display an ERC-20 token balance and perform token transfers. Creating a contract instance using `WalletAccount` allows you to interact with smart contracts, retrieve token balances, and execute transactions, enabling more advanced functionality in your dapp.
341+
342+
Now that you have configured your dapp, you can now manage your [accounts](../manage-starknet-accounts) and networks(../manage-starknet-networks), and explore interaction methods in the [API documentation](../../../reference/non-evm-apis/starknet-snap-api.md).
347343

348344
## Additional resources
349345

346+
- [`get-starknet` official GitHub](https://github.com/starknet-io/get-starknet)
350347
- [Use `get-starknet` to connect to a wallet and create an account instance](https://starknetjs.com/docs/guides/walletAccount)
351348
- [Use account instance to show ERC20 balance and transfer](https://starknetjs.com/docs/guides/use_ERC20)
352-
- [get-starknet official GitHub](https://github.com/starknet-io/get-starknet)

0 commit comments

Comments
 (0)