> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voiz.digital/llms.txt
> Use this file to discover all available pages before exploring further.

# Wrap the app

> VoizProvider builds the client. Your UI just calls useVoiz().

Import from `@voiz-digital/markets-sdk/react`. Pass `sendCalls` for AA. After that, screens only need `const { client } = useVoiz()`.

## Provider

### VoizProvider

Builds a memoized `VoizMarketsClient` from chain, clients, and an optional custom sender, and puts it in React context.

```tsx theme={null}
<VoizProvider
  chainId={chainId}
  publicClient={publicClient}
  walletClient={walletClient}
  sendCalls={sendCalls} // optional AA / Privy
>
  {children}
</VoizProvider>
```

```ts theme={null}
// returns
JSX.Element
```

### VoizProviderProps

```ts theme={null}
type VoizProviderProps = {
  chainId: number
  publicClient: PublicClient
  /** Full address map. If omitted, resolved via `getAddresses(chainId)`. */
  addresses?: ChainAddresses
  /** Optional EOA / injected wallet for the client and default `sendCalls`. */
  walletClient?: WalletClient
  /**
   * Optional custom sender (AA / Privy). Injected onto `VoizMarketsClient`.
   * May receive `{ requiredSigner }` for admin-gated writes (e.g. resolve).
   * If omitted and `walletClient` is set, defaults to sequential
   * `walletClient.sendTransaction`.
   */
  sendCalls?: VoizSendCalls
  children: ReactNode
}
```

## Hook

### useVoiz

Full Voiz React context. Throws if used outside `<VoizProvider>`. Prefer `const { client } = useVoiz()` for protocol reads and writes.

```ts theme={null}
const { client, addresses, chainId } = useVoiz()
```

```ts theme={null}
// returns VoizContextValue
{
  client: VoizMarketsClient
  addresses: ChainAddresses
  chainId: number
  publicClient: PublicClient
  walletClient?: WalletClient<Transport, Chain | undefined, Account>
  sendCalls?: VoizSendCalls
}
```

`addresses` is the live `ChainAddresses` map — not Uniswap v4 managers:

```ts theme={null}
type ChainAddresses = {
  chainId: number
  marketFactory: Address
  adminOracle: Address
  multisigOracle: Address
  router: Address
  collateral: Address
  conditionalTokens: Address
}
```

## Context types

### VoizContextValue

```ts theme={null}
type VoizContextValue = {
  client: VoizMarketsClient
  addresses: ChainAddresses
  chainId: number
  publicClient: PublicClient
  walletClient?: WalletClient<Transport, Chain | undefined, Account>
  /** Prefer high-level client / market / pool methods. */
  sendCalls?: VoizSendCalls
}
```

### VoizSendCalls

Alias of the SDK `SendCalls` type for React injection.

```ts theme={null}
type VoizSendCalls = (
  calls: Call[],
  opts?: SendCallsOptions
) => Promise<unknown>
```

### SendCallsOptions

Options for injected AA / Privy senders (also re-exported from React).

```ts theme={null}
type SendCallsOptions = {
  /**
   * Force a specific EOA / wallet to sign (e.g. marketAdmin for AdminOracle).
   * Apps with smart+EOA dual wallets should honor this when routing.
   */
  requiredSigner?: Address
}
```

## Next

[Helpers](/helpers)
