This is the React frontend example to interact with satoshi-coin-flip smart contract.
You can check out the smart contract repository to understand how the game works which then help you to understand how to use the UI.
This dApp was created using @mysten/create-dapp that sets up a simple React
Client dApp using the following tools:
- React as the UI framework
- TypeScript for type checking
- Vite for build tooling
- Radix UI for pre-built UI components
- ESLint
@mysten/dapp-kitfor connecting to wallets and loading data- pnpm for package management
Disclaimer: This frontend acts as example to showcase how to interact with Sui Move smart contract using Typescript SDK
@mysten/sui.jsand React dApp kit@mysten/dapp-kit. It is not meant to be used for complete production-grade product
- You need to install pnpm
- Understanding how the game is implemented by going through smart contract repository
- Spin up Sui local network
- Deploy the coin flip smart contract using CLI
To install dependencies you can run
pnpm installTo start your dApp in development mode run
pnpm devTo let the frontend know which smart contract they need to interact with, you need to place the PACKAGE_ID and HOUSECAP_ID (collected from publish package step) into the constants.tsx
To build your app for deployment you can run
pnpm buildThe UI will have two tabs side by side:
Playertab includes all operations related to Player roleHousetab includes all operations related to House role
Due to the way the UI is structure:
- React components related to
Playertab reside insrc/containers/Player - React components related to
Housetab reside insrc/containers/House