Coder Social home page Coder Social logo

muhammadwaqarqsol / connectkitwagmitypechain Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 4.33 MB

WagmiHooks usage with ConnectKit wallet for multiple EVM wallet usage

Home Page: https://connect-kit-wagmi-type-chain-sepia.vercel.app

HTML 1.36% JavaScript 0.19% CSS 0.87% TypeScript 97.58%
pinata reactjs typechain typescript wagmi connectkit ethersjs modal react-router-dom tailwindcss

connectkitwagmitypechain's Introduction

Project Dependencies Required

wagmi for etheruem hooks to get read write functionality on Blockchain

npm i wagmi

wallet connectivty requires connectKit which offer different Evm wallet connections

npm i connectkit viem 

Using axios for get request for fetching UI from the ipfs

npm i axios

Using typechain for generating Types for Solidiity Smart contract

npm install --save-dev typechain

typechain requires ethers to use the static types so better install it as well its a web3 library for read and writing function call for blockchain

npm i ethers

Running project

You need to clone this repo using

git clone urlofthisrepo

then install dependencies

npm i

then run the development server

npm start

but first need to configure the env file require to run this

configure env from example env given

after getting these keys create .env file and check variable name from .env.example and set it up

Here's an overview of the project structure:

Inside the src folder:

  • index.tsx sets up ConnectKit and configures Wagmi. It also sets up React Router.
  • App.tsx contains all the routes and the navigation bar.
  • The navigation bar includes a ConnectKit button for connecting EVM wallets and a read on-chain function to check how many NFTs the owner has.
  • The Contract-types folder contains static typings required for Solidity smart contracts usage.

Inside the components folder:

  • Pages for all the routes:
  • The main page is a static page.
  • mintNFT page allows users to select an image and display it in a container, along with input fields for the NFT's name and description.
  • myNFTs page displays NFTs owned by the user using a read function. It fetches all token IDs that exist within the contract and generates a card for each owned NFT.
  • NFTListing page lists all NFTs without checking ownership, showing all available NFTs.
  • The Ui folder contains two modal components: mintModal for minting NFTs and modal.tsx for transferring minted NFTs.

The utils folder contains

  • utility functions, including a debug console logger that can be toggled on or off.

  • The hooks file contains functions for interacting with Wagmi, reducing redundancy when defining multiple functions for different operations.

  • ImageUploader and MetaDataUploader handle the POST API functionality for uploading data to Pinata IPFS.

The web3 folder contains components:

  • TotalTokenId returns the total number of tokens minted, which is used to determine the number of NFTs to display.

  • OwnerOf defines the OwnedListedNFTs component, which generates cards for owned NFTs.

  • ListedNFT generates cards for listed NFTs.

  • The navbar.TSX Has only navbar element and connectkit button for evm wallet connection

The abi folder contains

  • contract ABIs, which can be updated if you want to use your own ERC721 contracts.

Contract for NFt

  • NFT contract is deployed on polygon with address 0x68377b4BDf3b1E4804D15E81774c5398A670E5eE.
  • It is also verified you can run function on polygon mumbai scan as well.
  • Code and Abi can be seen there as well.

Warning:

  • This project doesnot contain any database to store users nft so while getting data from chain and ipfs it continously send get request and show it show the data is continously fetching from respective servers no local storage feature to store and fecth again plus no any kind of other session storage. So when you mint nft and go to my Nft it might show your data a little late due to network fetching it depends on internet speed and your browser.
  • That's all.

MIT License

MIT License

connectkitwagmitypechain's People

Contributors

muhammad-waqar-uit avatar muhammadwaqarqsol avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.