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

# Portal deposits

# Portal Deposit Addresses

Give a user a reusable, public, exchange-style deposit address that credits into
their shielded balance. See
[Portal Deposit Addresses](https://docs.privacyboost.io/sdk/concepts/portal-deposits.md) for the concept and
trust model.

## usePortal

`usePortal()` wraps the `sdk.portal` resource. It loads every portal of the
authenticated account on mount, paging through `listPage` for you, and exposes
each action with the shared `{ loading, error }` contract. Portals are bound to
the chain the root SDK was configured for, so the hook always reads the root
client and does not follow the provider's active client.

```tsx theme={null}
import { usePortal } from '@sunnyside-io/privacy-boost-react';

function PortalList() {
  const { portals, loading, error, create, refresh, delegateAddress } = usePortal();

  const createPortal = async () => {
    if (!(await delegateAddress())) {
      throw new Error('This server does not support portal deposits.');
    }
    const portal = await create();
    console.log('Deposit address:', portal.address); // share this publicly
    await refresh();
  };

  if (loading) return <Spinner />;
  if (error) return <p>{error.message}</p>;

  return (
    <>
      <button onClick={createPortal}>Create portal</button>
      <ul>{portals.map((p) => <li key={p.address}>{p.address}</li>)}</ul>
    </>
  );
}
```

The hook also carries `listPage`, `depositsPage`, `status`, `sweep`, `reclaim`
and `withdraw`. See
[`usePortal()`](https://docs.privacyboost.io/sdk/react/api-reference#useportal) for the full return shape.

## Reading the minimum deposit

Call `sweepRequirements()` from `usePortal()` when preparing the deposit display.
It needs a connected wallet and a valid read session, including a locked but
readable session, and does not unlock or request a signature.

```tsx theme={null}
const { sweepRequirements } = usePortal();

const readMinimumEth = async () => {
  const { minSweepAmount, nativeGasReserve } = await sweepRequirements();
  const minimumWeth = minSweepAmount > 0n ? minSweepAmount : 1n;
  return nativeGasReserve + minimumWeth; // Wei, for an empty portal.
};
```

The threshold is read on-chain on each call; deployment metadata is cached for
five minutes. The reserve is a constant for the supported delegate version.
See [receiving deposits](https://docs.privacyboost.io/sdk/typescript/guides/portal-deposits.md#receiving-deposits)
for existing-balance handling, refreshing the threshold, and approximate USD
values.

## Reaching the resource directly

`usePrivacyBoost()` returns the underlying TypeScript SDK instance, whose
`sdk.portal` resource is what the hook delegates to. Use it when you want to
drive paging yourself rather than hold the whole list in state. The full method
surface and types are documented in the
[TypeScript Portal Deposits guide](https://docs.privacyboost.io/sdk/typescript/guides/portal-deposits.md).

## Next steps

* [TypeScript Portal Deposits guide](https://docs.privacyboost.io/sdk/typescript/guides/portal-deposits.md): full API
* [Portal Deposits concept](https://docs.privacyboost.io/sdk/concepts/portal-deposits.md)
* [`usePortal()`](https://docs.privacyboost.io/sdk/react/api-reference#useportal): the hook's return shape


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.