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

# useCalm

> Read or update the active Calm provider's configuration.

`useCalm()` reads the active provider's configuration — destination
chain, currency, and address. Throws when called outside a provider tree.

## Import

```ts theme={null}
import { useCalm } from "@calm-xyz/react";
```

## Usage

```tsx app/page.tsx theme={null}
"use client";
import { useCalm } from "@calm-xyz/react";

function ChainPicker() {
  const { chain, setChain } = useCalm();
  return (
    <select
      value={chain}
      onChange={(e) => setChain(Number(e.target.value))}
    >
      <option value={1}>Ethereum</option>
      <option value={8453}>Base</option>
      <option value={999}>HyperEVM</option>
      <option value={1337}>HyperCore</option>
      <option value={4326}>MegaETH</option>
      <option value={143}>Monad</option>
      <option value={137}>Polygon</option>
      <option value={42161}>Arbitrum</option>
    </select>
  );
}
```

## Return Type

```ts theme={null}
import { type CalmContext } from "@calm-xyz/react";
```

### `address`

`` `0x${string}` ``

The wallet address the active provider is configured with. Always present —
the provider throws during render without one.

### `apiUrl`

`string`

The Calm API root (`https://api.calmtreasury.xyz` by default; the
provider's `apiUrl` prop overrides).

### `name`

`string`

Your app's name, as your users know it. Rendered beside balances.

### `chain`

`Chain` (a chain id `number`)

Destination chain id for the payout. Initialized from the provider's `chain`
prop. See [Supported chains and tokens](/chains) for the ids and what each
chain settles in.

### `setChain`

`(next: Chain) => void`

Switch the destination chain at runtime.

### `destinationToken`

`"USDC" | "USDm" | "AUSD" | "USDC.e"`

Which of `chain`'s payout tokens the deposit settles into. Set once on the
provider — the end user never picks it. Only Polygon and Monad offer a
choice; see [Supported chains and tokens](/chains).

### `currency`

`"USD" | "GBP" | "EUR"`

Display currency for prices and balances.

### `country`

`string`

The buyer's country, ISO-3166 alpha-2. The card rail's payment-method catalog
is keyed by country, and quotes price per (country, method).

### `locale`

`string`

The BCP-47 locale amounts render in — `"en-US"`, `"de-DE"`, `"fr-FR"`, and
any other tag the runtime's `Intl` supports. Separators and grouping follow
the locale's own conventions; digits are always ASCII, whatever numbering
system the locale names. A tag `Intl` doesn't support falls back to
`"en-US"` rather than throwing.
