@voiz/markets-sdk/react.
Install
PublicClient, plus a wallet or AA sender for writes. Typical stacks use wagmi/viem for RPC and Privy (or another AA wallet) for sendCalls.
Wrap the app
PasschainId and publicClient. Optionally override addresses, attach a walletClient, or inject custom sendCalls (Privy / smart-wallet batch).
sendCalls but pass walletClient, the SDK falls back to sequential walletClient.sendTransaction. If you omit addresses, they resolve via getAddresses(chainId).
Use the client
useVoiz() returns { client, addresses, chainId, publicClient, walletClient?, ... } and throws outside VoizProvider.
Quote and swap
1
Pick a pool
Outcome tokens live on each
MarketSummary as wrappedTokens (real outcomes first; Invalid last). Use client.pool(outcomeToken).2
Quote exact-in
Call
pool.quoteTrade for a live RPC quote. Prefer it over display prices for trade UI.3
Swap
Pass the same
side / amountIn, a slippage-aware minAmountOut, and the token-holding user (the AA smart wallet address when using Privy).Where to go next
- Key concepts — Client → Market → Pool → User, indexer vs RPC
- Trade guide — deeper quote/swap behavior
- Seed guide —
quoteSeed→market.seed