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

# Using the Wallet

> Read auth state, sign messages and transactions, send, and read history with useHeliusWallet

## Authentication

Use the `useHeliusWallet` hook to read auth state and drive sign-in:

```tsx theme={"system"}
"use client";

import { useHeliusWallet } from "helius-wallet-kit";

export function AuthButton() {
  const { status, login, logout, address } = useHeliusWallet();

  if (status === "loading") return <p>Loading…</p>;

  if (status === "authenticated") {
    return (
      <div>
        <span>{address}</span>
        <button onClick={() => logout()}>Sign out</button>
      </div>
    );
  }

  return <button onClick={() => login()}>Sign in</button>;
}
```

Calling `login()` opens the wallet modal with the auth methods you enabled.

After sign-in, `status` becomes `"authenticated"` and `user` is populated with the user's id, sub-organization id, and wallet id.

Choose which sign-in methods appear in the dashboard — see [Configure sign-in methods](/waas/configuration#configure-sign-in-methods).

## Signing and sending

`useHeliusWallet` exposes the wallet address, signing methods, and a ready-to-use Solana `Connection` wired to Helius RPC.

### Sign a message

```tsx theme={"system"}
const { signMessage } = useHeliusWallet();
const signature = await signMessage("Sign in to Acme");
```

### Sign and send a transaction

`signAndSendTransaction` signs the transaction client-side and submits it through Helius. It takes a serialized transaction and returns the transaction signature.

```tsx theme={"system"}
import {
  Transaction,
  SystemProgram,
  PublicKey,
  LAMPORTS_PER_SOL,
  ComputeBudgetProgram,
} from "@solana/web3.js";

const { address, connection, signAndSendTransaction, getPriorityFeeLevels } =
  useHeliusWallet();

const fromPubkey = new PublicKey(address!);
const toPubkey = new PublicKey(recipient);

// Estimate a priority fee from Helius.
const fees = await getPriorityFeeLevels([address!, recipient]);

const tx = new Transaction()
  .add(ComputeBudgetProgram.setComputeUnitPrice({ microLamports: fees.medium }))
  .add(
    SystemProgram.transfer({
      fromPubkey,
      toPubkey,
      lamports: 0.01 * LAMPORTS_PER_SOL,
    }),
  );

const { blockhash } = await connection.getLatestBlockhash();
tx.recentBlockhash = blockhash;
tx.feePayer = fromPubkey;

const serialized = tx.serialize({
  requireAllSignatures: false,
  verifySignatures: false,
});

const signature = await signAndSendTransaction(serialized);
```

<Tip>
  Use `signTransaction` instead of `signAndSendTransaction` when you want the
  wallet's signature without broadcasting — for example, to add it to a
  multi-party transaction before submitting it yourself.
</Tip>

### Read transaction history

```tsx theme={"system"}
const { getTransactions } = useHeliusWallet();
const transactions = await getTransactions({ limit: 20 });
```

<Note>
  `getTransactions` requires the [server route handler](/waas/quickstart#setup) —
  it isn't available in the default client-only (Secure RPC) mode.
</Note>

### Export the wallet

Wallets are non-custodial, so users can take their keys with them. `exportWallet` opens a secure, encrypted flow for the signed-in user to reveal and export their private key.

```tsx theme={"system"}
const { exportWallet } = useHeliusWallet();
await exportWallet();
```

## Next steps

<CardGroup cols={2}>
  <Card title="API reference" icon="code" href="/waas/api-reference">
    The full `useHeliusWallet()` surface and imports.
  </Card>

  <Card title="Migrating from Privy" icon="arrow-right-arrow-left" href="/waas/migrating-from-privy">
    Move existing Privy wallets to Helius WaaS
  </Card>
</CardGroup>
