Parimutuel Typescript + React Project
This project walkthrough outlines how to create a dAPP UI that allows users to
place positions, and various other interactions using the Hxro TS SDK and the Solana web3.js Lib
Here is a sneak peek of the application built in this project walkthrough:
- Complete the Typescript SDK Quickstart, which helps with extracting the necessary information needed to showcase users
- Start the project
yarn installto install all project dependencies
yarn devto run the application
Now that all of the requirements are met, it's time to dive into the code.
- 1.Begin by changing the branch from main to doc-template.
- 2.Our next stop is
src/views/home/index.tsx, which will be the homepage view.
With the groundwork laid, set up your files:
- 1.Navigate to the
- 2.Here, you'll create four new files with the
Config.tsx- This is where we are going to set our global
configvariable for the
PariBox.tsx- This component will be used for each parimutuel market we want to add
PlacePositionBox.tsx- This component will handle the amount a user wants to set for a trade and make the call to the PlacePosition component to place the trade
PlacePosition.tsx- This component will handle the placement of the position and send a transaction request to the user's wallet