> ## 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={42161}>Arbitrum</option>
      <option value={999}>HyperEVM</option>
      <option value={1337}>HyperCore</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.

### `apiUrl`

`string`

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

### `chain`

`Chain` (a chain id `number`)

Destination chain id for the USDC payout. Initialized from the
provider's `chain` prop (default `1337`, HyperCore, on the modality
shells).

### `setChain`

`(next: Chain) => void`

Switch the destination chain at runtime. Initialized from the provider's
`chain` prop on mount.

### `currency`

`"usd" | "gbp" | "eur"`

Source fiat currency for the bank-deposit onramp.
