Skip to main content
Mutation hooks wrap the high-level actions with TanStack Query’s useMutation. On success, each hook automatically invalidates the relevant caches so your UI stays in sync.

usePlaceBet

Places an encrypted private bet. See Place bet for the full parameter reference.
TypeScript
Invalidates on success: market, user positions, global state.

useCreateMarket

Creates a YesNo or MultiOutcome market.
TypeScript
Invalidates on success: all markets, global state.

useResolveMarket

Posts the real-world outcome after market close. Only the resolver wallet can call this.
TypeScript
Invalidates on success: the resolved market.

useClaimPayout

Claims the winner’s payout after a market becomes claimable.
TypeScript
Invalidates on success: position, market.

useClaimRefund

Claims a refund when the resolver never posted an outcome.
TypeScript
Invalidates on success: position, market.

useCancelMarket

Cancels a market with zero bets. Returns the creator’s bond.
TypeScript
Cancellation is only allowed when totalBetsCount === 0. Use cancelEligibility(market) to pre-flight check before showing the button.
Invalidates on success: market, all markets.

useWithdrawCreatorFunds

Withdraws bond plus accumulated creator fees after resolution.
TypeScript
Invalidates on success: market, LP position.

Dispute hooks v0.2+

See Resolution for the full flows.
TypeScript

Auto-invalidation summary