Skip to main content
Core of the SDK — addresses, factories for market / pool / user, catalog, balances, and create / redeem / burn. Import from @voiz/markets-sdk. Prefer instance methods and client.market|pool|user with a viem WalletClient or injected sendCalls. Call encoding and submission stay internal.

Construction

VoizMarketsClient

In React, prefer useVoiz().client over constructing by hand.

ClientConfig

withAddresses

Returns a new client with address overrides merged into the current map.

Factories

VoizMarket, VoizPool, and VoizUser are not root-exported — obtain them here.

market

VoizMarket at address.

pool

VoizPool for an outcome token (optional collateral override).

user

VoizUser at address (trades / share positions / LP).

Catalog

listMarketAddresses

On-chain factory market list (zeros filtered out).

isMarket

Whether address is in the live factory market list.

listMarkets

Homepage catalog: indexer-first market summaries, with RPC factory + load fallback.

ListMarketsResult

getErc20Balance

ERC-20 balanceOf for any token.

getCollateralBalance

Collateral (addresses.collateral) balance for owner.

Writes

createMarket

Creates a market and resolves marketAddress from receipts / hashes when possible.
Opaque sender result, extracted hashes, and marketAddress when it can be parsed from receipts / waited hashes.

redeem

Redeems outcome tokens for collateral after resolution (or as allowed by the market).

burn

Burns an LP NFT position via the PositionManager (same send path as redeem / swap). Pass outcomeToken (and optional collateralToken); the SDK builds the Uniswap v4 PoolKey internally.