Implementing URL routes for liquidity management
In this chapter, we will write UI code for liquidity management and interact with smart contracts. In this section, we will explain the structure of liquidity management pages and explain how to implement these pages. Before starting to write the UI code, you can start by using the code in the chatper06-start
branch of the GitHub repository of this book or continue the work you did in Chapter 5, Building Crypto-Trading Smart Contracts.
In order to distinguish other features of the DeFi application, we will create a new URL route, /liquidity
, for users to access all liquidity management functions. If you run the web application with the npm start
command, you will access the liquidity management feature via http://localhost:3000/liquidity
.
Meanwhile, we will create three sub-routes under /liquidity
for the following three functions of the liquidity management feature:
- Listing liquidity pool tokens (LP tokens) in the wallet...