This code defines an authentication middleware that manages access to certain routes. Public routes like `/`, `/signup`, and `/login` are accessible without authentication, while other routes likely require the user to be authenticated.
This code defines an asynchronous function `binanceToFiat`, which converts a given amount of BNB to a specified fiat currency using an exchange rate. It takes `amountInBnb` and `convertTo` (a supported currency) as parameters, fetches the conversion rate, and calculates the equivalent fiat amount.
This code fetches the user's balance from MetaMask using Web3. It retrieves the balance in Wei and converts it to Ether. Additionally, it uses the BNB to fiat conversion function to display the balance in USD as well. Error handling is implemented in case MetaMask is not found or the balance retrieval fails.
This function fetches the total number of transactions for the user's Ethereum account using Web3. It interacts with MetaMask and retrieves the total transaction count for the user's wallet, handling errors if MetaMask is not found or the fetching process fails.
This code defines the creation of a lightweight chart using the `createChart` function from TradingView. It sets the layout options, grid lines, and visibility of the price scale and time scale for the chart. The chart is rendered inside a container with a responsive width and height.
This code creates a 3D globe using Three.js. It loads textures for the globe's surface and specular highlights. The globe is displayed within a Canvas, and the OrbitControls are used to manage user interaction, such as rotating the globe. The ambient light adds illumination to the scene.
Working on this project has helped me develop the following skills:
Ideas I have for expanding and improving this project in the future: