Skip to content

Commit f4c86d1

Browse files
authored
Merge pull request #1562 from onflow/evm_framework_docs_cws
EVM framework doc edits.
2 parents 5f12c2a + b2762f8 commit f4c86d1

File tree

5 files changed

+85
-81
lines changed

5 files changed

+85
-81
lines changed

docs/blockchain-development-tutorials/evm/frameworks/ethers.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ sidebar_position: 1
88

99
[ethers.js](https://docs.ethers.org/v5/) is a powerful JavaScript library for interacting with Ethereum and other EVM-compatible blockchain networks.
1010

11-
In this guide, we'll walk you through how to use ethers.js to interact with smart contracts on the Flow Blockchain.
11+
In this guide, we'll walk you through how to use `ethers.js` to interact with smart contracts on the Flow Blockchain.
1212

1313
---
1414

1515
## Installation
1616

17-
To begin using ethers.js in your project, you'll need to install the package. You can do this by running the following command:
17+
To begin using `ethers.js` in your project, you'll need to install the package. To do this, run the following command:
1818

1919
```bash
2020
bashCopy code
@@ -24,17 +24,17 @@ npm install --save ethers
2424

2525
## Setup
2626

27-
After installing ethers.js, the next step is to import it into your project.
27+
After you install `ethers.js`, the next step is to import it into your project.
2828

29-
You can do this by adding the following line of code at the beginning of your JavaScript file:
29+
To do this, add the following line of code at the beginning of your JavaScript file:
3030

3131
```jsx
3232
const ethers = require('ethers');
3333
```
3434

35-
## Connecting to Flow
35+
## Connect to Flow
3636

37-
To connect to the Flow Blockchain using ethers.js, you need to create a new `JsonRpcProvider` instance with the appropriate RPC URL for Flow:
37+
To connect to the Flow Blockchain with `ethers.js`, you need to create a new `JsonRpcProvider` instance with the appropriate RPC URL for Flow:
3838

3939
```jsx
4040
const ethers = require('ethers');
@@ -45,9 +45,9 @@ const provider = new ethers.providers.JsonRpcProvider(url);
4545

4646
**Note:** If you want to connect to the Flow mainnet, replace the above URL with `https://mainnet.evm.nodes.onflow.org`.
4747

48-
## Reading Data from the Blockchain
48+
## Read data from the Blockchain
4949

50-
Once your provider is set up, you can start reading data from the Flow Blockchain. For instance, to retrieve the latest block number, you can use the `getBlockNumber` method:
50+
After you set up your provider, you can start reading data from the Flow Blockchain. For instance, to retrieve the latest block number, you can use the `getBlockNumber` method:
5151

5252
```jsx
5353
async function getLatestBlock() {
@@ -56,9 +56,9 @@ async function getLatestBlock() {
5656
}
5757
```
5858

59-
## Writing Data to the Blockchain
59+
## Write data to the Blockchain
6060

61-
To send transactions or write data to the Flow Blockchain, you need to create a `Signer`. This can be done by initializing a new `Wallet` object with your private key and the previously created `Provider`:
61+
To send transactions or write data to the Flow Blockchain, you need to create a `Signer`. To do this, initialize a new `Wallet` object with your private key and the previously created `Provider`:
6262

6363
```jsx
6464
const privateKey = 'YOUR_PRIVATE_KEY';
@@ -67,9 +67,9 @@ const signer = new ethers.Wallet(privateKey, provider);
6767

6868
**Note:** Replace `'YOUR_PRIVATE_KEY'` with the actual private key of the wallet you want to use.
6969

70-
## Interacting with Smart Contracts
70+
## Interact with smart contracts
7171

72-
ethers.js also enables interaction with smart contracts on the Flow Blockchain. To do this, create a `Contract` object using the ABI (Application Binary Interface) and the address of the deployed contract:
72+
ethers.js also allows interaction with smart contracts on the Flow Blockchain. To do this, create a `Contract` object using the Application Binary Interface (ABI) and the address of the deployed contract:
7373

7474
```jsx
7575
const abi = [
@@ -91,7 +91,7 @@ const contract = new ethers.Contract(contractAddress, abi, signer);
9191

9292
**Note:** Replace `'CONTRACT_ADDRESS'` with the actual address of your deployed contract.
9393

94-
After setting up your `Contract` object, you can call methods on the smart contract as needed:
94+
After you set up your `Contract` object, you can call methods on the smart contract as needed:
9595

9696
```jsx
9797
async function setValue(value) {

docs/blockchain-development-tutorials/evm/frameworks/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,29 @@ keywords:
1717

1818
# Flow EVM Frameworks
1919

20-
Modern blockchain development relies on powerful JavaScript and React frameworks that simplify smart contract interactions and provide seamless user experiences. This section covers the most popular frontend frameworks and libraries for building Flow EVM applications, from low-level blockchain interaction libraries to high-level React components for wallet management and user interfaces.
20+
Modern blockchain development relies on powerful JavaScript and React frameworks that simplify smart contract interactions and provide seamless user experiences. This section covers the most popular frontend frameworks and libraries that you can use to build Flow EVM applications, from low-level blockchain interaction libraries to high-level React components for wallet management and user interfaces.
2121

22-
These frameworks enable developers to build sophisticated decentralized applications using familiar JavaScript and React patterns while leveraging Flow's high-performance EVM environment. Whether you're building simple contract interfaces or complex multi-wallet applications, these tutorials provide practical implementation guidance for integrating proven blockchain development frameworks with Flow EVM.
22+
These frameworks allow developers to build sophisticated decentralized applications with familiar JavaScript and React patterns while leveraging Flow's high-performance EVM environment. Whether you want to build simple contract interfaces or complex multi-wallet applications, these tutorials provide practical implementation guidance for you to integrate proven blockchain development frameworks with Flow EVM.
2323

2424
## [Ethers.js]
2525

26-
Discover how to use ethers.js, the most popular JavaScript library for blockchain interactions, to connect with Flow EVM and manage smart contracts. This guide covers provider setup, reading blockchain data, writing transactions with proper signers, and implementing both read-only queries and state-changing operations. Learn to leverage ethers.js's intuitive interface for comprehensive Flow EVM contract interactions.
26+
Discover how to use `ethers.js`, the most popular JavaScript library for blockchain interactions, to connect with Flow EVM and manage smart contracts. This guide covers provider setup, how to read blockchain data, how to write transactions with proper signers, and how to implement both read-only queries and state-changing operations. Learn to leverage ethers.js's intuitive interface for comprehensive Flow EVM contract interactions.
2727

2828
## [Web3.js]
2929

30-
Master web3.js integration with Flow EVM for comprehensive smart contract development and blockchain interaction capabilities. This tutorial demonstrates initializing web3 instances with Flow endpoints, querying blockchain state, managing accounts with private keys, and executing contract transactions. You'll work through practical examples including a complete Storage contract implementation with read and write operations.
30+
Master `web3.js` integration with Flow EVM for comprehensive smart contract development and blockchain interaction capabilities. This tutorial demonstrates how to initialize web3 instances with Flow endpoints, how to query blockchain state, how to manage accounts with private keys, and how to execute contract transactions. You'll work through practical examples, such as a complete Storage contract implementation with read and write operations.
3131

3232
## [Viem & Wagmi]
3333

34-
Build modern React applications on Flow EVM using wagmi and viem with built-in Flow network configurations and React hooks. This comprehensive guide walks through creating Next.js applications with wallet connection capabilities, smart contract interactions using React hooks, and proper error handling for blockchain operations. Learn to implement complete dApps with wagmi's powerful React integration and viem's efficient blockchain interactions.
34+
Build modern React applications on Flow EVM with wagmi and viem with built-in Flow network configurations and React hooks. This comprehensive guide walks through how to create `Next.js` applications with wallet connection capabilities, smart contract interactions with React hooks, and proper error handling for blockchain operations. Learn to implement complete dApps with wagmi's powerful React integration and viem's efficient blockchain interactions.
3535

3636
## [RainbowKit]
3737

38-
Integrate advanced wallet connection experiences into your Flow EVM applications using RainbowKit with custom Flow Wallet support. This tutorial demonstrates creating custom wallet connectors, configuring WalletConnect integration for seamless mobile and desktop connections, and implementing comprehensive wallet onboarding flows. You'll build complete wallet connection interfaces that support Flow Wallet alongside other popular Ethereum wallets.
38+
Integrate advanced wallet connection experiences into your Flow EVM applications using RainbowKit with custom Flow Wallet support. This tutorial demonstrates how to create custom wallet connectors, how to configure WalletConnect integration for seamless mobile and desktop connections, and how to implement comprehensive wallet onboarding flows. You'll build complete wallet connection interfaces that support Flow Wallet alongside other popular Ethereum wallets.
3939

4040
## Conclusion
4141

42-
These framework guides provide comprehensive coverage of the most popular JavaScript and React tools for Flow EVM development. From low-level blockchain interactions with ethers.js and web3.js to sophisticated React applications with wagmi and RainbowKit, these tutorials offer practical implementation patterns for building modern decentralized applications on Flow's EVM-compatible network.
42+
These framework guides provide comprehensive coverage of the most popular JavaScript and React tools for Flow EVM development. From low-level blockchain interactions with ethers.js and web3.js to sophisticated React applications with wagmi and RainbowKit, these tutorials offer practical implementation patterns for you to build modern decentralized applications on Flow's EVM-compatible network.
4343

4444
<!-- Reference-style links, will not render on page. -->
4545

docs/blockchain-development-tutorials/evm/frameworks/rainbowkit.md

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,37 @@ sidebar_position: 4
55
sidebar_label: Rainbowkit
66
---
77

8-
Integrating Flow Wallet with [RainbowKit][1] allows users to seamlessly connect their Flow accounts through one of the most popular wallet connection interfaces.
8+
# Using Rainbow Kit with FLow Wallet
99

10-
This guide walks you through the process of defining Flow Wallet as a custom wallet in RainbowKit and testing the integration. You can follow along by setting up a new RainbowKit project or use the code in this guide to integrate these steps into your existing dApp.
10+
When you integrate Flow Wallet with [RainbowKit][1], you can seamlessly connect your Flow accounts through one of the most popular wallet connection interfaces.
11+
12+
This guide walks you through how to define Flow Wallet as a custom wallet in RainbowKit and testing the integration. As you follow along, you can set up up a new RainbowKit project or use the code in this guide to integrate these steps into your current dApp.
1113

1214
## Objectives
1315

14-
After completing this guide, you'll be able to:
15-
- Create a custom Flow Wallet connector compatible with RainbowKit's interface
16-
- Configure your Wagmi setup to support Flow Wallet connections
17-
- Implement a complete wallet connection flow for Flow blockchain users
18-
- Test and verify the Flow Wallet integration in your dApp
16+
After you complete this guide, you'll be able to:
17+
- Create a custom Flow Wallet connector compatible with RainbowKit's interface.
18+
- Configure your Wagmi setup to support Flow Wallet connections.
19+
- Implement a complete wallet connection flow for Flow blockchain users.
20+
- Test and verify the Flow Wallet integration in your dApp.
1921

2022
## Prerequisites
2123

22-
### Next.js and Modern Frontend Development
24+
### Next.js and modern frontend development
2325

24-
The RainbowKit starter is built on Next.js, so familiarity with React, hooks, and modern frontend development will help you follow along.
26+
The RainbowKit starter is built on `Next.js`, so familiarity with React, hooks, and modern frontend development will help you follow along.
2527

2628
## A Flow Wallet
2729

2830
To use Flow Wallet with RainbowKit, install the Flow Wallet browser extension from the [Chrome Web Store][2].
2931

30-
Once installed, set up your wallet by creating or importing an account. For quick access, pin the extension to your browser toolbar.
32+
After you install it, create or import an account to set up your wallet. For quick access, pin the extension to your browser toolbar.
3133

32-
## Setting Up Your Environment
34+
## Set up your environment
3335

34-
### Initial Setup
36+
### Initial setup
3537

36-
The RainbowKit starter is built on Next.js, following its standard project structure and conventions. Create a new project or ensure your existing one has the necessary dependencies:
38+
The RainbowKit starter is built on`Next.js` and follows its standard project structure and conventions. Create a new project or ensure your current one has the necessary dependencies:
3739

3840
```bash
3941
$ npm init @rainbow-me/rainbowkit@latest
@@ -44,7 +46,8 @@ $ npm run dev
4446
The [RainbowKit](https://www.rainbowkit.com/) components will be available throughout your application via the provided wrapper components.
4547

4648
### Creating the Flow Wallet Connector
47-
The first major step is defining the Flow Wallet connector. Create a new file called `flowWallet.ts` in `src/flowWallet.ts` to house the wallet configuration:
49+
50+
The first major step is to define the Flow Wallet connector. Create a new file called `flowWallet.ts` in `src/flowWallet.ts` to house the wallet configuration:
4851

4952
```tsx
5053
/* src/flowWallet.ts */
@@ -113,7 +116,7 @@ export const flowWallet = ({ projectId }: MyWalletOptions): Wallet => ({
113116
});
114117
```
115118

116-
### Configuring Wagmi Integration
119+
### Configure your Wagmi integration
117120

118121
Next, update your Wagmi configuration to include Flow Wallet support. Modify your `wagmi.ts` file:
119122

@@ -168,12 +171,12 @@ To get a Project ID, sign up at WalletConnect Cloud, create a new project, and c
168171

169172
## Testing Your Integration
170173

171-
After implementing the Flow Wallet connector and configuring Wagmi, follow these steps to verify that the integration works correctly in your dApp:
174+
After you implement the Flow Wallet connector and configure Wagmi, follow these steps to verify that the integration works correctly in your dApp:
172175

173-
1. **Click "Connect Wallet"** – Open your application and click the "Connect Wallet" button.
176+
1. **Click "Connect Wallet"** – Open your application and click "Connect Wallet."
174177
2. **Check for Flow Wallet** – Ensure Flow Wallet appears as an option in the RainbowKit wallet selection modal.
175178
- If you haven't installed the browser extension and set up your wallet yet, you can find install it via the [Chrome Web Store][2].
176-
3. **Connect the Wallet** – Click on Flow Wallet in the selection modal. If using the browser extension, open it and press "Connect."
179+
3. **Connect the Wallet** – Click on Flow Wallet in the selection modal. If you use the browser extension, open it and press "Connect."
177180

178181
![Rainbowkit dAPP UI](./imgs/rainbowkit-1.png)
179182

@@ -183,11 +186,11 @@ After implementing the Flow Wallet connector and configuring Wagmi, follow these
183186

184187
## Conclusion
185188

186-
In this tutorial, you learned how to integrate Flow Wallet with [RainbowKit](https://www.rainbowkit.com/), creating a seamless wallet connection experience for your users. You should now be able to:
187-
- Create a custom Flow Wallet connector compatible with RainbowKit's interface
188-
- Configure your Wagmi setup to support Flow Wallet connections
189-
- Implement a complete wallet connection flow for Flow blockchain users
190-
- Test and verify the Flow Wallet integration in your dApp
189+
In this tutorial, you learned how to integrate Flow Wallet with [RainbowKit](https://www.rainbowkit.com/) and create a seamless wallet connection experience for your users. You should now be able to:
190+
- Create a custom Flow Wallet connector compatible with RainbowKit's interface.
191+
- Configure your Wagmi setup to support Flow Wallet connections.
192+
- Implement a complete wallet connection flow for Flow blockchain users.
193+
- Test and verify the Flow Wallet integration in your dApp.
191194

192195
Now that you've completed this tutorial, you're ready to enhance your dApp with additional Flow blockchain features such as token transfers, NFT minting, and smart contract interactions.
193196

0 commit comments

Comments
 (0)