Frontend Patterns

The frontend examples in vara-dapp-patterns/frontend show how to organize React-side interaction with Vara programs without hiding the important execution boundaries.

Included patterns

PatternFocusSource
Preparing Program TransactionsTurn UI parameters into a ready-to-sign transactionfrontend/patterns/hooks/prepare-program-tx
Executing Prepared Transactions with React QueryWrap signAndSend() into a mutation with consistent statefrontend/patterns/hooks/program-tx-mutation
Verified Sign & SendConfirm real program-level success, not just block inclusionfrontend/patterns/hooks/verified-sign-and-send
Provider CompositionCentralize API, account, alert, query, router, and theme providersfrontend/patterns/providers/with-providers
Query ProviderConfigure React Query for explicit blockchain-style invalidationfrontend/patterns/providers/query-provider
EZ TransactionsCombine signless sessions and gasless vouchers in the browserfrontend/patterns/ez-transactions

A useful mental model

These examples intentionally separate three stages:

  1. Prepare a valid extrinsic.
  2. Execute it in a controlled way.
  3. Verify that the program actually succeeded.

That split makes React code easier to test, easier to reuse across components, and less likely to mix UI state with chain-specific error handling.

On this page