Skip to content

this is react app use metamask and trustwallet buttons from rainbow toolkit and read and write contracts using wagmi react hooks & in rainbow-wagmi-web3.js branch its read and write contracts using web3.js

Notifications You must be signed in to change notification settings

m-Jawa-d/wagmi-rainbowkit-web3.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wagmi + RainbowKit + Web3.js Integration

This repository demonstrates the integration of RainbowKit for wallet connection and Wagmi for interacting with Ethereum smart contracts using React hooks. It has two branches:

  1. main: Uses RainbowKit and Wagmi hooks for both reading from and writing to contracts.
  2. rainbow-wagmi-web3.js: Uses RainbowKit for wallet connection and Web3.js for contract interactions, utilizing Wagmi client as a provider.

Branches

main

The main branch uses RainbowKit to connect to wallets such as MetaMask and Trust Wallet and leverages Wagmi React hooks for interacting with smart contracts.

Features

  • Connect wallets using RainbowKit.
  • Read from and write to Ethereum smart contracts using Wagmi hooks.
  • Easy integration with various Ethereum-based wallets.

rainbow-wagmi-web3.js

The rainbow-wagmi-web3.js branch uses RainbowKit to connect to wallets and Web3.js for contract interactions. It uses the Wagmi client as a provider, enabling a streamlined approach to both reading and writing to contracts.

Features

  • Connect wallets using RainbowKit.
  • Use Web3.js for reading from and writing to Ethereum smart contracts.
  • Leverage Wagmi client for enhanced provider management.

Getting Started

To get started with this project, follow these steps:

Prerequisites

  • Node.js and npm installed on your local machine.
  • A modern web browser to view the app.

Installation

Clone the repository and navigate to the desired branch:

git clone https://github.com/m-Jawa-d/wagmi-rainbowkit.git
cd wagmi-rainbowkit
git checkout main # or rainbow-wagmi-web3.js
npm install

Running the App Start the development server:

npm start

Open your web browser and navigate to http://localhost:3000 to see the app in action.

Usage

Connecting Wallet

  1. Click on the "Connect Wallet" button.
  2. Select your preferred wallet (e.g., MetaMask, WalletConnect).
  3. Approve the connection in your wallet.

Interacting with Contracts

main Branch

  • Reading Data: Use Wagmi hooks to read data from contracts.
  • Writing Data: Use Wagmi hooks to send transactions and interact with contracts.

rainbow-wagmi-web3.js Branch

  • Reading Data: Use Web3.js to call contract methods.
  • Writing Data: Use Web3.js to send transactions and interact with contracts, using Wagmi client as a provider.

Contributing

Contributions are welcome! Please fork the repository and create a pull request with your changes.

Acknowledgments

About

this is react app use metamask and trustwallet buttons from rainbow toolkit and read and write contracts using wagmi react hooks & in rainbow-wagmi-web3.js branch its read and write contracts using web3.js

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published