Setting up the React app

Let's start building our React app:

  1. We'll first create a new React app called token wallet using npx, as shown in the following: 
npx create-react-app tokenwallet
  1. Next, we will update package.json with the following values:
{ 
"name": "tokenwallet",
"version": "1.0.0",
"dependencies": {
"bulma-start": "0.0.2",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"react-scripts": "1.1.4",
"web3": "^1.2.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
  1. Run the following command to install the dependencies:
npm install
  1. Next within the src folder, create a Components folder for the app components. Also, create a Token folder within src. We'll be using this to map the tokens supported by our wallet.
  1. Finally, create a folder called Contracts in the src directory. From your build repository in the Truffle workplace, copy the json file for our tokens and the inherited contracts to this folder. You can also set symlink instead, to point to the build repository of your Truffle Suite.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.211.66