Git Product home page Git Product logo

evm-dapp-boilerplate-ts's Introduction

The EVM DAPP typescript boilerplate

The boilerplate is powered by Nextjs/typechain which fully supports typescript. Check the result here

How to use

  1. clone the repo:
git clone https://github.com/happyeric77/evm-dapp-boilerplate-ts
  1. install npm depandencies and generate types:
yarn install

yarn generate-types // Generate a new folder `contractTypes` which contains all the contracts types definition. The types are generated from /utils/contracts/*.json (compiled by truffle)
  1. Run and listen on localhost port 3000
yarn dev

useWeb3 hook

Use useWeb3 hook to easily access global web3 methods:

const { web3Data, loginWithInjectedWeb3, loginWithWalletConnect, logout, switchNetwork } = useWeb3();

Release note

20230216

Consume the npm evm-web3-hook react hook yarn add evm-web3-hooks or npm install evm-web3-hooks

20230214

  1. Add approve-erc20 page to demo contract interaction
  2. Introduce typechain (yarn generate-types) to enable types for web3.eth.Contract (see example in ./pages/approve-erc20.tsx)
  3. Add useLoading hook
  4. Clean up and small optimization

20230212 Refactor and deprecate contract section

  1. To reduce complexity, truffle section are removed. The contract section can be referred to This repo

  2. Remove unnecessary components

  3. Add hooks: useWeb3 & useNotify

  4. Move all style sheet to ./styles

evm-dapp-boilerplate-ts's People

Contributors

happyeric77 avatar

Watchers

 avatar  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.