Modifying the Code
Lets modify the code to implement the Data API.
In this section we will modify the code to implement the Data API.
Modify Backend src/app/api/explorer/route.ts
First we will implement the getRecentBlocks
function. The goal of this function is to fetch recent blocks from the Data API with all its information.
Next we will implement the getRecentTransactions
function. The goal of this function is to fetch all native token transfers from the Data API.
Modify Frontend src/app/basic-explorer/page.tsx
First we will implement the fetchRecentTransactions
function. The goal of this function is to make a call to our backend to get recent transactions.
Next we will implement the fetchRecentBlocks
function. The goal of this function is to make a call to our backend to get recent block information.