This is an example of how to use @solana/kit and @solana/react to build a React web application.
- Connects to browser wallets that support the Wallet Standard; one or more at a time
- Fetches and subscribes to the balance of the selected wallet
- Allows you to sign an arbitrary message using a wallet account
- Allows you to make a transfer from the selected wallet to any other connected wallet
Start a server in development mode.
pnpm install
pnpm turbo compile:js compile:typedefs
pnpm devPress o + Enter to open the app in a browser. Edits to the source code will automatically reload the app.
Build a static bundle and HTML for deployment to a webserver.
pnpm install
pnpm turbo buildThe contents of the dist/ directory can now be uploaded to a webserver.
Access to this cluster is typically blocked by CORS rules, so it is disabled in the example app by default. To enable it, start the server or compile the application with the REACT_EXAMPLE_APP_ENABLE_MAINNET environment variable set to "true".
REACT_EXAMPLE_APP_ENABLE_MAINNET=true pnpm dev
REACT_EXAMPLE_APP_ENABLE_MAINNET=true pnpm build