GithubHelp home page GithubHelp logo

my-starter's Introduction

Web3 Unleashed

Basic Next.js application to be used in a stream for Web3 Unleashed.

Branches will be created with stages for the rest of the implementation

Instructions:

You are presented with a Next.js application that has a basic layout and a Context Provider. Your goal is to learn how to use the Metamask API to make this an application that users can interact with.

Few notes about the initial setup and constraints:

  • You do not need any additional dependencies.
  • The context provider is already setup so that any react code under components and pages can access the context using a hook.
  • The context uses a reducer to manage state, so you can dispatch actions to update the state. Feel free to edit and add to the reducer as needed.
  • Next.js runs in multiple environments, you will have to remember that Metamask is only available in the browser, so you will need to check for that before using it.

Have fun!

1 Basics: connecting the user

This is the time to get familiar with how to work with a Next.js application and Metamask.

  • Verify if the user has Metamask installed or not. If not, link to the Metamask website. (hint: use the window.ethereum object)
  • If the user has Metamask installed, offer the user to connect their wallet and save this information in the context. (hint: use the window.ethereum.request method)

2. Novice: use the Metamask API to get information about the user

  • Now that the user can connect, display the wallet address, balance of the wallet.

3. Intermediate: Two way communication with Metamask

  • Listen to changes in the wallet address and balance and update the UI accordingly.
  • Add an option to add a new token to the wallet.

4. Bonus/Advanced: UX goodies

  • Persist the wallet address and balance in the local storage.
  • Add a button to disconnect the wallet.

5. Cleaning Up:

  • removing event listeners if people disconnect

my-starter's People

Contributors

guibibeau avatar mayassalman avatar httpjunkie avatar

Watchers

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